AI agents · OpenClaw · self-hosting · automation

Quick Answer

How Much VRAM Do You Need to Run a Local LLM? (2026 Guide)

Published:

The short answer

Memory needed ≈ weights + KV cache + 1–2 GB overhead.

  • Weights (GB) ≈ parameters (billions) × bits per weight ÷ 8.
  • KV cache (bytes) = 2 × layers × KV heads × head dim × bytes per value × tokens.

At the default Q4_K_M quantization, budget about 0.6 GB per billion parameters for weights, then add context. That gives these practical floors (as of November 2026):

Model sizeQ4_K_M weights+ 8K context (typical)Fits on
3–4B~2–2.5 GB~3–4 GB6 GB GPU, any 8 GB Mac
7–8B~5 GB~6–7 GB8 GB GPU, 16 GB Mac
14B~9 GB~10–11 GB12 GB GPU
27–32B~17–20 GB~19–23 GB24 GB GPU, 32 GB Mac
70B~43 GB~45–48 GB2× 24 GB GPUs, 48 GB card, 64 GB Mac
gpt-oss-120b (MoE)——One 80 GB GPU (OpenAI)

Context figures assume a grouped-query-attention model and a 16-bit KV cache; long contexts need far more (see step 3).

Step 1: Pick the quantization

llama.cpp’s quantize README publishes measured bits per weight for each GGUF format:

FormatBits / weight8B model size*When to use
Q3_K_M3.9963.74 GiBSqueezing a bigger model into fixed memory
IQ4_XS4.4604.17 GiBSlightly smaller than Q4_K_M, similar quality
Q4_K_M4.8944.58 GiBDefault
Q5_K_M5.7045.33 GiBSpare memory, better accuracy
Q6_K6.5636.14 GiBNear-lossless for most tasks
Q8_08.5017.95 GiBMemory is not a constraint
F1616.014.96 GiBReference / fine-tuning

*Sizes from the README’s 8B benchmark model. The same README lists Llama 3.1 sizes at Q4_K_M: 8B 4.9 GB, 70B 43.1 GB, 405B 249.1 GB (from 32.1 GB, 280.9 GB and 1,625.1 GB originals).

Rule: if a model only fits below Q3, pick a smaller model at Q4_K_M instead — it usually answers better.

Step 2: Compute the weights

Multiply. A 32B model at Q4_K_M: 32 × 4.894 ÷ 8 ≈ 19.6 GB. At Q6_K: 32 × 6.563 ÷ 8 ≈ 26.3 GB — no longer fits a 24 GB card.

Mixture-of-experts models need memory for all parameters, not just the active ones: active parameters set speed, total parameters set memory. OpenAI states gpt-oss-120b runs on a single 80 GB GPU and gpt-oss-20b within 16 GB. Frontier-size open MoE models are another class: Mistral Large 4’s NVFP4 checkpoint is about 610 GB, which is multi-GPU server territory.

Step 3: Add the KV cache for your context

Read four values from the model’s config.json: num_hidden_layers, num_key_value_heads, head_dim, and the cache precision you will run (2 bytes for 16-bit, 1 for 8-bit).

Worked example, Qwen3-8B (36 layers, 8 KV heads, head dimension 128):

  • Per token: 2 × 36 × 8 × 128 × 2 bytes = 147,456 bytes (~144 KiB)
  • 8,192 tokens: ~1.1 GiB
  • 32,768 tokens: ~4.5 GiB
  • With an 8-bit KV cache: half of each.

So an 8B model at Q4_K_M with a 32K context needs about 4.6 + 4.5 + 1 ≈ 10 GB, not 5. Long context, not the weights, is what breaks most “it should fit” estimates. Running several requests in parallel multiplies the cache by the number of concurrent sequences.

Step 4: Check the hardware type

  • NVIDIA/AMD GPUs: VRAM is a hard wall. Layers that do not fit offload to system RAM and run several times slower.
  • Apple Silicon: unified memory is shared, and macOS keeps part of it for the system, so do not plan to use all of it for the model. A 64 GB Mac comfortably runs 70B at Q4_K_M with modest context.
  • CPU only: works for small models; memory bandwidth, not size, limits speed.

Step 5: Leave headroom

Add 1–2 GB for the runtime, CUDA/Metal buffers and the desktop. If the total is within 10% of your memory, drop one quantization level or halve the context.

Self-host or call an API?

If the model you want needs a GPU you do not own, compare with hosted prices first: gpt-oss-120b, for example, is $0.15 input / $0.60 output per million tokens on Groq, Together and Fireworks (November 2, 2026). Our self-host vs API break-even guide does that math, and best local LLM to run picks models per hardware tier. Token rates for hosted models are in our current API prices table.

Last verified: November 2, 2026.

Sources