How the estimate works
The calculator adds two parts.
The bits per weight for each GGUF quantization are the values the llama.cpp project measured on Llama 3.1 8B. The layers, KV heads and head size come from each model's own config.json file. A 16-bit KV cache uses 2 bytes per value. Q8_0 uses about 1.06.
Example: Qwen3 8B has 36 layers, 8 KV heads and a head size of 128, so its 16-bit KV cache takes 147,456 bytes per token. At Q4_K_M with 8,192 tokens of context, that is 5.0 GB of weights plus 1.2 GB of KV cache: about 6.2 GB in total.
Not included
The estimate leaves out the working buffers that apps such as Ollama, LM Studio and llama.cpp allocate, and any GPU memory already used by your desktop and other programs. Those vary by app, settings and graphics card, so leave some memory free rather than filling your card to the last gigabyte. Models with vision encoders also need extra memory when you send them images.
Models in the calculator
| Model | Parameters | Max context | Layers / KV heads / head size | Q4_K_M at 4K | Q4_K_M at 8K | Q4_K_M at 32K | License |
|---|---|---|---|---|---|---|---|
| Qwen3 4B | 4B | 32K131K with YaRN | 36 / 8 / 128 | 3.1 GB | 3.7 GB | 7.3 GB | Apache 2.0 |
| Llama 3.1 8B | 8B | 128K | 32 / 8 / 128 | 5.4 GB | 6.0 GB | 9.2 GB | Llama 3.1 Community License |
| Qwen3 8B | 8.2B | 32K131K with YaRN | 36 / 8 / 128 | 5.6 GB | 6.2 GB | 9.8 GB | Apache 2.0 |
| Phi-4 (14B) | 14B | 16K | 40 / 10 / 128 | 9.4 GB | 10.2 GB | 15.3 GB | MIT |
| Qwen3 14B | 14.8B | 32K131K with YaRN | 40 / 8 / 128 | 9.7 GB | 10.4 GB | 14.4 GB | Apache 2.0 |
| Mistral Small 3.1 24B | 24B | 128K | 40 / 8 / 128 | 15.4 GB | 16.0 GB | 20.1 GB | Apache 2.0 |
| Qwen3 32B | 32.8B | 32K131K with YaRN | 64 / 8 / 128 | 21.1 GB | 22.2 GB | 28.7 GB | Apache 2.0 |
| Llama 3.3 70B | 70B | 128K | 80 / 8 / 128 | 44.2 GB | 45.5 GB | 53.6 GB | Llama 3.3 Community License |
Parameters, context and license from each model's Hugging Face page; architecture from its config.json (linked). Checked Dec 1, 2026. Quantizations available: Q3_K_M, IQ4_XS, Q4_K_M, Q5_K_M, Q6_K, Q8_0, F16.
Sources
- llama.cpp quantize README (bits per weight for each GGUF type, measured on Llama 3.1 8B)
- Sebastian Raschka: KV cache calculations (KV cache formula and the Qwen3 8B example)
- Each model's Hugging Face page and config.json, linked in the table above.
Frequently asked questions
How much VRAM do I need to run a local LLM?
It depends on the model size, the quantization and the context length. For example, Qwen3 8B at Q4_K_M with an 8,192-token context needs about 6.2 GB for its weights and KV cache, before runtime buffers.
What is quantization?
Quantization stores a model's weights with fewer bits each, so the model takes less memory. Q4_K_M uses about 4.9 bits per weight instead of 16, at some cost to output quality. Q8_0 is close to the original quality at about half the size of 16-bit.
What is the KV cache?
While a model reads your prompt and writes its answer, it stores keys and values for every token so it does not have to recompute them. That store is the KV cache. It grows with the context length, so a long context can need several gigabytes on its own.
What if the model does not fit in my GPU memory?
Apps such as Ollama and LM Studio can split a model between GPU memory and system RAM, but the part in system RAM runs much more slowly. Try a smaller quantization, a shorter context, a Q8_0 KV cache, or a smaller model.
Why is the real memory use a bit higher?
Apps also need working buffers, and your operating system and other programs use some GPU memory. The bits per weight also vary slightly between models. Treat the result as an estimate and leave some memory free.