How much VRAM an LLM needs
Short answer
VRAM needed = weights + KV cache + activations and runtime. Weights are parameters times bytes per parameter: 2 bytes in BF16, 1 in FP8, about 0.5 at 4 bits. The KV cache grows with every token of context and every request served at once. Allow 1 to 4 GiB per GPU for the rest. Llama 3.3 70B in FP8 is about 67.7 GiB of weights, and each 128K-token conversation adds 40.0 GiB of cache.
The weights decide whether a model loads. The KV cache decides whether it can serve your workload: a model that fits with 4K tokens of context can run out of memory at 128K, or at 16 users. The calculator prices both, using each model's attention layout from its config.json.
Weights: parameters times bytes
A model with 70 billion parameters stored in BF16 takes 140 GB (130 GiB). Quantized formats store fewer bits per weight plus small scaling factors, and the bits below include those scales.
Scroll for more columns →
| Format | Bits per weight | Where the bits come from |
|---|---|---|
| BF16 / FP16 | 16 | 2 bytes per weight |
| FP8 | 8 | 1 byte per weight; block scales add under 0.1% |
| INT8 (W8A8 / W8A16) | 8 | 1 byte per weight, per-channel scales |
| NVFP4 | 4.5 | 4-bit values + one FP8 scale per 16 |
| MXFP4 | 4.25 | 4-bit values + one 8-bit scale per 32 |
| INT4 (AWQ / GPTQ) | 4.16 | 4-bit values + FP16 scale and 4-bit zero per group of 128 |
| GGUF Q8_0 | 8.5 | 32 INT8 values + one FP16 scale |
| GGUF Q6_K | 6.5625 | 6-bit values + 8-bit scale per 16, FP16 scale per 256 |
| GGUF Q4_K_M | 4.85 | Mix of Q4_K (4.5 bits) and Q6_K tensors, about 4.85 bits on average |
GPU quantization tools usually leave the input embeddings and the output layer in 16 bits, so the calculator prices those at 2 bytes for every non-GGUF format. llama.cpp quantizes them too. When a model's official checkpoint is already quantized, such as DeepSeek-V4.1-Flash with FP4 experts, "As published" uses the size of the released files.
Mixture-of-experts (MoE) models do not get a discount. A token only passes through a few experts, but any token can pick any expert, so all of them stay in memory. gpt-oss-120b uses 5.1B parameters per token and still needs its full 60.8 GiB checkpoint loaded.
KV cache: grows with context and users
While it generates, the model keeps the keys and values of every earlier token so it does not recompute them. For standard attention the size is:
KV bytes = layers × 2 × KV heads × head dim × bytes per element × tokens × sequencesLlama 3.3 70B has 80 layers and 8 KV heads of dimension 128, so each token costs 320 KiB in BF16. FP8 halves that. Newer models shrink it by changing the attention itself, and the presets model each design separately:
- Latent attention (MLA). DeepSeek-V3.1, Kimi K2 and GLM-5.3 cache one 576-value vector per token per layer instead of full keys and values: 68.6 KiB per token in BF16 across 61 layers.
- Hybrid attention. Qwen3.8 keeps a normal KV cache on one layer in four. The others are Gated DeltaNet layers that hold a fixed-size state per sequence, so Qwen3.8-Flash-Next needs only 24.8 KiB per token. GLM-5.3-Flash pairs 11 latent-attention layers with 34 KDA layers in the same way.
- Sliding windows. gpt-oss and Gemma keep only the last 128 or 1,024 tokens on their local-attention layers, so those layers stop growing.
- Published figures. DeepSeek-V4.1-Flash compresses its global cache to 890 bytes per token in FP4. The calculator uses that number as published.
Recurrent state is per sequence and does not grow with context. It does multiply with concurrency, and engines keep extra copies for prefix caching: our GLM-5.3-Flash replicas reserve 28 state slots for four running requests, which became the bottleneck before the KV cache did.
Activations, runtime and the memory cap
Two smaller terms complete the estimate. Activations are the temporary tensors for the prompt chunk being processed:
activations = prefill chunk × (4 × hidden size + 2 × FFN width ÷ TP) × 2 bytesRuntime covers the CUDA context, library workspaces and CUDA graphs. The vLLM / SGLang preset uses 2 GiB per GPU and 8,192-token chunks; the llama.cpp / Ollama preset uses 0.75 GiB and 512-token micro-batches. Both are editable under Overhead settings.
Engines do not use all of a GPU. vLLM claims a fixed share set by --gpu-memory-utilization: 0.90 up to v0.19 and 0.92 from v0.20. The calculator uses 0.90 for vLLM and SGLang and 0.95 for llama.cpp. Macs use the share macOS gives the GPU, which Apple puts at 21 GB of a 32 GB machine and 48 GB of a 64 GB one.
We checked the vLLM preset against Nanbeige4.3-33B on one RTX PRO 6000, where vLLM reported 62, 33 and 21 GiB of weights and room for 108K, 499K and 623K cached tokens in BF16, FP8 and NVFP4. The calculator predicts the weights and the cache room within 3% for all three. Those checks run as unit tests whenever the presets change.
Splitting a model across GPUs
Tensor parallelism (TP) splits every layer across the GPUs in one server. Each GPU holds 1/TP of the weights and of the KV heads, plus its own runtime memory. Two details change the answer:
- Once TP is larger than the number of KV heads, heads are copied, not split. vLLM gives every GPU at least one, so Qwen3.8-Flash-Next (2 KV heads) uses as much KV memory per GPU at TP4 as at TP2.
- Latent-attention caches are copied to every GPU in plain tensor parallel, so adding GPUs does not shrink them. Data-parallel attention, which we use for GLM-5.3 on 8x H200, avoids the copies.
vLLM also requires the number of attention heads to divide evenly by TP, so the calculator skips sizes that do not. Above eight GPUs a model needs more than one server, with pipeline or expert parallelism, and the calculator gives only a rough GPU count.
VRAM requirements for popular models
Total memory for one 32K-token conversation with a BF16 KV cache and vLLM-style overhead, and the smallest NVIDIA setup that holds it on GPUs that run the format natively (fewest GPUs, then the smallest card). Computed by the calculator above.
Scroll for more columns →
| Model | BF16 | FP8 | 4-bit (AWQ/GPTQ) |
|---|---|---|---|
| Llama 3.1 8B | 22 GiB 1 × RTX 5090 | 15 GiB 1 × L4 | 12 GiB 1 × L4 |
| Gemma 4 26B A4B | 51 GiB 1 × H100 80GB | 28 GiB 1 × RTX 5090 | 17 GiB 1 × L4 |
| Qwen3.8-27B | 57 GiB 1 × H100 80GB | 33 GiB 1 × L40S | 22 GiB 1 × RTX 5090 |
| Nanbeige4.3-33B | 71 GiB 1 × H100 80GB | 43 GiB 1 × RTX 6000 Ada | 29 GiB 1 × A100 40GB |
| Llama 3.3 70B | 145 GiB 1 × B200 | 81 GiB 1 × H100 NVL | 50 GiB 1 × H100 80GB |
| gpt-oss-120b | 221 GiB 2 × H200 | 114 GiB 1 × H200 | 62 GiB 1 × H100 80GB |
| Qwen3.8-Flash-Next | 339 GiB 4 × H200 | 172 GiB 2 × H200 | 92 GiB 1 × H200 |
| Qwen3-235B-A22B-2507 | 446 GiB 4 × H200 | 229 GiB 2 × H200 | 124 GiB 1 × H200 |
| GLM-5.3-Flash | 602 GiB 4 × B200 | 304 GiB 2 × B200 | 161 GiB 1 × B200 |
| DeepSeek-V3.1 | 1280 GiB more than 8 GPUs | 644 GiB 8 × RTX PRO 6000 Blackwell | 339 GiB 4 × H200 |
| Kimi K2 | 1917 GiB more than 8 GPUs | 963 GiB 8 × H200 | 505 GiB 4 × B200 |
What the calculator does not model
- Speculative decoding. Draft models and multi-token-prediction heads add their own weights and cache.
- Extra recurrent-state slots that hybrid models keep for prefix caching (see the GLM-5.3-Flash note above).
- Offloading weights or cache to system RAM or SSD, which lets a model run on less VRAM at a large speed cost.
- Vision encoders' activations. Their weights are included when the official checkpoint ships them.
- Fine-tuning. Training needs gradients and optimizer state, several times the inference figure.
Model numbers come from each model's official config.json on Hugging Face and the parameter count its repository reports, checked on 5 November 2026. GPU capacities are the totals nvidia-smi reports (for example 97,887 MiB for the RTX PRO 6000 and 81,559 MiB for the H100), which differ from the GB on the box. Every preset links its source under "How this was calculated".
Frequently asked questions
How much VRAM do I need to run an LLM?
Add three things: the weights (parameters times bytes per parameter), the KV cache (bytes per token times context length times concurrent requests), and 1 to 4 GiB of runtime and activation memory per GPU. Llama 3.3 70B in FP8 needs about 67.7 GiB for weights alone, and each 128K-token conversation adds about 40.0 GiB of BF16 KV cache.
How do I calculate KV cache size?
For standard attention: layers × 2 (keys and values) × KV heads × head dimension × bytes per element × tokens × sequences. Models with compressed latent attention (DeepSeek, Kimi, GLM) store one smaller vector per token per layer, and hybrid models keep a full KV cache on only some layers. The calculator applies the right formula for each preset and shows the numbers it used.
Can I run a 70B model on a 24 GB GPU?
Not on one card. A 4-bit GGUF (Q4_K_M) of Llama 3.3 70B is about 39.8 GiB of weights before any cache. With llama.cpp overheads it fits across 2 RTX 4090s at an 8K context. On one 24 GB card it only runs with some layers offloaded to system RAM, and generation slows down sharply.
Does a mixture-of-experts model need less VRAM?
No. Every expert has to be in memory because any token can be routed to any expert, so memory follows total parameters. Active parameters set the compute per token, so MoE models generate faster than dense models of the same total size.
Can I run LLMs on a Mac with unified memory?
Yes, within the share macOS lets the GPU use. Apple says a 32 GB Mac's GPU can access 21 GB and a 64 GB Mac's GPU 48 GB, about two-thirds and three-quarters. You can raise the limit with sudo sysctl iogpu.wired_limit_mb (the mlx-lm README documents it), at the cost of memory for everything else. FP8 and NVFP4 have no native kernels on Apple silicon, so Macs run GGUF, MLX or MXFP4 builds.
How accurate is this calculator?
It is an estimate. With vLLM-style settings it lands within 3% of the weights and of the KV cache room vLLM reported for Nanbeige4.3-33B in BF16, FP8 and NVFP4 on one RTX PRO 6000. Real engines add padding, CUDA graphs that vary by batch size, speculative-decoding drafts and extra state for prefix caching, so leave a few GiB of headroom.