LLM VRAM calculator

Pick an open model, a quantization and a context length to estimate how much GPU memory it needs to run locally, and whether it fits your graphics card. The estimate adds the model's weights and its KV cache, using each model's published architecture.

Quantization (GGUF)
KV cache type
Your GPU memory (GB)
Estimated memory needed—
Model weights—
KV cache for —
Plus runtime buffers, not included. Leave some memory free.
Memory needed by quantization for this model and context
QuantizationWeightsTotal with KV cacheFits ?
Ad slot · below the tool, never inside it

How the estimate works

The calculator adds two parts.

weights (GB) = parameters (billions) × bits per weight ÷ 8
KV cache (bytes) = 2 × layers × KV heads × head size × bytes per value × context tokens

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

ModelParametersMax contextLayers / KV heads / head sizeQ4_K_M at 4KQ4_K_M at 8KQ4_K_M at 32KLicense
Qwen3 4B4B32K131K with YaRN36 / 8 / 1283.1 GB3.7 GB7.3 GBApache 2.0
Llama 3.1 8B8B128K32 / 8 / 1285.4 GB6.0 GB9.2 GBLlama 3.1 Community License
Qwen3 8B8.2B32K131K with YaRN36 / 8 / 1285.6 GB6.2 GB9.8 GBApache 2.0
Phi-4 (14B)14B16K40 / 10 / 1289.4 GB10.2 GB15.3 GBMIT
Qwen3 14B14.8B32K131K with YaRN40 / 8 / 1289.7 GB10.4 GB14.4 GBApache 2.0
Mistral Small 3.1 24B24B128K40 / 8 / 12815.4 GB16.0 GB20.1 GBApache 2.0
Qwen3 32B32.8B32K131K with YaRN64 / 8 / 12821.1 GB22.2 GB28.7 GBApache 2.0
Llama 3.3 70B70B128K80 / 8 / 12844.2 GB45.5 GB53.6 GBLlama 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

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.