본문으로 건너뛰기
Skillpedia
머신러닝12k · #11546

minicpm5-finetune

하는 일

이 스킬은 목표와 하드웨어에 맞는 MiniCPM5-1B 학습 프레임워크를 AI가 고르고, 맞는 안내를 따르도록 돕습니다. 모델을 학습하거나 조정하려고 하지만 아직 도구를 고르지 않은 사람을 위한 스킬입니다.

사용하는 경우

  • ✓MiniCPM5를 미세 조정하고 싶지만 프레임워크를 아직 고르지 않았을 때.
  • ✓LoRA, DPO, QLoRA 중 어떤 것이 내 하드웨어에 맞는지 알고 싶을 때.
  • ✓자신의 데이터로 MiniCPM5를 학습하거나 계속 학습시키도록 AI에게 요청하는 경우.

스킬 링크

https://github.com/OpenBMB/MiniCPM/blob/main/skills/minicpm5-finetune/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/OpenBMB/MiniCPM/blob/main/skills/minicpm5-finetune/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“고객 채팅 기록으로 MiniCPM5-1B를 미세 조정하려고 합니다. 어떤 학습 도구를 쓰는 게 좋을까요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 기본 모델, 데이터, 목표, 하드웨어를 묻고, 이를 프레임워크 안내 하나와 맞춘 뒤 그 안내를 따릅니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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) or minicpm5-finetune-trl (most control).
  • Single 24 GB consumer GPU: pick minicpm5-finetune-unsloth with load_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

자주 묻는 질문

기본 모델은 무엇인가요?

값을 주지 않으면 Hugging Face의 openbmb/MiniCPM5-1B 릴리스를 사용합니다.

어떤 데이터 형식을 기대하나요?

각 줄에 messages 목록이 들어 있는 JSONL 파일을 기대합니다.

프레임워크를 여러 개 고르나요?

아니요. 이 스킬은 요청마다 정확히 하나의 프레임워크 안내를 고르도록 설정되어 있습니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
12k
순위
#11546
라이선스
Apache-2.0
업데이트
2026. 9. 21.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬