Model compression, also called quantization, stores model weights using fewer bits. It can make a model's download and memory requirement smaller. The llama.cpp project says its quantization is for "faster inference and reduced memory use." Answer quality may change. For a text model, Q4_K_M is the GGUF to try first; choose a higher-precision download when it fits and improves the work you actually do.
This guide suits someone facing several download files for the same model.
What Q4, Q5 and Q8 mean
The number suggests the approximate precision used for stored weights, but modern formats can mix precisions across different parts of the model. Keep the full label, such as Q4_K_M or Q8_0, rather than shortening every file to “Q4” or “Q8.”
| Download choice | Practical reason to investigate it | What to check |
|---|---|---|
| Q4-class GGUF | Smaller weight file when memory is limited | Exact file size and whether errors increase on your task |
| Q5-class GGUF | Another balance between precision and size | Whether it improves your answer enough to justify the extra memory |
| Q8-class GGUF | More precise stored weights than lower-bit alternatives | Weight size, context, and remaining memory |
| MLX quantized download | A supported path for an app using MLX | Bit setting, group configuration, model support, and companion files |
Formats you will see in file names
- Q4_K and Q5_K (K-type GGUF). Hugging Face describes Q4_K as 4-bit storage at 4.5 bits per weight, and Q5_K as 5-bit storage at 5.5 bits per weight. Files are often named with an extra letter, such as Q4_K_M. The Hugging Face table lists only the base type, so read the publisher's page for what a suffix means. Q5 files are larger than Q4 files for the same model. They keep more precision.
- Q8_0. Hugging Face describes it as 8-bit round-to-nearest quantization. It is the most precise of these three and the largest.
- MLX 4-bit. The MLX-LM README shows a conversion command,
mlx_lm.convert, with the-qoption, and says it produces a 4-bit quantized model. That README gives no figure for speed or quality.
These are representation choices. GGUF and MLX downloads are not interchangeable just because both say four-bit. See GGUF vs MLX before choosing a format for the app.
File size is only the start
8 billion weights at exactly four bits each would occupy 4 billion bytes, or 4 GB. Real files can be larger because of metadata, mixed precision, scales, and other tensors. This excludes the memory needed to run it.
Model weights versus runtime memory
A package can mix precisions: Qwen3.5 4B Ollama Q4_K_M includes a BF16 image projector. Account for both when required. GPT-OSS uses MXFP4, not interchangeable with Q4_K_M. Compare exact files, runner and total fit, including full expert weights rather than active parameters. The original Qwen3 three-file comparison below isolates compression within one checkpoint.
Model weights are only one part of what a running model needs. Running also takes conversation memory (KV cache), memory used by the model runner, and temporary calculation memory. A larger context length needs more memory; Ollama's documentation says so directly. The operating system and your other apps need space too.
The llama.cpp project describes quantization as aimed at faster inference as well as lower memory use, and the MLX-LM README warns that a model large relative to your total RAM can be slow. Time your own model file on your own computer.
A mixture-of-experts model still loads the required total weights even when fewer parameters are active for an individual token. Use the exact file in the memory calculator, including the intended context.
Qwen3 8B; 4,096 context tokens; 1 concurrent user; LM Studio.
16 GiB Mac
Available: 12.0 GiB
- Q8: 10.2 GiB, Fits
- Q6: 8.4 GiB, Fits
- Q5: 7.5 GiB, Fits
- Q4: 6.8 GiB, Fits
From this site's RAM and VRAM calculator.
Choose a download in five steps
- Find the exact model and checkpoint. Do not compare different generations under a shared family name.
- Confirm the app supports its architecture and format.
- Select a quantized file from the publisher or a clearly identified conversion repository.
- Check file size and memory at your intended context, leaving room for the desktop and other apps.
- Load one file and test your task before downloading several more.
For example, the official Qwen3 4B GGUF repository contains different compressed downloads. In LM Studio, inspect the exact filename and repository. An Ollama tag is a packaged download with its own file choices; inspect its library details rather than assuming it equals a particular Hugging Face file.
Split downloads require all the parts the model runner expects. A vision model may need a separate projector or other companion file.
Q4 vs Q5 vs Q8: the same model in three files
Qwen’s official Qwen3 4B GGUF repository publishes all three variants of one checkpoint. Only the file changes in the table below. The memory figures are the calculator’s figures for LM Studio on a Windows PC with 16 GB of RAM and no dedicated graphics card, at 4,096 tokens, with the standard conversation-memory setting, one user and a 20% safety margin.
| File | Size (bytes) | Weights in memory | Total estimate of 12.00 GiB available | Calculator |
|---|---|---|---|---|
Qwen3-4B-Q4_K_M.gguf | 2,497,280,256 | 2.33 GiB | 4.37 GiB, leaving 7.63 GiB | Open |
Qwen3-4B-Q5_K_M.gguf | 2,889,513,184 | 2.69 GiB | 4.74 GiB, leaving 7.26 GiB | Open |
Qwen3-4B-Q8_0.gguf | 4,280,404,704 | 3.99 GiB | 6.05 GiB, leaving 5.95 GiB | Open |
Moving from Q4_K_M to Q8_0 adds about 1.7 GiB of weights. Conversation memory stays the same, because it depends on the context and the cache setting, not the weight file. All three fit on this computer. To check your own, change the RAM, graphics and context in the calculator. On a computer with 8 GB of RAM, the same calculator finds that Q4_K_M fits (1.13 GiB left), Q5_K_M is Close (0.76 GiB left) and Q8_0 does not fit (short by 0.55 GiB) at these settings in LM Studio.
Pick a first file: start with Q4_K_M. Move up only if a test on your own work shows fewer mistakes and the larger file still leaves room for the context you need.
Compare precision without changing everything else
Download two or three of the files above and run the same test on each. Keep the app, context length and cache setting the same, and start a new chat for every run. Use these two invoices:
Invoice A. Invoice number: 1047. Supplier: North Ridge Paper. Amount due: 1,284.50. Due date: 14 March.
Invoice B. Invoice number: 1048. Supplier: North Ridge Paper. Amount due: 312.00. Payment terms: due on receipt of goods.
Send each invoice with this prompt:
Using only the invoice above, give the invoice number, the amount due and the due date. Write "not stated" for any value the invoice does not give.
| Invoice | Correct answer | Count as a mistake |
|---|---|---|
| A | 1047, 1,284.50, 14 March | Any changed digit or date |
| B | 1048, 312.00, due date not stated | Any invented calendar date, or treating "due on receipt" as a date |
Record the file, any mistakes, and whether the answer kept to the three fields. Compare speed only if you time every file on the same computer, with the same app, context and other programs. Reload the model between files, because the first run after loading can be slower.
If the higher-precision file improves the answers, keep it when resources permit. More precision cannot repair missing source text, a wrong chat template, or a model that lacks the required capability. For the memory budget across hardware, see RAM and VRAM requirements and the 32 GB setup guide.
Keep conversation compression separate
Some model runners also support compressed conversation memory (KV cache), called KV-cache quantization. This reduces a different part of the memory requirement, especially for long context, but has its own quality tradeoffs and conditions. Ollama's FAQ says its default cache type is f16, that q8_0 uses approximately half the memory of f16 with very small precision loss, and that q4_0 uses approximately a quarter with small-to-medium precision loss, more noticeable at larger context sizes. It says these cache types reduce memory when Flash Attention is enabled.
Do not change weight compression and cache precision at the same time while diagnosing a regression. Return to a baseline, change one setting, and check the answer. See context windows for that memory distinction.
