← All notes

Quantize a GGUF model with llama-quantize

Answer: The quantize tool reads a GGUF input model file. That input is typically F32 or BF16, a high-precision starting point, and the output is a quantized format. Quantization is done in two phases: convert the original model to GGUF format, then quantize the converted GGUF file.

llama-quantize

Quantization reduces the precision of model weights, for example from 32-bit floats to 4-bit integers, which also shrinks the model's size and can speed up inference. This process may introduce some accuracy loss. This can be minimized by using a suitable imatrix file.

For example, quantize to Q4_K_M with llama-quantize. Options include allow-requantize, which can severely reduce quality compared to quantizing from 16bit or 32bit, leave-output-tensor, pure, and imatrix. If the model supports multimodal inputs, you also need to convert and quantize the multimodal encoders and projectors.

GGUF on the Hub

Hugging Face Hub has built-in features for GGUF format, a then binary format that is optimized for quick loading and saving of models. GGUF encodes both the tensors and a standardized set of metadata. You can use the ggml-org/gguf-my-repo tool to convert or quantize your model weights into GGUF weights. You can also use that Space to build your own quants without any setup.

| llama-quantize | GGUF | |---|---| | llama-quantize | Writes a quantized GGUF file | | Q4_K_M | Example quantization method | | imatrix | Suitable file that can minimize accuracy loss | | allow-requantize | Can severely reduce quality | | gguf-my-repo | Convert or quantize weights into GGUF weights |

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: ggml-org/llama.cpp (GitHub), quantize; Hugging Face Hub docs, GGUF. MIT; Apache-2.0. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: ggml-org/llama.cpp (GitHub), quantize; Hugging Face Hub docs, GGUF. MIT; Apache-2.0.

Cite this

Permanent ID: iil:note:wxm49k9s

iinventedlight. 2026. "Quantize a GGUF model with llama-quantize." iinventedlight Library, iil:note:wxm49k9s, version of 2026-11-19. https://iinventedlight.com/library/notes/llamacpp-quantize/. License: CC-BY-4.0.

@misc{iil_note_wxm49k9s,
  author = {{iinventedlight}},
  title = {{Quantize a GGUF model with llama-quantize}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-19},
  url = {https://iinventedlight.com/library/notes/llamacpp-quantize/},
  note = {Permanent ID iil:note:wxm49k9s. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/llamacpp-quantize.md.