Guide · updated 2026-11-18
Which quantization should you download for a local LLM? Q4_K_M, Q8_0 and when each fits
What Q4_K_M, Q8_0, K, S and M mean in a model file name, what each costs in memory and accuracy, and which version to download for your machine and task.
Download Q4_K_M unless you have memory to spare and a task that punishes small errors. Q4_K_M is the compressed version most runners hand you by default, and it is a little over half the size of Q8_0 for the same model. Q8_0 is close to the original but costs much more memory and runs slower. The rule that follows from the measurements below is simple: pick the largest model that fits at Q4_K_M, and move up to Q5_K_M, Q6_K or Q8_0 only when the model already fits with room left over and you use it for code or maths.
What do the letters and numbers in a model file name mean?
A model file in the GGUF format, the format most local runners load, follows a naming pattern set out in the GGUF specification from the ggml project: base name, size, fine tune, version, then the encoding. Read a file name of that kind from left to right.
The suffix decoder
Take Llama-3.1-8B-Instruct-Q4_K_M.gguf as the example.
| Part | What it says | What it means for you |
|---|---|---|
| Llama-3.1 | The model family and version | Two files with different family names are different models, not different sizes of one |
| 8B | About 8 billion parameters | The main driver of quality and of memory. Bigger is smarter and heavier |
| Instruct | Tuned to follow instructions and chat | Pick Instruct or Chat for a chat app. A base or text model only continues text |
| Q4 | About 4 bits per weight | The compression level. Lower numbers mean smaller files and more loss |
| K | The k-quant method | Weights are compressed in small blocks, each with its own scale, so less detail is lost than with the older method |
| M | The medium mix | Some sensitive parts of the model get more bits than the rest. S keeps every part at the base level, L gives more parts extra bits |
| .gguf | The file format | Loads in llama.cpp and the apps built on it, such as LM Studio, Ollama and Jan |
Three suffixes come up often enough to know on sight:
- _0 and _1, as in Q8_0 or Q4_0, are the older round to nearest method. The Hugging Face GGUF documentation lists Q4_0 and Q8_0 as legacy types that store weights in blocks of 32 with one scale each (read 2026-11-18). Q8_0 is still common because at 8 bits the older method loses very little.
- _K_S, _K_M and _K_L are the k-quant mixes. In the pull request that added k-quants to llama.cpp, Q4_K_S uses the 4 bit type for every tensor, while Q4_K_M uses the 6 bit type for half of two sensitive tensor groups and the 4 bit type for the rest (read 2026-11-18). That is why M is slightly bigger than S and slightly better.
- IQ, as in IQ4_XS, marks the newer i-quants. The Hugging Face GGUF documentation describes them as built with an importance matrix, a calibration step that decides which weights matter most (read 2026-11-18). They squeeze a little more quality into a small file and can run slower on some hardware.
F16 and BF16 are not compressed at all. They are the full size original, and you rarely need them to run a model.
What do you lose by compressing a model?
You lose a small amount of accuracy in exchange for a much smaller file. The llama.cpp project measures the loss as perplexity, a score for how well a model predicts text where lower is better, and it uses it to judge quality loss against the uncompressed F16 version, according to the llama.cpp perplexity tool documentation (read 2026-11-18).
The k-quant pull request measured a 7B model this way (llama.cpp pull request 1684, read 2026-11-18):
| Version of the 7B model | Perplexity, lower is better | File size |
|---|---|---|
| F16, uncompressed | 5.9066 (pull request 1684) | 13.0 GB (pull request 1684) |
| Q6_K | 5.9110 (pull request 1684) | 5.15 GB (pull request 1684) |
| Q4_K_S | 6.0215 (pull request 1684) | 3.56 GB (pull request 1684) |
| Q3_K_M | 6.1503 (pull request 1684) | 3.06 GB (pull request 1684) |
| Q2_K | 6.7764 (pull request 1684) | 2.67 GB (pull request 1684) |
The loss is small at 6 bits, still small at 4 bits, and grows quickly below that. The same pull request states that 6 bit perplexity is within 0.1% of the original (llama.cpp pull request 1684). Where you feel the loss first is in work with exact answers: code that has to compile, arithmetic, and long chains of reasoning. Casual chat and summaries rarely show it.
When is the common default good enough?
For most people, most of the time. Q4_K_M is the version Ollama gives you for Llama 3.1 when you pull it without naming a version. On the Ollama tag list for Llama 3.1, the plain llama3.1:8b tag is 4.9 GB and carries the same image id as the 8b-instruct-q4_K_M tag, while the Q8_0 tag is 8.5 GB and the FP16 tag is 16 GB (Ollama tag list, read 2026-11-18).
Stay on Q4_K_M when any of these is true:
- The model only just fits in your graphics memory or your Mac's unified memory.
- You want long conversations or long documents, which need extra memory on top of the model file.
- You use the model for chat, drafting, summaries or questions about your own notes.
- You want the fastest replies your hardware can give.
When is the higher precision worth the memory?
When the model already fits with room left over and your work punishes small mistakes. Code generation, maths, structured output such as JSON, and tasks where you compare exact figures are the cases where a Q6_K or Q8_0 file can be worth its size.
The llama.cpp quantize documentation lists the cost for Llama 3.1 8B (read 2026-11-18):
| Version of Llama 3.1 8B | Bits per weight | File size | Text generation speed |
|---|---|---|---|
| Q4_K_S | 4.67 (llama.cpp quantize README) | 4.36 GiB (llama.cpp quantize README) | 76.71 tokens per second (llama.cpp quantize README) |
| Q4_K_M | 4.89 (llama.cpp quantize README) | 4.58 GiB (llama.cpp quantize README) | 71.93 tokens per second (llama.cpp quantize README) |
| Q5_K_M | 5.70 (llama.cpp quantize README) | 5.33 GiB (llama.cpp quantize README) | 67.23 tokens per second (llama.cpp quantize README) |
| Q6_K | 6.56 (llama.cpp quantize README) | 6.14 GiB (llama.cpp quantize README) | 58.67 tokens per second (llama.cpp quantize README) |
| Q8_0 | 8.50 (llama.cpp quantize README) | 7.95 GiB (llama.cpp quantize README) | 50.93 tokens per second (llama.cpp quantize README) |
| F16 | 16.00 (llama.cpp quantize README) | 14.96 GiB (llama.cpp quantize README) | 29.17 tokens per second (llama.cpp quantize README) |
Moving from Q4_K_M to Q8_0 adds about 3.4 GiB for this model and generates text more slowly on the same machine (llama.cpp quantize README). Q6_K sits between the two and is the version to try first when you want more accuracy and Q8_0 is too heavy.
Is a bigger compressed model better than a smaller precise one?
Usually, yes. In the k-quant measurements, a 13B model compressed to Q4_K_S scored a perplexity of 5.3404 in a 6.80 GB file, while a 7B model left uncompressed at F16 scored 5.9066 in a 13.0 GB file (llama.cpp pull request 1684). The larger compressed model was both better and about half the size.
Two cautions keep the rule honest. First, perplexity scores are only comparable within one model family, because models with different tokenizers score on different scales (llama.cpp perplexity tool documentation). Compare sizes of the same family. Second, the rule weakens at 3 bits and below, where the loss climbs fast. Treat Q4_K_M as the floor for a larger model, not Q2_K.
Pick by situation
| Your situation | What to download |
|---|---|
| The model at Q4_K_M only just fits | Q4_K_M. If it does not fit at all, Q4_K_S or IQ4_XS of the same model, or a smaller model at Q4_K_M |
| A larger model of the same family fits at Q4_K_M | The larger model at Q4_K_M |
| It fits at Q4_K_M with a few GB spare, and you chat, draft or summarise | Q4_K_M, and spend the spare memory on a longer context |
| It fits at Q4_K_M with a few GB spare, and you write code or do maths | Q5_K_M or Q6_K |
| It fits at Q8_0 with room for your context, and accuracy matters more than speed | Q8_0 |
| You want the fastest replies on modest hardware | Q4_K_M or Q4_K_S |
| You are tempted by Q2 or Q3 to fit a big model | A smaller model at Q4_K_M instead, then compare both on your own work |
To check what fits, add the file size to the memory your conversation needs and leave a margin for the runner. How much VRAM you need to run an LLM locally walks through that sum.
How do you pick the file in a desktop app's download list?
Find the model, then read only the end of each file name. A desktop app shows one row per version, and the rows differ only in that suffix. The LM Studio documentation describes these options as copies of the same model provided in varying degrees of fidelity, and advises a 4 bit option or higher if your machine can run it (read 2026-11-18).
- Choose the model size first, the 8B or 14B part, using the memory sum above.
- In that size, look for the row ending Q4_K_M and check its file size against your free memory.
- If the app warns that a row is too large for your machine, believe it and go one step smaller.
- Move up to Q5_K_M, Q6_K or Q8_0 only if the situation table above says so.
- Prefer Instruct or Chat versions for a chat window.
In Ollama there is no list to read unless you open the tags page for a model. For Llama 3.1 the plain tag is the Q4_K_M version, and to get another version you add the full tag name. To pull the Q8_0 version of Llama 3.1 8B instead of the default, run:
ollama pull llama3.1:8b-instruct-q8_0
If you are still choosing a runner, Ollama vs LM Studio compares the two, and how to run an LLM locally on your laptop covers the first setup.
How do you check the quality yourself?
Run the same prompts through two versions and read the answers side by side. Use five to ten prompts from your real work, including at least one that has a single right answer, such as a function that must pass a test or a sum you can check. Use the same settings for both, and run each prompt more than once, because answers vary from run to run. If you cannot tell the versions apart on your own prompts, keep the smaller one.
For a number rather than a judgement, llama.cpp ships a perplexity tool. It scores a model over a text file, and with its KL divergence options it measures how far a compressed version's predictions drift from the uncompressed original, where 0 means no drift (llama.cpp perplexity tool documentation). That needs the full size original on disk once, so it suits people who already work at the command line.
Frequently asked questions
Is Q4_K_M good enough for coding?
For autocomplete and short functions, usually. For longer code that has to run first time, a Q5_K_M or Q6_K file of the same model makes fewer small errors, if it fits. A larger model at Q4_K_M often helps more than a higher precision version of a small one, so check the larger option before paying for extra bits.
Why are there so many versions of the same model?
Because memory differs from one machine to the next. Each version is the same model compressed by a different amount, so a laptop with 8 GB and a desktop with 24 GB can both run it. Most people need only one row of the list: the largest model that fits at Q4_K_M.
Does quantization make a model faster?
Yes, mostly when it writes text. For Llama 3.1 8B, text generation measured 29.17 tokens per second at F16, 50.93 at Q8_0 and 71.93 at Q4_K_M on the same machine (llama.cpp quantize README, read 2026-11-18). A smaller file means less data to move for every word, and moving data is usually the slow part. Reading your prompt changed far less between the versions in the same table.
What is the difference between the S, M and L versions?
How many parts of the model get extra bits. S uses one compression level for everything and is the smallest. M gives some sensitive parts more bits, and L gives more parts more bits again (llama.cpp pull request 1684). The size difference is small, about 0.2 GiB between Q4_K_S and Q4_K_M for Llama 3.1 8B (llama.cpp quantize README), so M is the usual pick and S is for when M does not quite fit.
Next step
The file you download matters less once you know which runner you want. The run LLMs locally use-case page ranks the runners on today's evidence, with one reason for and one against each, so you can choose one whose download list you understand. You can also read the pages for LM Studio, Ollama and llama.cpp, or the free shortlist for running LLMs locally.