minicpm5-finetune-gguf-lora
यह क्या करती है
यह स्किल आपके AI को MiniCPM5-1B के लिए LoRA adapter बनाने और उसे GGUF प्रारूप में बदलने का मार्गदर्शन देती है। यह उन लोगों के लिए है जो MiniCPM5 को GGUF मॉडल के रूप में चलाते हैं और उसका कस्टम संस्करण चाहते हैं।
कब इस्तेमाल करें
- ✓जब आपके पास प्रशिक्षित LoRA adapter है और आप उसे llama-server में लोड करना चाहते हैं।
- ✓जब आप convert_lora_to_gguf स्क्रिप्ट से LoRA adapter बदलना चाहते हैं।
- ✓जब आप MiniCPM Desk Pet ऐप में कस्टम persona या skin अपलोड करना चाहते हैं।
Skill का लिंक
https://github.com/OpenBMB/MiniCPM/blob/main/skills/minicpm5-finetune-gguf-lora/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे प्रशिक्षित MiniCPM5-1B LoRA adapter को GGUF फ़ाइल में बदलिए, जिसे llama-server लोड कर सके।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
स्किल जाँचती है कि adapter बेस मॉडल से मेल खाता है, llama.cpp की conversion स्क्रिप्ट से adapter फ़ाइलें GGUF में बदलती है, और दिखाती है कि रनटाइम पर उसे कैसे लोड करें।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Fine-tune MiniCPM5-1B → GGUF LoRA adapter
The framework skills (minicpm5-finetune-*) all emit a PEFT adapter (adapter_model.safetensors + adapter_config.json). But llama.cpp / llama-server — and the MiniCPM Desk Pet app's custom-LoRA upload — load a GGUF LoRA adapter (--lora some-adapter.gguf). This skill is the bridge: train a PEFT LoRA, then convert it to GGUF and run/upload it.
This is the path you want when the base model is served as GGUF (Desk Pet, Ollama, LM Studio, plain
llama-server). If you serve the fp16 HF base with vLLM / transformers, you don't need GGUF — load the PEFT adapter directly.
Pipeline overview
train (any minicpm5-finetune-* skill) this skill
┌────────────────────────────────────┐ ┌──────────────────────────────────┐
BASE (fp16 HF) ─► adapter_model.safetensors ─► convert_lora_to_gguf.py ─► adapter.gguf
adapter_config.json │
llama-server --lora / Desk Pet upload
Required input
| Var | Example | Default |
|---|---|---|
ADAPTER_DIR |
./runs/minicpm5_unsloth/adapter_final |
required — a PEFT dir with adapter_config.json + adapter_model.safetensors |
BASE_MODEL |
openbmb/MiniCPM5-1B (HF id) or a local fp16 HF dir |
required — must be the same base the adapter was trained on |
OUTTYPE |
f16 (recommended) / q8_0 / bf16 / f32 |
f16 |
OUT_GGUF |
./minicpm5-mylora.gguf |
<ADAPTER_DIR>/adapter_model.f16.gguf |
Don't have an adapter yet? First run a training skill — start from the router
minicpm5-finetune(or go straight tominicpm5-finetune-unslothfor single-GPU LoRA). Come back here withADAPTER_DIRpointing at its output.
Steps
1. Get llama.cpp (has the converter)
git clone --depth=1 https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
pip install -r requirements.txt # converter deps: torch, safetensors, gguf, transformers
convert_lora_to_gguf.py lives at the repo root. You only need the Python script for conversion; build the C++ binaries (step 4) only if you want to test locally.
2. Convert the PEFT adapter → GGUF
python convert_lora_to_gguf.py "$ADAPTER_DIR" \
--base "$BASE_MODEL" \
--outtype f16 \
--outfile "$OUT_GGUF"
--baseonly needs the base model's config (config.json,tokenizer.json) — not the weights. A local fp16 HF dir or an HF id both work.- If the base is only on the Hub, use
--base-model-id openbmb/MiniCPM5-1Binstead of--base(it pulls just the config). - Output is a single
.ggufof roughly the same size as the input.safetensors(a 22 MB r=16 adapter → ~22 MB GGUF).
🔑 The #1 gotcha —
base_model_name_or_pathpoints at the training machine. PEFT writes the absolute path of the base used during training intoadapter_config.json(e.g./user/.../MiniCPM5-models-fixed/official). On any other machine the converter can't find it. Always pass--base(or--base-model-id) explicitly to override it — don't rely on whatever is baked into the config. The base you pass MUST match the one you trained on, or the adapter math is meaningless.
3. (Optional) Sanity-check the GGUF metadata
python -c "import gguf,sys; r=gguf.GGUFReader('$OUT_GGUF'); print('tensors:', len(r.tensors)); print('arch:', r.get_field('general.architecture').parts[-1].tobytes().decode() if r.get_field('general.architecture') else '?')"
Expect general.type = adapter and a nonzero tensor count. MiniCPM5-1B is a Llama-architecture model, so the converter treats it as llama — this is correct, not an error.
4. Test with llama-server before shipping
You need a GGUF base model too (the adapter is applied on top of it). Grab the released base:
huggingface-cli download openbmb/MiniCPM5-1B-GGUF MiniCPM5-1B-Q8_0.gguf --local-dir .
Then:
# CLI
llama-cli -m MiniCPM5-1B-Q8_0.gguf --lora "$OUT_GGUF" \
-p "你好" -n 128 --temp 0.7 --top-p 0.95
# OpenAI-compatible server
llama-server -m MiniCPM5-1B-Q8_0.gguf --lora "$OUT_GGUF" --port 8080 --jinja
If the persona/behavior you trained shows up, the GGUF is good. If output is identical to the base, the adapter didn't load (check the --lora path and that --base matched in step 2).
Quant compatibility: a GGUF LoRA built from an fp16 adapter applies
अक्सर पूछे जाने वाले सवाल
क्या बेस मॉडल मेल खाना चाहिए?
हाँ। स्किल कहती है कि adapter उसी बेस मॉडल से होना चाहिए जिसके विरुद्ध आप बदल रहे हैं।
क्या पहले adapter प्रशिक्षित करना होगा?
हाँ। स्किल किसी दूसरी MiniCPM5 fine-tuning स्किल से बने PEFT adapter से शुरू होती है।
adapter कहाँ लोड होता है?
इसे llama-server के lora विकल्प से लोड किया जा सकता है, या MiniCPM Desk Pet ऐप में अपलोड किया जा सकता है।
जानकारी
लेखक का मूल विवरण
Fine-tune MiniCPM5-1B into a LoRA adapter and convert it to a GGUF adapter that loads directly into llama.cpp / llama-server and the MiniCPM Desk Pet app's custom-LoRA upload. Use when the user wants "GGUF LoRA", "convert LoRA to GGUF", "convert_lora_to_gguf", a custom persona/skin for the desktop pet, "桌宠自定义 LoRA", "上传 LoRA 到桌宠", or asks how to take a trained adapter and run it on a GGUF base.
repo: OpenBMB/MiniCPM
लोकप्रियता
- GitHub स्टार
- 12k
- रैंकिंग में स्थान
- #11540
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 21/9/2026
कमेंट
- …
इस repository की और skills
minicpm5-deploy-litert
12kआपके एजेंट को Google के LiteRT-LM रनटाइम से कंप्यूटर या Android फ़ोन पर MiniCPM5 मॉडल चलाने देती है, एक ही मॉडल फ़ाइल के साथ।
minicpm5-deploy-llama-cpp
12kआपके एजेंट को दिखाती है कि llama.cpp से CPU या घरेलू graphics card पर MiniCPM5 मॉडल कैसे चलाएँ, तैयार GGUF फ़ाइलों के साथ।
minicpm5-deploy-lmstudio
12kआपके एजेंट को LM Studio में MiniCPM5 मॉडल चलाने में मदद करती है, जो चैट विंडो वाला डेस्कटॉप ऐप है, और उसका लोकल OpenAI शैली का server शुरू करती है।
minicpm5-deploy-mlx
12kआपके एजेंट को Apple के MLX फ़्रेमवर्क से Apple Silicon Mac पर MiniCPM5 मॉडल सीधे चलाने देती है, तेज़ लोकल चैट और टेक्स्ट जनरेशन के लिए।
मिलती-जुलती skills
pytorch-patterns
280kआपके एजेंट को machine learning models के लिए PyTorch इस्तेमाल करने में मदद करता है। कुशल model training के best practices लागू करता है और नतीजों को दोहराने लायक रखता है।
evm-token-decimals
280kयह आपके एजेंट को अलग-अलग blockchain networks पर decimal numbers की गलतियों से बचने में मदद करता है। यह transactions और calculations में token values सही रखने का ध्यान रखता है।
ito-inference
280kआपके एजेंट को AI models की उपलब्धता जाँचने देता है। यह compute request को तैयार model service से जोड़ता है।