r6410418/jackrong-llm-finetuning-guide/qwen-mtp-gguf
- community
Checking that the SKILL.md file is still in the repository.
Complete agent-ready workflow for Qwen-family MTP or nextn GGUF conversion and release. Use when Codex or another coding agent needs to inspect a user's machine, estimate disk/RAM requirements from Hugging Face model sizes and requested quant formats, bootstrap llama.cpp and Python dependencies, extract MTP heads from a matching official/base Qwen model, merge them into a fine-tuned or target safetensors model, run local HF/GGUF smoke tests with Qwen chat formatting, quantize to GGUF, and optionally upload or resume Hugging Face releases.
Install
npx vskill@latest install r6410418/jackrong-llm-finetuning-guide/qwen-mtp-ggufSKILL.md
Qwen MTP GGUF
Operating Principle
Run this as a staged release pipeline, not a blind conversion:
- Identify the target model and matching MTP source model.
- Preflight the environment, disk, RAM, tools, token access, and config compatibility.
- Ask the user to choose upload strategy when it affects disk use.
- Prepare the target HF directory and inject only missing MTP/nextn tensors.
- Convert to a temporary F16 GGUF, smoke-test locally, then quantize.
- Upload with resume support, or keep local artifacts if the user chooses local-only.
MTP/GGUF conversion and llama.cpp quantization do not require a GPU. GPU acceleration can make later inference tests faster, but the default smoke test should use CPU mode (-ngl 0) so it works on common machines.
Required User Inputs
Ask for missing items only when they cannot be inferred safely:
- Target model: HF repo ID or local HF model directory.
- Matching MTP source model: the official/base Qwen-family repo with the same architecture, size, tokenizer, and MTP layout.
- Output mode: local-only, stream upload, or batch upload.
- Output repo ID when uploading.
- Quantization formats. Default full matrix:
q2_k,q3_k_s,q3_k_m,q3_k_l,iq4_xs,q4_k_s,q4_k_m,q5_k_s,q5_k_m,q6_k,q8_0,bf16.
If the target and MTP source configs disagree on core architecture fields, stop and ask before continuing.
Upload Strategy Choice
When the user has not specified a strategy, explain the tradeoff briefly and ask:
stream: quantize one GGUF, upload it, then delete it. Lowest peak disk use and best default for large models.batch: quantize everything first, then upload. Useful when network is unstable but requires much more disk.local-only: prepare all GGUF files locally without uploading.
Use stream when the user asks for a full large-model release and does not care about keeping local copies.
Environment Bootstrap
Use scripts/bootstrap_qwen_mtp_env.sh when llama.cpp or Python dependencies are missing.
Backend options are cpu, cuda, metal, and vulkan. Prefer cpu unless the user explicitly wants accelerated smoke tests or already has a configured GPU toolchain.
Preflight
Always run preflight before downloading large model weights:
Review preflight_report.md before running. It reports:
- OS, CPU cores, total RAM, detected GPU hint, Python version.
- Required commands and packages.
- llama.cpp converter, quantizer, and
llama-clistatus. - Target model size from HF file metadata or local files.
- Minimal MTP shard download size.
- Estimated F16/BF16 and quantized GGUF sizes.
- Required free disk with a safety factor.
- Recommended RAM and config mismatch warnings.
Full Pipeline
The pipeline:
- Downloads or copies the target HF model.
- Detects existing MTP/nextn tensors and validates index mappings.
- Downloads only the MTP source shards listed in the source index.
- Saves
mtp_heads.safetensors, updatesmodel.safetensors.index.json, and validates all new keys. - Converts F16 for quantization and BF16 directly from the prepared HF directory.
- Runs GGUF smoke tests before upload when enabled. Prefer the model's embedded chat template when llama.cpp supports it; use ChatML only as a minimal fallback for load/generation sanity checks.
- Lists remote HF files before upload and skips completed GGUFs on resume.
- Deletes local GGUF files only after confirmed upload when cleanup is enabled.
Smoke Tests
Use the GGUF smoke test for release validation:
Use the HF smoke test only when the machine can load the HF model:
For Qwen-family chat formatting, use apply_chat_template(..., add_generation_prompt=True, tokenize=False) on the HF side. For GGUF, prefer the chat template embedded by llama.cpp conversion or copied from tokenizer_config.json; use raw ChatML only as a fallback smoke test, not as the quality/reasoning benchmark template.
Agent Compatibility
This skill is Codex-native, but the workflow is intentionally agent-agnostic:
- Claude Code, Codex, OpenCode, Qwen Code, Hermes, and similar agents can run the same scripts from a shell.
- The agent should call
--preflight-only, summarize blockers, ask for the upload strategy if needed, then run the full command. - Keep user-specific tokens, paths, private repo names, and logs out of public PRs and model cards.
References
- Read
references/environment-and-sizing.mdbefore changing preflight logic or resource thresholds. - Read
references/technical-flow.mdbefore changing extraction, injection, conversion, or upload behavior. - Read
references/agent-integration.mdwhen packaging this for another agent framework. - Read
references/troubleshooting.mdwhen conversion, tensor lookup, disk, RAM, or upload steps fail.
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 repositoryCheckingqwen-mtp-gguf/SKILL.md
Popularity
- Repository stars
- 1,312
- Repository forks
- 222
- 7-day trend score
- 36
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/r6410418/jackrong-llm-finetuning-guide/qwen-mtp-gguf)