← All guides

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 nameMeaningBits per weight (llama.cpp source)
Q + number (Q4, Q5, Q8)The approximate bit count of most weightsSee the rows below
Q4_0, Q5_0, Q8_0Legacy formats. One scale for each block of 32 weightsQ4_0 = 4.5, Q8_0 = 8.5 (block size / 32)
Q4_1, Q5_1Legacy formats with a scale and a minimum for each blockQ4_1 = 5.0
_K (Q4_K, Q6_K)K-quants, PR #1684 (June 2023). Super-blocks of 256 weightsQ2_K 2.625, Q3_K 3.4375, Q4_K 4.5, Q5_K 5.5, Q6_K 6.5625
_S, _M, _L after _KThe recipe tier: small, medium, large. Larger tiers keep more tensors at a higher typeNot 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 IQSize tiers inside the i-quant family, smallest to largestSee 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 typeNone
UD-Unsloth Dynamic. Unsloth sets the type per layer. It is an uploader label, not a llama.cpp typeNot one number
_XL (Q4_K_XL, Q2_K_XL)An Unsloth tier above _L. llama.cpp has no _XL recipeNot one number
Q8_08-bit legacy format. Near the full model in size and output8.5
F16, BF1616-bit floats. The full-precision source for other quants16
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)
NVFP44-bit float, one E4M3 scale per 16 weights. PR #19769 (March 2026)4.5 (36 bytes / 64 weights)
TQ1_0, TQ2_0Ternary types, for models trained with weights of -1, 0, +11.69 and 2.06
Q1_0, Q2_0New mainline low-bit types in the 2026 source1.125 and 2.25
GSQ-RCOIST DASLab’s quantization method (two arXiv papers). The files still use mainline types such as IQ3_SSet by the mainline type after it
PQ2_0, PTQ1_0Types from the PrismML llama.cpp fork. They are not in mainline ggml.hNot in mainline source

Two rules make the table work.

  1. The name tells you the main type. It does not tell you every type. A Q4_K_M file holds many tensors at Q6_K and Q5_K, and the small 1-D tensors stay at F32.
  2. Only the llama.cpp types have a fixed bits-per-weight value. UD, _XL, GSQ-RCO and 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_0 is 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_XS is 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.

ModelUploaderFileSizeTensor types (count)
Qwen3.6-27BunslothQ4_K_M16.82 GBQ4_K 289, Q6_K 65, Q5_K 48
Qwen3.6-27BbartowskiQ4_K_M17.98 GBQ4_K 249, Q6_K 97, Q8_0 32, Q5_K 32
Qwen3.6-27BunslothUD-Q4_K_XL17.61 GBQ4_K 207, Q5_K 70, Q6_K 65, Q8_0 48, IQ4_XS 12
Qwen3.8-27BunslothUD-Q4_K_M16.46 GBQ5_K 131, IQ4_XS 117, Q8_0 106, Q4_K 104, and 4 more types
Qwen3.8-27BbartowskiQ4_K_M17.44 GBQ4_K 257, Q6_K 79, Q8_0 64, Q4_0 8, Q5_K 2
Qwen3.8-27BbartowskiIQ4_NL17.44 GBIQ4_NL 257, Q6_K 79, Q8_0 64, Q4_0 8, Q5_K 2
Qwen3.8-27BbyteshapeIQ4_XS-3.84bpw13.08 GBIQ3_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. In llama.h, 15 is LLAMA_FTYPE_MOSTLY_Q4_K_M. The label _XL exists 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

  1. Comparing labels across uploaders. Compare sizes. The same label from two uploaders can differ by more than 1 GB.
  2. Reading IQ as “imatrix”. IQ is a storage type. Any type can use an imatrix.
  3. Treating the Q number as the average. Q4_K_M is more than 4.5 bits per weight on average.
  4. Looking for _XL in llama.cpp. It is not there. It is an Unsloth tier.
  5. Assuming a third-party type runs everywhere. PQ2_0 and PTQ1_0 need the PrismML fork. Mainline llama.cpp does not load them.

See Also

Sources

Need OpenClaw fixed live?

Remote rescue sessions for gateway, auth, tunnel, VPS, and model access problems.

See Rescue Session

Read next

Quantization in Plain English: What Q4, Q5, Q8 Actually Cost You (2026)
Q4_K_M is the default sweet spot. Q8 is near-indistinguishable from FP16 at half the size. Below Q4 quality drops fast. A bigger model at Q4 usually beats a smaller model at Q8 — here is the plain-English version, plus UD/IQ/NVFP4 and KV cache quant.
NVFP4 vs MXFP4 (2026): NVFP4 Is Finer, MXFP4 Runs on Mac
NVFP4 uses 16-weight blocks with an FP8 scale (4.5 bits per weight); MXFP4 uses 32-weight blocks with a power-of-two scale (4.25). Which one to download, which runtimes run each today, and why NVFP4 does not force a Blackwell upgrade in llama.cpp.
IQ4_XS vs Q4_K_M vs Q4_K_XL (2026): Pick by VRAM
Q4_K_XL has the lowest error of the three, IQ4_XS is the smallest. On Qwen3.6-27B the gap is 2.2GB, and that gap decides whether a 4-bit 27B fits a 16GB card at all. Sizes from Hugging Face, KL divergence from Unsloth's published benchmark.
Best Uncensored Local LLM (2026): Qwen 3.8 27B Wins
Two Qwen3.8-27B uncensored GGUF repos pulled 2.5M downloads in a month. Independent forensics scored one of them top of 12 variants at zero MMLU-Pro loss, and never tested the other. Real file sizes, the VRAM tier each quant needs, and the licence caveat.