LLM VRAM Calculator: How Much GPU Memory Does a Model Need?

Last updated:

How much GPU memory (VRAM) do you need to run a large language model locally? Pick a model or enter its size, choose a quantization level and a context length, and the calculator shows the memory for the weights and the KV cache, plus which GPUs it fits on.

Estimate in decimal gigabytes (1 GB = 1 billion bytes). Overhead is set at 10% of the weights plus 0.5 GB for the runtime and activations; real use varies by software. Mixture-of-experts models still need all parameters in memory. Layers, KV heads and head dimension come from each model’s published configuration.

How LLM VRAM is calculated

Running a model needs memory for three things. The weights take parameters times bits per weight divided by 8: an 8 billion parameter model at 16 bits needs about 16 GB, and at 4.85 bits (Q4_K_M) about 4.9 GB. The KV cache stores the attention state for every token in the context: 2 x layers x KV heads x head dimension x context length x bytes per value. Finally the runtime adds some overhead for buffers and activations.

Longer context and more simultaneous users grow the KV cache, so a model that fits at 8K tokens may not fit at 128K. Lower precision shrinks the weights, which is why a 70B model that needs about 140 GB in FP16 can run in roughly 43 GB at Q4_K_M. Check the PCIe bandwidth if you plan to split a model across cards, and the PSU calculator for the power budget.

Frequently asked questions

How much VRAM do I need to run a 7B or 8B model?

About 7 GB at Q4_K_M with an 8K context, and about 19 GB at FP16. A 12 GB graphics card runs a quantized 8B model comfortably, and an 8 GB card is tight.

Can I run a 70B model on one GPU?

At Q4_K_M a 70B model needs about 50 GB at an 8K context, so it needs an 80 GB card or a split over several GPUs. It does not fit on a single 24 GB, 32 GB or 48 GB card at that context without heavier quantization or offloading to system RAM.

Does quantization reduce quality?

Slightly. Q8 and Q6 are close to FP16 in practice, Q4 is the common sweet spot, and quality drops more noticeably at Q3 and Q2.

All calculators