LLAMA-QUANTIZE(1)
π LLAMA-QUANTIZE(1) π
okay bestie, welcome to User Commands β¨ this is the group chat where your giant f32 model gets a whole new body. it's literally called llama-quantize and it's giving make it smol energy π¦
πΈ NAME πΈ
llama-quantize β no cap, that's the whole name, that IS the vibe π
β¨ DESCRIPTION β¨
here's how you call it, copy this exactly okay:
usage: llama-quantize [--help] [--allow-requantize]
[--leave-output-tensor] [--pure] [--imatrix] [--include-weights]
[--exclude-weights] [--output-tensor-type]
[--token-embedding-type] [--tensor-type] [--tensor-type-file]
[--prune-layers] [--keep-split] [--override-kv] [--dry-run]
model-f32.gguf [model-quant.gguf] type [nthreads]
so likeβ¦ you hand it a model-f32.gguf, you may hand it a model-quant.gguf output name, you tell it a type, and may tell it nthreads. that's the whole plot π
π OPTIONS π
fr fr read the warnings, bestie, I'm not being dramatic, the manpage is being dramatic and I'm just the messenger π
--helpβ shows you the help. classic icon behavior π«Ά--allow-requantizeβ lets you requantize tensors that have already been quantized.
WARNING: this can severely reduce quality compared to quantizing from 16bit or 32bit! like. severely severely. π₯
--leave-output-tensorβ leavesoutput.weightun(re)quantized. this makes the model bigger but might also make it better, especially when you're requantizing. main character tradeoff energy β¨--pureβ disables k-quant mixtures and quantizes all tensors to the same type. one type to rule them all, no blending, periodt π--imatrixfile_name β use the data in file_name as the importance matrix for quant optimizations. iykyk πΈ--include-weightstensor_name β use the importance matrix for this/these tensor(s). π--exclude-weightstensor_name β do not use the importance matrix for this/these tensor(s). π--output-tensor-typeggml_type β use this ggml_type for theoutput.weighttensor. π--token-embedding-typeggml_type β use this ggml_type for the token embeddings tensor. π§--tensor-typetensor_name=ggml_type β quantize this tensor to this ggml_type. this is an advanced option to selectively quantize tensors. may be specified multiple times. example:--tensor-type attn_q=q8_0β--tensor-type-filetensor_types.txt β a list of tensors to quantize to a specific ggml_type. this is an advanced option to selectively quantize a long list of tensors. the file should use the same format as above, separated by spaces or newlines. π--prune-layersL0,L1,L2... β comma-separated list of layer numbers to prune from the model.
WARNING: this is an advanced option, use with care. π«£
--keep-splitβ generate the quantized model in the same shards as input. no re-sharding drama, we keep the fit π--override-kvKEY=TYPE:VALUE β override model metadata by key in the quantized model. may be specified multiple times.
WARNING: this is an advanced option, use with care. π
--dry-runβ calculate and show the final quantization size without performing quantization. example:llama-quantize --dry-run model-f32.gguf Q4_Kπ
note:--include-weightsand--exclude-weightscannot be used together. pick a lane bestie π«
π¦ allowed quantization types π¦
okay this is the menu, the whole menu, nothing skipped, let's go π
40orQ1_0β 1.125 bpw quantization41orQ2_0β 2.25 bpw quantization (group 64)2orQ4_0β 4.34G, +0.4685 ppl @ Llama-3-8B3orQ4_1β 4.78G, +0.4511 ppl @ Llama-3-8B38orMXFP4_MOEβ MXFP4 MoE8orQ5_0β 5.21G, +0.1316 ppl @ Llama-3-8B9orQ5_1β 5.65G, +0.1062 ppl @ Llama-3-8B19orIQ2_XXSβ 2.06 bpw quantization20orIQ2_XSβ 2.31 bpw quantization28orIQ2_Sβ 2.5 bpw quantization29orIQ2_Mβ 2.7 bpw quantization24orIQ1_Sβ 1.56 bpw quantization31orIQ1_Mβ 1.75 bpw quantization36orTQ1_0β 1.69 bpw ternarization37orTQ2_0β 2.06 bpw ternarization10orQ2_Kβ 2.96G, +3.5199 ppl @ Llama-3-8B21orQ2_K_Sβ 2.96G, +3.1836 ppl @ Llama-3-8B23orIQ3_XXSβ 3.06 bpw quantization26orIQ3_Sβ 3.44 bpw quantization27orIQ3_Mβ 3.66 bpw quantization mix12orQ3_Kβ alias for Q3_K_M22orIQ3_XSβ 3.3 bpw quantization11orQ3_K_Sβ 3.41G, +1.6321 ppl @ Llama-3-8B12orQ3_K_Mβ 3.74G, +0.6569 ppl @ Llama-3-8B13orQ3_K_Lβ 4.03G, +0.5562 ppl @ Llama-3-8B25orIQ4_NLβ 4.50 bpw non-linear quantization30orIQ4_XSβ 4.25 bpw non-linear quantization15orQ4_Kβ alias for Q4_K_M14orQ4_K_Sβ 4.37G, +0.2689 ppl @ Llama-3-8B15orQ4_K_Mβ 4.58G, +0.1754 ppl @ Llama-3-8B17orQ5_Kβ alias for Q5_K_M16orQ5_K_Sβ 5.21G, +0.1049 ppl @ Llama-3-8B17orQ5_K_Mβ 5.33G, +0.0569 ppl @ Llama-3-8B18orQ6_Kβ 6.14G, +0.0217 ppl @ Llama-3-8B7orQ8_0β 7.96G, +0.0026 ppl @ Llama-3-8B1orF16β 14.00G, +0.0020 ppl @ Mistral-7B32orBF16β 14.00G, -0.0050 ppl @ Mistral-7B0orF32β 26.00G @ 7BCOPYβ only copy tensors, no quantizing
aaand that's the whole page bestie, every flag, every number, every warning, nothing left behind π
this lil manual lives under debian, dated September 2026, and goes by LLAMA-QUANTIZE(1) β mwah, go quantize something, you got this πβ¨
π¦ where this page comes from
- ubuntu stonking: llama.cpp-tools 10438+dfsg-1ubuntu1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms