# Minicpm5 Finetune

Pick the right fine-tuning framework for a MiniCPM5-1B base checkpoint and route to a...

- Repository: https://github.com/OpenBMB/MiniCPM (11776 stars)
- Category: Engineering
- License: Apache-2.0
- Last updated: 2026-09-21
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add OpenBMB/MiniCPM --skill minicpm5-finetune -g -a claude-code -y`
Codex: `npx skills add OpenBMB/MiniCPM --skill minicpm5-finetune -g -a codex -y`
Cursor: `npx skills add OpenBMB/MiniCPM --skill minicpm5-finetune -g -a cursor -y`
Gemini CLI: `npx skills add OpenBMB/MiniCPM --skill minicpm5-finetune -g -a gemini-cli -y`

## Description

Pick the right fine-tuning framework for a MiniCPM5-1B base checkpoint and route to a framework-specific cookbook skill. Use when the user wants to SFT / LoRA / DPO / continue-pretrain MiniCPM5 and has not yet committed to a specific framework, or when they say "fine-tune MiniCPM5", "train MiniCPM5", "MiniCPM5 微调", "LoRA MiniCPM5", "继续训练 MiniCPM5".

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Fine-tune MiniCPM5-1B, framework router

You're being asked to fine-tune MiniCPM5-1B. Pick exactly one framework skill below and **invoke that skill** rather than improvising, every framework has at least one MiniCPM5-specific gotcha that the dedicated skill knows about.

## 1. Required input from the user

| Variable | Example | Notes |
| --- | --- | --- |
| `BASE_MODEL` | HF id `openbmb/MiniCPM5-1B` (post-release) **or** a local path | see cluster paths below |
| `DATA` | path to JSONL in messages format | `[{"messages": [{"role":"user","content":"..."}, {"role":"assistant","content":"..."}]}]` |
| `OUTPUT_DIR` | where to write checkpoints | mkdir if missing |
| Goal | "LoRA SFT" / "full SFT" / "DPO" / "QLoRA on consumer GPU" / "continue-pretrain at scale" | drives skill choice |
| Hardware | 1× GPU / multi-node | drives skill choice |

### Default base model

If `BASE_MODEL` is not pinned, default to the Hugging Face fp16 release:

```
openbmb/MiniCPM5-1B
```

Any local directory containing `config.json` + `model.safetensors` + `tokenizer.json` also works.

## 2. Decision matrix, pick exactly one

| User says / wants | Best fit | → Skill to invoke |
| --- | --- | --- |
| YAML / WebUI driven SFT, broad community support | LLaMA-Factory | **`minicpm5-finetune-llamafactory`** |
| ChatML template + ModelScope-native SFT/DPO/KTO/ORPO | ms-swift | **`minicpm5-finetune-ms-swift`** |
| Bare-metal Python, assistant-only loss, minimal abstractions | TRL + PEFT | **`minicpm5-finetune-trl`** |
| Single-GPU LoRA / QLoRA, tight VRAM (24 GB or less) | unsloth | **`minicpm5-finetune-unsloth`** |
| mmengine config-driven SFT, OpenMMLab stack | xtuner | **`minicpm5-finetune-xtuner`** |

### Decision shortcuts

The rest: https://github.com/OpenBMB/MiniCPM/blob/HEAD/skills/minicpm5-finetune/SKILL.md
