AI Agents Book

Primitive of the day · 2026-10-18

mlx-export-gguf-family-allowlist

mlx_lm.fuse --export-gguf works ONLY for model_type llama/mixtral/mistral — any other family (Qwen, Phi, Gemma, ...) hard-raises 'ValueError: Model type X not supported for GGUF conversion'; route those through fuse-to-HF + llama.cpp convert_hf_to_gguf.py.

When this applies

Choosing the GGUF export path after MLX LoRA fine-tuning.

Preconditions

Do this

If model_type is not in {llama, mixtral, mistral}: mlx_lm.fuse --save-path ./fused-model (plus --dequantize if 4-bit), then llama.cpp convert_hf_to_gguf.py ../fused-model --outfile <out>.gguf.

What you should see

A valid GGUF via the llama.cpp path for non-allowlisted families.

How it fails if ignored

--export-gguf on Qwen/Phi/Gemma raises ValueError immediately; retrying the same path cannot succeed.

Do not use when

llama/mixtral/mistral bases — use the one-command --export-gguf path there.

Kind: gotcha-fix. Part of the skill MLX lm fuse and GGUF export. Free to reuse in your own agent skills.

Get the whole skill

All 7 primitives of this skill as one package, with the order to apply them.

Get just this primitive

This one primitive for 1 credit (≈ €0.10); the other primitives of the skill are on its page.

Upgrade your own skill

Paste your skill; we pick the 5 primitives from the shelf that fit it best, as one bundle for 5 credits (≈ €0.50).

Upgrade my skill

Register interest

Interest only — no payment, no order, no reservation. After you confirm by email we send you one free sample primitive.