minicpm5-finetune
Ce qu’il fait
Cette compétence aide votre IA à choisir un outil d'entraînement pour MiniCPM5-1B selon votre objectif et votre matériel, puis suit le guide correspondant. Elle s'adresse aux personnes qui veulent entraîner ou ajuster le modèle sans avoir encore choisi d'outil.
Quand l’utiliser
- ✓Quand vous voulez affiner MiniCPM5 et que vous n'avez pas encore choisi d'outil.
- ✓Lorsque vous voulez savoir si LoRA, DPO ou QLoRA convient à votre matériel.
- ✓Lorsque vous demandez à votre IA d'entraîner ou de poursuivre l'entraînement de MiniCPM5 sur vos données.
Lien du skill
https://github.com/OpenBMB/MiniCPM/blob/main/skills/minicpm5-finetune/SKILL.mdCopiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.
Comment l’utiliser
Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.
Message prêt à coller
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Je veux affiner MiniCPM5-1B à partir de mes journaux de discussion clients. Quel outil d'entraînement devons-nous utiliser ?”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
La compétence demande le modèle de base, vos données, votre objectif et votre matériel, puis les associe à un seul guide d'outil et le suit.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis GitHub.
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
- First time fine-tuning MiniCPM5: pick
minicpm5-finetune-llamafactory— most documented, fewest surprises. - Need DPO / KTO / ORPO: pick
minicpm5-finetune-ms-swift(best out-of-the-box) orminicpm5-finetune-trl(most control). - Single 24 GB consumer GPU: pick
minicpm5-finetune-unslothwithload_in_4bit=True. - Target is llama.cpp / Ollama / LM Studio / MiniCPM Desk Pet (GGUF): train with any skill above, then convert the adapter with
minicpm5-finetune-gguf-lora(PEFT adapter → GGUF LoRA).
3. Invocation contract
Each sub-skill expects BASE_MODEL, DATA, OUTPUT_DIR and outputs an LoRA adapter (or full checkpoint) at OUTPUT_DIR/. Read the picked sub-skill in full before running — every framework has at least one MiniCPM5-specific gotcha:
| Framework | Gotcha (skill handles it for you) |
|---|---|
| LLaMA-Factory | template: minicpm5 (needs LLaMA-Factory from source; NOT template: empty / llama3) |
| ms-swift | mandatory --model_type llama --template chatml flags |
| TRL | training-only chat template patch for assistant_only_loss=True |
| unsloth | transformers==4.57.3 pin if vLLM is in the same env |
| xtuner | prompt_template=PROMPT_TEMPLATE.qwen_chat (ChatML), use openai_map_fn for messages-format data, start_factor ≥ 1e-2 |
4. Universal sanity check after training
Regardless of framework:
# 1. Verify adapter (or full ckpt) was saved
ls "$OUTPUT_DIR" # adapter_model.safetensors + adapter_config.json (LoRA) OR a full HF directory
# 2. Quick inference check (HF-side, works for both LoRA and full)
python -c "
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained('$BASE_MODEL', torch_dtype=torch.bfloat16, device_map='auto').eval()
model = PeftModel.from_pretrained(base, '$OUTPUT_DIR').eval() # skip this line for full SFT
tok = AutoTokenizer.from_pretrained('$BASE_MODEL')
inputs = tok.apply_chat_template([{'role':'user','content':'1+1=?'}], add_generation_prompt=True, enable_thinking=False, return_tensors='pt').to(model.device)
out = model.generate(inputs, max_new_tokens=32, do_sample=False)
print(tok.decode(out[0][inputs.shape[-1]:], skip_special_tokens=True))
"
Expected: a coherent answer (e.g. "2"). If it's gibberish or empty, training broke (most likely chat template misalignment — ⮕ check the framework's gotcha row above).
5. Don't reinvent: link to the cookbook
Each sub-skill is paired with a one-page cookbook in docs/finetune/. The skill is the machine-readable shortcut; the cookbook is the human-readable reference.
6. Next step — deploying the adapter
The adapter at `OUTPUT_D
Questions fréquentes
Quel est le modèle de base par défaut ?
Si vous n'en donnez pas, la compétence utilise la version openbmb/MiniCPM5-1B disponible sur Hugging Face.
Quel format de données est attendu ?
La compétence attend un fichier JSONL, où chaque ligne contient une liste de messages.
Choisit-elle plusieurs outils ?
Non. Elle est conçue pour choisir exactement un guide d'outil pour chaque demande.
Détails
Description originale de l’auteur
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".
repo: OpenBMB/MiniCPM
Popularité
- Étoiles GitHub
- 12k
- Position au classement
- #11546
- Licence
- Apache-2.0
- Mis à jour
- 21/09/2026
Commentaires
- …
Autres skills de ce dépôt
minicpm5-deploy-litert
12kPermet à votre agent d'exécuter MiniCPM5 sur un ordinateur ou un téléphone Android avec le runtime LiteRT-LM de Google, à partir d'un seul fichier.
minicpm5-deploy-llama-cpp
12kAide votre agent à exécuter MiniCPM5 avec llama.cpp sur un processeur ou une carte grand public, à l'aide de fichiers GGUF prêts à l'emploi.
minicpm5-deploy-lmstudio
12kAide votre agent à exécuter MiniCPM5 dans LM Studio, avec sa fenêtre de discussion et son serveur local au format OpenAI.
minicpm5-deploy-mlx
12kPermet à votre agent d'exécuter MiniCPM5 sur un Mac Apple Silicon avec le framework MLX, pour une discussion et une génération locales rapides.
Skills similaires
pytorch-patterns
280kAide votre agent à utiliser PyTorch pour les modèles de machine learning. Il applique les bonnes pratiques pour un entraînement efficace et des résultats reproductibles.
evm-token-decimals
280kAide votre agent à éviter les erreurs de nombres décimaux sur différents réseaux blockchain. Il garantit des valeurs de tokens exactes dans les transactions et les calculs.
ito-inference
280kPermet à votre agent de vérifier la disponibilité des modèles d'IA. Il relie la demande de calcul au service de modèle prêt à l'emploi.