Short answer: pick Q4_K_M by default, Q5_K_M or Q6_K if you have spare memory, and Q8_0 if you want near original quality. GGUF quantization is how most people shrink an open weight model so it fits on a laptop or a single GPU. GGUF itself is a file format used by llama.cpp and the tools built on it; the quantization type in the filename, such as Q4_K_M or Q8_0, tells you how many bits each weight was compressed to. The official llama.cpp tables measure Q4_K_M at about 4.89 bits per weight, so a Llama 3.1 8B file lands near 4.6 GiB, and Q8_0 is close to the original quality at roughly half the size of 16 bit weights. Quantization is not the only way to get a smaller model; LLM distillation vs quantization explains the other route, and how much VRAM you need shows how the file size turns into GPU memory once you add context.

This guide decodes the names, shows real size numbers from the official llama.cpp documentation, and gives you a simple rule for picking a file.

What GGUF is (and is not)

GGUF is a binary file format from the ggml project. According to the GGUF specification, it is designed for single file deployment, fast loading through memory mapping, and "full information": the architecture, tokenizer and other metadata live inside the file as key value pairs, so you do not need extra config files. It replaced the older GGML, GGMF and GGJT formats. The format is not the same thing as the ggml tensor library that reads it; our what is ggml explainer covers the library and its v1.0.0 release.

GGUF is not a quantization method. A GGUF file can hold full 16 bit weights, 8 bit weights, or anything down to roughly 2 bits per weight. The quantization type is a separate choice, and it is usually written at the end of the filename.

GGUF files run in llama.cpp and everything built on it, including Ollama and LM Studio. If you have not chosen a runner yet, our comparison of Ollama vs llama.cpp vs LM Studio will help, and our guide on how to use llama.cpp shows how to pull a specific quant straight from Hugging Face.

GGUF vs safetensors

Safetensors is the format you usually see in a model's original repository on the Hugging Face Hub. It stores tensors safely and is what Transformers, vLLM and most training tools load; our vLLM vs llama.cpp guide covers that serving side. It typically holds full precision weights and relies on separate JSON files for the config and tokenizer.

ItemGGUFSafetensors
Main usersllama.cpp, Ollama, LM StudioTransformers, vLLM, SGLang, training libraries
Typical contentsQuantized weights plus all metadata in one fileWeights only, with config and tokenizer files alongside
Typical useLocal inference on CPUs, Macs and consumer GPUsTraining, fine tuning and GPU server inference
QuantizationBuilt in types from about 1.5 to 8 bitsUsually 16 bit; quantized variants use other schemes

Practical rule: train and fine tune from safetensors, then convert to GGUF for local use. For how the safetensors format itself works and why it replaced pickle checkpoints, see what is safetensors.

How to read a GGUF quant name

Take Q4_K_M apart piece by piece.

  • Q4 means about 4 bits per weight on average.
  • K means a "k-quant", the block based scheme introduced in llama.cpp in 2023 that mixes precisions inside the model.
  • M means medium. K-quants come in S (small), M (medium) and L (large) variants that keep more or fewer of the sensitive tensors at higher precision. Larger means slightly bigger files and slightly better quality.

Other names you will see:

  • Q8_0, Q4_0, Q5_1 are older, simpler "legacy" quants. Q8_0 is still popular because it is nearly lossless.
  • IQ2_M, IQ3_XXS, IQ4_XS are "i-quants", designed for very low bit rates. They usually rely on an importance matrix.
  • imatrix is an importance matrix: statistics gathered by running sample text through the model, used to decide which weights deserve more precision. The quantize README says a suitable imatrix file can reduce the accuracy loss from quantization.
  • F16 and BF16 are unquantized 16 bit weights.
  • TQ1_0 and TQ2_0 are ternary types (about 1.69 and 2.06 bits per weight) for models trained with three weight values.
  • MXFP4_MOE keeps the experts of a mixture of experts model in the 4 bit MXFP4 format; it is how gpt-oss runs locally from its native weights.
  • Q1_0 and Q2_0 are simple low bit types that llama-quantize lists at about 1.125 and 2.25 bits per weight.

Some uploaders add their own labels, such as Unsloth's "UD" (dynamic) quants. Those are variations on the same idea; read the model card for details.

GGUF quantization comparison: size and quality by type

The llama.cpp quantize README publishes bits per weight and file sizes for Llama 3.1 8B, and the llama-quantize tool itself lists the perplexity increase each type caused on Llama 3 8B (lower is better; zero would mean no measurable loss). Rounded, as of November 12, 2026:

Quant typeBits per weightFile size (GiB)Perplexity increase
F1616.014.96none (baseline)
Q8_08.57.95+0.003
Q6_K6.566.14+0.022
Q5_K_M5.705.33+0.057
Q4_K_M4.894.58+0.175
Q4_K_S4.674.36+0.269
IQ4_XS4.464.17not listed
Q3_K_M4.003.74+0.657
IQ3_M3.763.52not listed
Q2_K3.162.95+3.520
IQ2_M2.932.74not listed

In words: Q8_0 is a little over half the size of 16 bit weights with almost no measurable loss, Q4_K_M is a little under a third with a small loss, and quality falls off quickly below Q3_K_M. Notice that "Q4" is really closer to 4.9 bits, because some tensors are kept at higher precision. The perplexity figures come from the tool's own type list in quantize.cpp, measured on Llama 3 8B without an imatrix, so treat them as a ranking, not a promise for your model.

The same README gives whole model examples. Llama 3.1 8B goes from 32.1 GB in its original form to 4.9 GB at Q4_K_M, and Llama 3.1 70B goes from 280.9 GB to 43.1 GB. Those originals are 32 bit, which is why the reduction looks so dramatic.

GGUF quantization: quality vs size

Quantization trades accuracy for memory. The llama.cpp docs measure the loss with perplexity and KL divergence against the original model; lower bits mean more drift. Generation speed also usually rises as files shrink, because producing each token is limited mainly by how fast weights stream from memory: in the README's own Llama 3.1 8B run, F16 generated about 29 tokens per second, Q8_0 about 51 and Q4_K_M about 72.

A practical decision guide:

  1. Q8_0 if it fits comfortably. Quality is very close to 16 bit.
  2. Q6_K or Q5_K_M when you have some headroom. A good middle ground.
  3. Q4_K_M as the default for most laptops and single GPUs. This is the type the llama.cpp docs use in their own example.
  4. IQ4_XS or Q3_K_M when you are just short of memory.
  5. IQ2 and Q2 types only to squeeze a very large model onto limited hardware, and expect visible quality loss, especially on smaller models.

Some models go below these types entirely. Ternary releases such as Bonsai 2 27B ship custom GGUF types that stock llama.cpp cannot load; our guide to running Bonsai 2 27B locally covers the special build they need. The llama-modchip project does something similar for DeepSeek V4 Flash, averaging 1.71 bits per weight with its own tensor type. Others keep the standard types but choose better codes inside them: MACaQ quantization from Huawei refines an existing Q4_K file while keeping it loadable in stock llama.cpp.

A useful rule of thumb from the community, worth testing for yourself: a bigger model at 4 bits often beats a smaller model at 8 bits for the same memory. Always leave room for the context window, which needs its own memory. Our VRAM guide shows how to add it up, and KV cache quantization shrinks that part separately from the weights.

How to get a GGUF

Download a ready made quant

Most popular models have GGUF repos on Hugging Face, from the model makers, from the ggml-org account, or from community quantizers. Each repo usually contains one file per quant type. You can run them directly:

# llama.cpp: download and run a specific quant
llama cli -hf ggml-org/gpt-oss-20b-GGUF

# Ollama: run any GGUF repo from Hugging Face, optionally picking a quant
ollama run hf.co/{username}/{repository}:Q4_K_M

The Ollama syntax comes from the Hugging Face Hub docs. LM Studio shows the available quant types in its download panel.

Make your own

The official route is two steps: convert the original model to a 16 bit GGUF, then quantize it.

python convert_hf_to_gguf.py --outfile model-bf16.gguf --outtype bf16 --remote google/gemma-4-E2B-it
./build/bin/llama-quantize model-bf16.gguf model-Q4_K_M.gguf Q4_K_M

Quantize from 16 bit or 32 bit weights, not from another quant; the README warns that requantizing can severely reduce quality. Multimodal models also need a separate "mmproj" file for the vision or audio encoder, which is usually kept at Q8_0 or 16 bit. A GGUF only runs if your llama.cpp build knows the model's architecture; for example, Unlimited OCR 2 GGUF files need a patched build because mainline llama.cpp cannot load them yet. If you prefer not to install anything, the GGUF-my-repo Space builds quants in the browser; the README says it syncs from llama.cpp's main branch every 6 hours. Fine tuning tools such as Unsloth can also export straight to GGUF.

Pros and cons of GGUF

  • Pros: one self contained file; runs on CPUs, Apple Silicon and most GPUs; wide choice of sizes; memory mapped loading; supported by the most popular local tools.
  • Cons: mainly an inference format, not for training; quality drops at very low bit rates; new architectures need llama.cpp support before GGUFs work; on Apple Silicon, MLX-format models are a strong alternative, compared in our MLX vs GGUF guide.

Who this is for

Anyone running models locally: hobbyists choosing a download, developers sizing a deployment, and researchers comparing quantization effects. If you want step by step conversion commands rather than just picking a download, see how to quantize LLM models. For a worked example of picking a quant for a current 27B model, see how to run Qwen 3.8 locally. If you plan to fine tune, start from the original safetensors weights of a model such as Llama, and only convert to GGUF at the end.

FAQ

What does GGUF quantization mean?

GGUF is a single file model format from the ggml project, successor to the older GGML, GGMF and GGJT formats; the specification does not spell it out as an acronym. Quantization is the compression applied to the weights inside it, shown by the suffix such as Q4_K_M or Q8_0.

Which GGUF quantization is best?

For most people, Q4_K_M: it is a little under a third of the 16 bit size and adds only about 0.18 perplexity on Llama 3 8B. Use Q5_K_M, Q6_K or Q8_0 if they fit with room for context, and IQ4_XS or Q3_K_M only when you are short of memory.

Is Q4_K_M or Q5_K_M better?

Q5_K_M keeps more precision (about +0.06 perplexity versus +0.18 for Q4_K_M in llama.cpp's list), but the file is about 16 percent larger for an 8B model (5.33 versus 4.58 GiB). Choose Q5_K_M if it fits with room for your context window; otherwise Q4_K_M is the standard choice.

What is the difference between GGUF and safetensors?

Safetensors stores model tensors, usually at full precision, and is the standard for training and GPU serving with Transformers or vLLM. GGUF bundles quantized weights and all metadata in a single file for llama.cpp based local inference. Fine tune from safetensors, then convert to GGUF at the end.

Should I use GGUF or MLX on a Mac?

Both run well on Apple Silicon. GGUF works in llama.cpp, Ollama and LM Studio on every platform, while MLX models run through Apple's MLX stack and are often faster on Macs. Our MLX vs GGUF guide compares them.

Does quantization make a model faster?

Usually yes for generation, because smaller weights move through memory faster. In llama.cpp's own Llama 3.1 8B run, Q4_K_M generated about 72 tokens per second against 29 for F16. The exact effect depends on your hardware and backend, so compare speeds on your own machine.