openbmb/minicpm/minicpm5-finetune-llamafactory
Claude Code and agent skill by openbmb/minicpm
- community
Checking that the SKILL.md file is still in the repository.
Fine-tune MiniCPM5-1B or MiniCPM5-2B with LLaMA-Factory (YAML-driven SFT / DPO / WebUI). Use when the user wants to fine-tune via LLaMA-Factory, llamafactory-cli, mentions YAML configs, WebUI, or asks for the most-documented community framework.
Install
npx vskill@latest install openbmb/minicpm/minicpm5-finetune-llamafactorySKILL.md
The same SKILL.md was published earlier as openbmb/minicpm/minicpm5-finetune-llamafactory.
Fine-tune MiniCPM5-1B and MiniCPM5-2B with LLaMA-Factory
YAML-driven SFT / DPO with WebUI. Most-documented community framework.
Required input
| Var | Example | Default | |
|---|---|---|---|
BASE_MODEL | openbmb/MiniCPM5-2B | required; openbmb/MiniCPM5-1B also works | |
DATA_DIR | dir containing dataset_info.json + jsonl | required | |
DATASET_NAME | name registered in dataset_info.json | required | |
OUTPUT_DIR | ./runs/minicpm5_lf | required | |
GPU_ID | 0 | 0 |
Steps
1. Install (once, in its own venv to avoid breaking vLLM)
⚠️ LLaMA-Factory requirestransformers>=4.55.0,<=5.8.0(excluding 4.57.0 and 5.6.0), which can clash with a serving stack such as vLLM. Always install it into its own venv.
2. Register the dataset (sharegpt / messages format)
${DATA_DIR}/dataset_info.json:
Each line of your_data.jsonl:
3. Write the training YAML
Save as ${OUTPUT_DIR}/lora_sft.yaml:
🔑 `template: minicpm5` is MANDATORY. It reproduces the model's ownchat_template.jinjabyte-for-byte — ChatML with MiniCPM5-2B Think mode, MiniCPM5-1B Think / No-think modes, plus XML tool calling.Do NOT usetemplate: empty. LLaMA-Factory does not delegate to the tokenizer's jinja;emptyis a genuinely empty template (bare{{content}}slots, no role markers, no EOS replacement, ReAct-style tools) that trains on a layout the model has never seen.llama3/qwen/ etc. are equally wrong. Requires LLaMA-Factory from source — see step 1.
4. Train
For multi-GPU: prepend FORCE_TORCHRUN=1 and set NPROC_PER_NODE=8.
5. Validate
Loss should decrease monotonically; you should see lines like:
After training, the LoRA adapter is at ${OUTPUT_DIR}/. Sanity-check inference:
Coherent answer ⇒ ✅. Gibberish ⇒ check template: minicpm5 in the YAML. (A clean loss curve does not confirm the template is right — a mismatched template trains just as smoothly.)
Merge LoRA for serving
The merged model is a regular LlamaForCausalLM and serves with any minicpm5-deploy-* skill.
Full SFT (no LoRA)
Replace finetuning_type: lora and the LoRA fields with finetuning_type: full. Add deepspeed: examples/deepspeed/ds_z2_config.json for multi-GPU.
Reference
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/minicpm5-finetune-llamafactory/SKILL.md
Popularity
- Repository stars
- 9,518
- Repository forks
- 625
- 7-day trend score
- 46
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/openbmb/minicpm/minicpm5-finetune-llamafactory)