Which quantization should you download?

Quantizing weights reduces their footprint. The decision turns on how much task accuracy you give up for the memory and speed you gain.

Start by comparing Q4_K_M and Q5_K_M from the same checkpoint, then keep the smaller file if both pass your task checks. In llama.cpp's published Llama 3.1 8B example, those variants occupy 4.58 GiB and 5.33 GiB, so the higher-precision comparison costs 0.75 GiB of extra weight storage.

Read the whole quantization name

Quantization represents weights with fewer bits. The useful question is how much memory it saves while preserving the answers you need. Check the extracted invoice totals, dates and exceptions even when the response reads fluently.

In GGUF names, Q4 and Q5 identify nominal precision families, K identifies the K-quant scheme, and M names the medium mixed-precision recipe. The llama.cpp Q4_K_M recipe mixes tensor types with different precisions. Q8_0 is a separate eight-bit block encoding, with storage for scales as well as the quantized values.

Download label Measured bits per weight Published size Useful comparison role
Q4_K_M 4.8944 4.58 GiB Compact first candidate
Q5_K_M 5.7036 5.33 GiB Next precision step
Q8_0 8.5008 7.95 GiB Higher-precision comparison

These whole-model figures come from the Llama 3.1 8B table in llama.cpp's quantization documentation. Whole-model averages vary across GGUF artifacts. At the individual tensor level, the project's encoding reference gives Q4_K as 4.5 bits per weight and Q5_K as 5.5. Mixing tensor types changes the whole-file average. Use the publisher's actual file size when deciding whether a download fits.

The extra 0.75 GiB between the first two rows is 0.75 ÷ 4.58 × 100 = about 16.4% more weight storage. That is a concrete price for your accuracy experiment. Check whether that extra precision fixes the mistakes in your evaluation.

Understand what an imatrix variant changes

An importance matrix is calibration data used during quantization. llama.cpp's llama-imatrix collects information from a model processing a text dataset; llama-quantize --imatrix uses that information when producing the quantized weights. An imatrix variant can still be Q4_K_M. Record the calibration method as part of the artifact's provenance alongside its quantization recipe.

If you create your own artifacts, the documented workflow has this shape, with a high-precision source model and your calibration text already present:

./build/bin/llama-imatrix -m source-f16.gguf -f calibration.txt -o imatrix.gguf
./build/bin/llama-quantize --imatrix imatrix.gguf source-f16.gguf model-Q4_K_M.gguf Q4_K_M

You do not need to generate an importance matrix simply to use someone else's finished quantization. Ask the publisher which upstream revision and calibration set they used. Keep those details beside the filename. If the information is absent, evaluate the download on task outcomes and leave the cause of any improvement unresolved.

Use separate records for calibration and evaluation. Otherwise you are testing how well your conversion preserved material it was already tuned around. Include the languages, number formats and document shapes your real work contains in the evaluation set.

Spend saved memory deliberately

A smaller weight artifact can make room for a longer conversation or additional requests. Decide which benefit you actually need before choosing the smallest available file. If your current task already fits comfortably, accepting more extraction errors for unused memory is a poor trade.

Likewise, do not choose Q8_0 solely because it has the largest number. Your comparison should include the whole working configuration: weights, context, concurrency and desktop applications. The memory worksheet helps you make that allocation explicit.

Separate two experiments. First compare quantizations with the checkpoint held fixed. Then, if neither meets your quality target, compare model families. Changing both at once leaves you unable to tell whether the result came from a better model or a less aggressive representation.

Choose an acceptance rule before looking at answers. For an expense workflow, that might be zero changed totals and zero invented currencies across the test set. For a draft summary, you might accept harmless wording changes but reject a missing exception. Choose those acceptance rules from the consequences of errors in your product.

Try it on your workload

Download two quantizations of the same checkpoint and record their upstream revision, publisher and exact byte sizes. Build twenty short fictional records containing dates, quantities, units, negations and exceptions. Write the expected fields first. Save each complete prompt as record-01.txt through record-20.txt, including the extraction instruction, required output fields and fictional record; keep reference answers in separate files. Include a missing date and a statement that explicitly cancels an earlier quantity.

Run both files with the same runner build, prompt template, context and decoding settings. In llama.cpp, these commands hold the context and output ceiling fixed; replace the filenames with your downloaded artifacts:

./build/bin/llama-cli -m model-Q4_K_M.gguf -c 4096 -n 256 --temp 0 --single-turn -f record-01.txt
./build/bin/llama-cli -m model-Q5_K_M.gguf -c 4096 -n 256 --temp 0 --single-turn -f record-01.txt

Repeat for all twenty inputs, then rerun any disagreement. Count changed digits separately from omitted fields and stylistic differences. Record peak memory and elapsed time, but choose the winner from accepted answers. Reject shorter responses that silently drop an exception.

How to decide

  • Keep Q4_K_M when both artifacts satisfy the same acceptance rule and its smaller footprint helps your workload.
  • Move to Q5_K_M or Q8_0 when a repeatable, consequential error disappears at higher precision and the full working set still fits.
  • Change checkpoints when the same important mistakes survive the precision comparison.

Run ten evaluation agents at once for less than a cent

Ten evaluation agents working at once on mistralai/mistral-small-24b-instruct-2501 cost about 0.7 cents in tokens on TrustedRouter for this comparison. Split the twenty fictional records between the agents and score their extracted fields against the same reference answers used locally.

On 2026-11-22, the live catalog listed approximately $0.0528 per million input tokens and $0.0844 per million output tokens. Suppose each agent's repeated evaluations use 10,000 input and 2,000 output tokens. Input = 10 × 10,000 = 100,000; output = 10 × 2,000 = 20,000. Cost = 0.1 × $0.0528 + 0.02 × $0.0844 = $0.006968, about 0.7 cents.

On one local GPU, those agents share throughput, and requests beyond its parallel capacity wait in line; through a per-token API, they can run together for the same token bill as sequential evaluation. This compares deployments, not GGUF quantization alone: the artifact and serving configuration differ. Prices change; check the catalog, the request quickstart and agent setup. For approved data, encrypted inference and zero data retention depend on model and provider. Local is better for offline operation or when the smaller artifact already meets your needs.

Sources

Related local LLM decisions