▚VRAM Calculator▋

// memory

LLM VRAM Calculator

Estimate the GPU memory to run any large language model — from the parameter count, quantization format and context length.

Hybrid attention/SSM — KV covers ~16 attention layers; recurrent layers add a small fixed state.

Total VRAM needed

17.4GB

Weights

15.4GB

KV cache

0.5GB

Overhead

1.5GB

weights 15.38 GBkv cache 0.50 GBoverhead 1.47 GB

vram = Qwen3.8 27B × 0.604 B/param + kv(8192 tok × 1) + overhead = 17.4 GB

Fits on (74 of 108)

Titan RTX 24GB · 24GBRTX 3090 24GB · 24GBRTX 3090 Ti 24GB · 24GBRTX 4090 24GB · 24GBRTX 5090 32GB · 32GBRTX A4500 20GB · 20GBRTX A5000 24GB · 24GBRTX A5500 24GB · 24GBRTX A6000 48GB · 48GBRTX 4000 Ada 20GB · 20GBRTX 4500 Ada 24GB · 24GBRTX 5000 Ada 32GB · 32GBRTX 6000 Ada 48GB · 48GBRTX PRO 5000 Blackwell 48GB · 48GBRTX PRO 6000 Blackwell 96GB · 96GBTesla P40 24GB · 24GBTesla V100 32GB (SXM2) · 32GBA10 24GB · 24GBA30 24GB · 24GBA40 48GB · 48GBL4 24GB · 24GBL40 48GB · 48GBL40S 48GB · 48GBA100 40GB · 40GBA100 80GB · 80GBH100 PCIe 80GB · 80GBH100 SXM 80GB · 80GBH100 NVL 94GB · 94GBH200 SXM 141GB · 141GBB100 192GB · 192GBB200 192GB · 192GBB300 (Blackwell Ultra) 288GB · 288GBGB200 (per-GPU) 192GB · 192GBRTX PRO 6000 Blackwell Server 96GB · 96GBRadeon RX 7900 XT 20GB · 20GBRadeon RX 7900 XTX 24GB · 24GBRadeon PRO W7800 32GB · 32GBRadeon PRO W7900 48GB · 48GBInstinct MI210 64GB · 64GBInstinct MI250 128GB · 128GBInstinct MI250X 128GB · 128GBInstinct MI300X 192GB · 192GBInstinct MI325X 256GB · 256GBInstinct MI350X 288GB · 288GBInstinct MI355X 288GB · 288GBInstinct MI455X 432GB (est. specs, pre-GA) · 432GBIntel Gaudi 2 96GB · 96GBIntel Gaudi 3 128GB · 128GBData Center GPU Max 1550 128GB · 128GBApple M1 Max (32GB unified) · 32GBApple M1 Ultra (64GB unified) · 64GBApple M1 Ultra (128GB unified) · 128GBApple M2 Max (64GB unified) · 64GBApple M2 Ultra (128GB unified) · 128GBApple M2 Ultra (192GB unified) · 192GBApple M3 Pro (36GB unified) · 36GBApple M3 Max (48GB unified) · 48GBApple M3 Max (128GB unified) · 128GBApple M3 Ultra (96GB unified) · 96GBApple M3 Ultra (256GB unified) · 256GBApple M3 Ultra (512GB unified) · 512GBApple M4 (32GB unified) · 32GBApple M4 Pro (48GB unified) · 48GBApple M4 Max (64GB unified) · 64GBApple M4 Max (128GB unified) · 128GBApple M5 (32GB unified) · 32GBApple M5 Pro (64GB unified) · 64GBApple M5 Max (64GB unified) · 64GBApple M5 Max (128GB unified) · 128GBApple M5 Ultra (256GB unified) · 256GBApple M5 Ultra (512GB unified) · 512GBApple M6 (32GB unified) · 32GBAMD Ryzen AI Max+ 395 (128GB unified) · 128GBNVIDIA DGX Spark (GB10, 128GB unified) · 128GB

Model architectures & quant sizes: presets verified 2026-09. Estimate adds a conservative framework + activation margin — treat it as "fits in practice", not a hard floor. Every field also accepts custom values.

notes

What this estimates

This tool adds up the three things that occupy GPU memory when you run an LLM for inference:

  1. Weights — the model parameters, in whatever precision you load them. parameters × bytes-per-weight. Picking Q4_K_M instead of fp16 cuts this to roughly a quarter.
  2. KV cache — the running key/value tensors for every token currently in context. It grows with context length × batch size × layers × key-value heads × head dimension, and it is the part people forget.
  3. Overhead — activations during the forward pass, plus a flat reservation for the CUDA context, memory-allocator fragmentation and library workspaces.

The result is a “fits in practice” number, not a theoretical minimum. Leave a gigabyte or two of headroom on top.

Worked example

Llama 3.1 8B at Q4_K_M, 8k context, batch 1:

  • Weights: 8.03 B params × 0.60 B ≈ 4.8 GB
  • KV cache: 2 × 32 layers × 8 KV-heads × 128 dim × 8192 tokens × 2 B ≈ 1.0 GB
  • Overhead: activations + ~1 GB flat ≈ 1.5 GB
  • Total ≈ 7.3 GB — comfortable on a 12 GB card, tight-but-fine on 8 GB.

Push the same model to 128k context and the KV cache alone jumps past 15 GB. That is the difference between “runs on a laptop” and “needs a datacenter card”.

Reading the result

The stacked bar shows where the memory goes. If weights dominate, drop to a smaller quant. If KV cache dominates, shorten the context or switch the KV precision to Q8. The Fits on list checks your total against the memory of every GPU in the preset table.

Every field also accepts custom values, so a model or card that is not in the list is still one input away. Model architectures and quant sizes come from a preset table with a visible verified date; refresh it if a model looks stale.

faq
Why does my 24 GB card run out of memory on a model the calculator says needs 20 GB?
Three reasons usually. The KV cache grows with every token of context, so a number that fits at 2k tokens can overflow at 32k. The CUDA context, allocator fragmentation and cuBLAS workspaces reserve 1–2 GB before your model loads. And if the display is on the same GPU, the desktop compositor takes a slice. The estimate here adds a margin for all of that, but headroom of a couple of GB is still wise.
Is a GGUF Q8_0 file the same size as fp16?
Almost. Q8_0 stores weights in 8 bits plus a small per-block scale, so it lands around 8.5 bits per weight — roughly half of fp16. It is effectively lossless. fp16 is 16 bits per weight exactly.
Does context length really matter that much?
For long context and small GPUs, yes. The KV cache scales linearly with context, batch size and the number of key/value heads. On a model without grouped-query attention a 128k context can cost more memory than the weights themselves. Quantizing the KV cache to Q8 halves it.
How is the weight size calculated?
parameters × bytes-per-weight. fp16 is 2 bytes, Q4_K_M about 0.60 bytes, Q2_K about 0.33 bytes. For a mixture-of-experts model the total parameter count (all experts) sets the memory; only the active parameters affect speed.