openbmb/minicpm/minicpm5-finetune-xtuner
Claude Code and agent skill by openbmb/minicpm
- community
Checking that the SKILL.md file is still in the repository.
Fine-tune MiniCPM5-1B with xtuner (mmengine config-driven SFT). Use when the user mentions "xtuner", "mmengine", InternLM's training framework, or wants config-file-driven training.
Install
npx vskill@latest install openbmb/minicpm/minicpm5-finetune-xtunerSKILL.md
The same SKILL.md was published earlier as openbmb/minicpm/minicpm5-finetune-xtuner.
Fine-tune MiniCPM5-1B with xtuner
mmengine config-driven SFT. Uses Python config files (not YAML) and integrates with mmengine's runner / hook system.
Required input
| Var | Example | Default | |
|---|---|---|---|
BASE_MODEL | openbmb/MiniCPM5-1B | required | |
DATA | path to messages-format jsonl | required | |
WORK_DIR | ./runs/minicpm5_xtuner | required |
Steps
1. Install (once)
2. Save the config — ${WORK_DIR}/minicpm5_lora.py
🔑 `PROMPT_TEMPLATE.qwen_chat` is correct — that's the ChatML template. Do NOT usellama3_chat(which is<|start_header_id|>...<|eot_id|>and would corrupt every example).🔑 `start_factor=1e-2` for LinearLR — xtuner's defaultstart_factor=1e-5combined withconvert_to_iter_based=Trueproduces an effective LR of ~1e-9 (way too small).
3. Train — invoke train.py directly (not xtuner train)
🔑 Use `python -m xtuner.tools.train` directly — this keeps the command inside the active venv / conda env and avoids the CLI wrapper spawning a differentpython.
For multi-GPU, use the standard wrapper: NPROC_PER_NODE=8 xtuner train CONFIG --work-dir ....
4. Validate
The chat template should resolve into proper <|im_start|>...<|im_end|> markers (visible from DatasetInfoHook output). Loss should decrease.
Convert pth → HF adapter
xtuner saves epoch_X.pth (mmengine format). Convert to PEFT adapter:
Then load with PEFT:
Common pitfalls
- `libGL.so.1: cannot open shared object file`: replace
opencv-python→opencv-python-headless(see install step). - `xtuner train` hangs without logs: invoke
train.pydirectly (see step 3). - `Failed to import mmengine.runner: ALLOWED_LAYER_TYPES`:
transformerstoo new. Pintransformers==4.57.x. - Loss flat: scheduler LR underestimated. Use
start_factor=1e-2(see config above).
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-xtuner/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-xtuner)