GGUF Quant Names Explained (2026): Q, K, M, IQ, UD
A GGUF filename is a short code. Each part tells you the storage format of most of the weights. This page decodes each part, gives the bits per weight from the llama.cpp source, and shows you how to read the real contents of a file. The label on a file is a name for a recipe. Two uploaders can use the same label for two different files.
The Decoder Table
Read a filename from left to right. For example, Qwen3.6-27B-UD-Q4_K_XL.gguf is: model name, then UD, then Q4, then K, then XL.
| Part of the name | Meaning | Bits per weight (llama.cpp source) |
|---|---|---|
Q + number (Q4, Q5, Q8) | The approximate bit count of most weights | See the rows below |
Q4_0, Q5_0, Q8_0 | Legacy formats. One scale for each block of 32 weights | Q4_0 = 4.5, Q8_0 = 8.5 (block size / 32) |
Q4_1, Q5_1 | Legacy formats with a scale and a minimum for each block | Q4_1 = 5.0 |
_K (Q4_K, Q6_K) | K-quants, PR #1684 (June 2023). Super-blocks of 256 weights | Q2_K 2.625, Q3_K 3.4375, Q4_K 4.5, Q5_K 5.5, Q6_K 6.5625 |
_S, _M, _L after _K | The recipe tier: small, medium, large. Larger tiers keep more tensors at a higher type | Not one number. It is a mix |
IQ prefix (IQ2_XXS, IQ3_S, IQ4_XS) | I-quants. Non-linear and lattice-based types, first added in PR #4773 (January 2024) | IQ1_S 1.56, IQ1_M 1.75, IQ2_XXS 2.06, IQ2_XS 2.31, IQ2_S 2.5, IQ3_XXS 3.06, IQ3_S 3.44, IQ4_XS 4.25 |
NL (IQ4_NL) | Non-linear 4-bit, blocks of 32 (PR #5590) | 4.5 |
XXS, XS, S, M after IQ | Size tiers inside the i-quant family, smallest to largest | See the IQ row |
imatrix (in a repo name or a separate file) | An importance matrix, PR #4861. It tells the quantizer which weights to protect. It is not a type | None |
UD- | Unsloth Dynamic. Unsloth sets the type per layer. It is an uploader label, not a llama.cpp type | Not one number |
_XL (Q4_K_XL, Q2_K_XL) | An Unsloth tier above _L. llama.cpp has no _XL recipe | Not one number |
Q8_0 | 8-bit legacy format. Near the full model in size and output | 8.5 |
F16, BF16 | 16-bit floats. The full-precision source for other quants | 16 |
MXFP4 (MXFP4_MOE in the quantize tool) | 4-bit float, one shared scale per 32 weights. Added with gpt-oss (PR #15091, August 2025) | 4.25 (17 bytes / 32 weights) |
NVFP4 | 4-bit float, one E4M3 scale per 16 weights. PR #19769 (March 2026) | 4.5 (36 bytes / 64 weights) |
TQ1_0, TQ2_0 | Ternary types, for models trained with weights of -1, 0, +1 | 1.69 and 2.06 |
Q1_0, Q2_0 | New mainline low-bit types in the 2026 source | 1.125 and 2.25 |
GSQ-RCO | IST DASLab’s quantization method (two arXiv papers). The files still use mainline types such as IQ3_S | Set by the mainline type after it |
PQ2_0, PTQ1_0 | Types from the PrismML llama.cpp fork. They are not in mainline ggml.h | Not in mainline source |
Two rules make the table work.
- The name tells you the main type. It does not tell you every type. A
Q4_K_Mfile holds many tensors at Q6_K and Q5_K, and the small 1-D tensors stay at F32. - Only the llama.cpp types have a fixed bits-per-weight value.
UD,_XL,GSQ-RCOand similar labels are recipes. Their size changes from model to model.
How the Parts Fit Together
The Q number
The number after Q is the bit count of the base type. It is not the average for the file. A Q4_K_M file has an average above 4.5 bits per weight, because the recipe keeps some tensors at 6 bits.
Legacy, K and I: three generations
- Legacy (
Q4_0,Q8_0): one scale for each block of 32 weights. They are simple and fast.Q8_0is still the normal 8-bit choice. - K-quants (
_K): blocks of 32 inside super-blocks of 256. The scales are also quantized. This gives better quality at the same size. - I-quants (
IQ): the weights map to a non-linear grid. This gives better quality at 2 and 3 bits. At 4 bits,IQ4_XSis the smallest useful option.
The tier letter
After _K, the tier letter is a recipe, not a type. The quantizer applies the base type to most tensors. Then it applies a higher type to some sensitive tensors, such as parts of the attention and feed-forward layers. _S promotes fewer tensors. _L promotes more.
The llama.cpp quantize help table gives the size effect on Llama-3-8B: Q4_K_S 4.37G, Q4_K_M 4.58G. Q3_K_S 3.41G, Q3_K_M 3.74G, Q3_K_L 4.03G.
IQ and imatrix are two different things
Many people read IQ as “imatrix quant”. That is not correct. IQ names a storage type. The imatrix is calibration data that the quantizer uses to pick the weights to protect. Uploaders use an imatrix for most IQ files, because low-bit i-quants lose too much quality without one. Uploaders also use an imatrix for K-quants. A file named Q4_K_M can be an imatrix quant.
UD and _XL
Unsloth Dynamic files have a UD- prefix. Unsloth’s docs say it now changes “the quantization type of every possible layer” and uses its own imatrix calibration set [source: Unsloth Dynamic 2.0 GGUFs docs]. For the pick between UD-Q4_K_XL, Q4_K_M and IQ4_XS on a given card, see IQ4_XS vs Q4_K_M vs Q4_K_XL. This page does not repeat that pick.
MXFP4 and NVFP4
These are float formats with 4-bit values and a shared scale. They are not k-quants. gpt-oss ships with MXFP4 weights, so every gpt-oss GGUF is close to the same size. The details are in MXFP4 vs Q4_K_M and NVFP4 vs MXFP4.
The Same Label Is Not the Same File
We read the file sizes from the Hugging Face API and the tensor types from the GGUF headers on 2026-09-20.
| Model | Uploader | File | Size | Tensor types (count) |
|---|---|---|---|---|
| Qwen3.6-27B | unsloth | Q4_K_M | 16.82 GB | Q4_K 289, Q6_K 65, Q5_K 48 |
| Qwen3.6-27B | bartowski | Q4_K_M | 17.98 GB | Q4_K 249, Q6_K 97, Q8_0 32, Q5_K 32 |
| Qwen3.6-27B | unsloth | UD-Q4_K_XL | 17.61 GB | Q4_K 207, Q5_K 70, Q6_K 65, Q8_0 48, IQ4_XS 12 |
| Qwen3.8-27B | unsloth | UD-Q4_K_M | 16.46 GB | Q5_K 131, IQ4_XS 117, Q8_0 106, Q4_K 104, and 4 more types |
| Qwen3.8-27B | bartowski | Q4_K_M | 17.44 GB | Q4_K 257, Q6_K 79, Q8_0 64, Q4_0 8, Q5_K 2 |
| Qwen3.8-27B | bartowski | IQ4_NL | 17.44 GB | IQ4_NL 257, Q6_K 79, Q8_0 64, Q4_0 8, Q5_K 2 |
| Qwen3.8-27B | byteshape | IQ4_XS-3.84bpw | 13.08 GB | IQ3_S 123, IQ4_XS 94, Q4_K 88, IQ3_XXS 84, and 8 more types |
F32 tensors are not in the counts. Sizes are bytes divided by 10^9.
What this shows:
- The two Q4_K_M files of Qwen3.6-27B differ by 1.17 GB. bartowski keeps 32 tensors at Q8_0. unsloth keeps none at Q8_0.
- The header does not tell the full story. The unsloth Qwen3.6-27B Q4_K_M and UD-Q4_K_XL files both carry
file_type = 15. Inllama.h, 15 isLLAMA_FTYPE_MOSTLY_Q4_K_M. The label_XLexists only in the filename. - A 2026 Unsloth “Q4_K_M” has more IQ4_XS tensors than Q4_K tensors. The label names the family, not the content.
- IQ4_NL and Q4_K_M can be the same size to the byte. Both base types are 4.5 bits per weight. bartowski uses one recipe and changes only the base type.
- A label can name a type that is not the main type. The byteshape “IQ4_XS” file has more IQ3_S tensors than IQ4_XS tensors. The uploader put the real average, 3.84 bpw, in the filename.
The file size decides the fit. A 1 GB difference is the difference between a model that fits a 16 GB or 24 GB card with context, and a model that spills. If you are near a VRAM limit, see the cards this matters for before you download.
Method: Read the Real Size and Tensor Mix Yourself
Do not trust the label. Read the file. Each step below takes less than a minute. The numbers for your model will be different from the numbers above.
1. Get the exact file sizes
Use the Hugging Face API with ?blobs=true. Without that parameter, the API does not return sizes.
curl -s "https://huggingface.co/api/models/unsloth/Qwen3.6-27B-GGUF?blobs=true" \
| python3 -c "import json,sys
for s in json.load(sys.stdin)['siblings']:
if s['rfilename'].endswith('.gguf'):
print(s['rfilename'], round(s['size']/1e9, 2), 'GB')"
Do this for two uploaders of the same model. Compare the same label.
2. See the tensor types in the browser
On a Hugging Face model page, click a .gguf file. The GGUF viewer shows the metadata and a list of tensors with the type of each tensor. Look at token_embd, output.weight, attn_v and ffn_down. Uploaders change these tensors most often.
3. Dump the header locally
The gguf Python package from llama.cpp includes gguf-dump.
pip install gguf gguf-dump ./Qwen3.6-27B-Q4_K_M.gguf | less
The output shows general.file_type and each tensor with its type. Count the types. That count is the real recipe.
4. Get the true bits per weight
Divide the file size in bits by the parameter count.
bits per weight = file size in bytes x 8 / number of parameters
This value includes the embeddings and the higher-type tensors. It is the value that decides VRAM use. Then add memory for the KV cache. The llama.cpp MoE offload flags page shows how to fit a file that is too large for the card.
Common Mistakes
- Comparing labels across uploaders. Compare sizes. The same label from two uploaders can differ by more than 1 GB.
- Reading
IQas “imatrix”.IQis a storage type. Any type can use an imatrix. - Treating the Q number as the average. Q4_K_M is more than 4.5 bits per weight on average.
- Looking for
_XLin llama.cpp. It is not there. It is an Unsloth tier. - Assuming a third-party type runs everywhere.
PQ2_0andPTQ1_0need the PrismML fork. Mainline llama.cpp does not load them.
See Also
- IQ4_XS vs Q4_K_M vs Q4_K_XL — which 4-bit file to pick for your VRAM
- Quantization in Plain English — what quantization does, before you read the names
- MXFP4 vs Q4_K_M — the float format on gpt-oss
- NVFP4 vs MXFP4 — the two 4-bit float formats and the hardware for each
- —n-cpu-moe Explained: llama.cpp MoE Offload Flags — run a file that is larger than your VRAM
- llama.cpp Flags Explained — the other flags that change memory use
Sources
- llama.cpp
tools/quantize/quantize.cpp— quantize help table: IQ bpw values, TQ1_0 1.69, TQ2_0 2.06, Q1_0 1.125, Q2_0 2.25, Llama-3-8B sizes for K-quant tiers, MXFP4_MOE; read 2026-09-20 - llama.cpp
ggml/include/ggml.h— the full type list, including MXFP4 (39) and NVFP4 (40); read 2026-09-20 - llama.cpp
ggml/src/ggml-common.h— block layouts and “effectively N bits per weight” comments for K-quants; MXFP4 and NVFP4 bpw are arithmetic from the block sizes; read 2026-09-20 - llama.cpp
include/llama.h— file_type 15 = MOSTLY_Q4_K_M; read 2026-09-20 - llama.cpp PRs: #1684 k-quants, #4773 SOTA 2-bit quants, #4861 importance matrix, #5590 IQ4_NL, #5747 IQ4_XS, #15091 gpt-oss / MXFP4, #19769 NVFP4
- Unsloth Dynamic 2.0 GGUFs docs — per-layer type selection and imatrix calibration; read 2026-09-20
- Hugging Face API (
?blobs=true) and GGUF headers for unsloth/Qwen3.6-27B-GGUF, bartowski/Qwen_Qwen3.6-27B-GGUF, unsloth/Qwen3.8-27B-GGUF, bartowski/Qwen3.8-27B-GGUF, byteshape/Qwen3.8-27B-GGUF; read 2026-09-20 - Model cards: ISTA-DASLab/Qwen3.8-27B-GSQ-RCO-GGUF and davetha/Ternary-Bonsai-2-27B-Abliterated-PQ2_0-GGUF (PQ2_0 and PTQ1_0 are PrismML fork types, community-reported); read 2026-09-20
Need OpenClaw fixed live?
Remote rescue sessions for gateway, auth, tunnel, VPS, and model access problems.
See Rescue Session