RigBase calculator on Hugging Face · Full version on getrigbase.com (always current) · Dataset (CC BY 4.0)
More
Submit build

Can I run it? VRAM & KV cache calculator

Quick answer

How much VRAM do I need to run an LLM locally?
Weights + KV cache + runtime overhead must fit in the GPU memory. Weights ≈ parameters × bits per weight ÷ 8 (Q4_K_M is 4.89 bits per weight). The KV cache grows with context: 2 × layers × KV heads × head_dim × context tokens × bytes per value; for Llama 3.3 70B at FP16 that is about 0.33 MB per token, 10.7 GB at 32,768 tokens. The calculator below does this math for 1–8 GPUs, DGX Spark, Mac and Strix Halo, and links the measured builds for each setup.

Last updated:

Will a 2026 model fit on your 1–8 GPUs, a DGX Spark (or two), a Mac or a Strix Halo? Pick the model, engine and format (GGUF, AWQ, GPTQ, FP8, NVFP4, MXFP4, EXL, MLX), context and hardware. We show the weights, the KV cache, the math, and the real measured builds for that setup.

The model decides how many parameters must sit in memory. For MoE models (e.g. “35B-A3B”) all experts must be loaded, even though only the active ones are used per token.
Total parameters in billions. Weights (GB) = params × bits-per-weight ÷ 8. Edit it for a model we do not list.
MoE only: parameters used per token. They set the speed (less to read per token), not the memory: memory still follows total params. Small active counts make CPU/RAM offload of experts bearable.
The software that runs the model. llama.cpp/Ollama/LM Studio use GGUF files and run on almost anything. vLLM/SGLang use safetensors (FP8, AWQ, GPTQ, NVFP4) and shine with several GPUs and many users. ExLlama uses EXL2/EXL3, MLX is for Macs.
How many bits each weight uses. Sweet spot: Q4_K_M or AWQ/GPTQ 4-bit (≈4.25–4.9 bpw). Have room? Q5_K_M / Q6_K. Want near-lossless? Q8_0 / FP8. NVFP4 (4.5 bpw) is Blackwell-only native. We advise not going under ~4 bits (Q3/Q2) unless nothing else fits.
How many tokens (prompt + answer) the model keeps in view. Every token in context needs KV cache memory, so 128k context can need more memory than a small model's weights.
Precision of the stored keys/values. FP16 = 2 bytes per value. q8_0 / FP8 halves it with very little quality loss; q4_0 quarters it but can hurt long-context quality. llama.cpp: -ctk q8_0 -ctv q8_0 (quantized V needs flash attention); vLLM: --kv-cache-dtype fp8.
Parallel conversations/requests. Each one needs its own KV cache, so 4 users at 32k = 4× the KV of one. Keep 1 for a personal chat.
Your GPU, or a unified-memory box (DGX Spark, Mac, Strix Halo) where CPU and GPU share one memory pool.
How many identical GPUs (or linked nodes). Usable memory ≈ count × (VRAM − overhead). Mixed cards work in llama.cpp (pick the smaller card here for a conservative estimate).
Memory each GPU loses before weights load: CUDA/ROCm context, compute buffers, CUDA graphs. ~1 GB is our assumption; long contexts and big batches need more. For unified memory it is the OS + runtime reserve per node. vLLM additionally only uses gpu_memory_utilization (default 0.92) of each GPU.
System RAM. If the model fits in VRAM this barely matters (see “RAM matters less than you think”). It matters only when layers or experts are offloaded to the CPU.
Model architecture (for KV cache) — from config.json, editable

What are these?From the model's config.json: num_hidden_layers (or the count of full_attention entries in layer_types), num_key_value_heads, head_dim. Sliding-window layers only cache their window.

Show the math (with your numbers)
estimate above is arithmetic from published specs. measured below is what real builds reported.

How to calculate KV cache size

While generating, the model stores a key and a value vector for every token, in every attention layer. That store is the KV cache, and it grows with context:

KV bytes = 2 × layers × KV heads × head_dim × context tokens × concurrent sequences × bytes per value

Worked example, Llama 3.3 70B (80 layers, 8 KV heads, head_dim 128, FP16): 2 × 80 × 8 × 128 × 2 B = 327,680 bytes per token (≈0.33 MB). At 32,768 tokens that is 10.7 GB, as much as a 16 GB card. At q8_0 it is about half.

Why 2026 models need less: many new models only put full attention on some layers. Sliding-window layers (gpt-oss, Gemma 4, Muse, Step 5) cache just their window (128–2,048 tokens). Linear-attention / Gated DeltaNet layers (Qwen3.5–3.8, Ornith) and Mamba layers (Nemotron) keep a fixed-size state that does not grow. MLA (DeepSeek R1) caches one compressed latent per layer. The calculator reads these per-layer types from each model's config.json and counts only what grows with context.

Engines add some extra for compute buffers, and allocate KV in blocks/pages. vLLM pre-allocates all memory left after weights (up to gpu_memory_utilization, default 0.92) as KV cache, so it will look full however small your context is (vLLM source, FP8 KV cache docs).

Which quant or format should I use?

FormatBits / weightEngines
Q8_0 (GGUF)8.50llama.cpp / Ollama / LM Studio
Q6_K (GGUF)6.56llama.cpp / Ollama / LM Studio
Q5_K_M (GGUF)5.70llama.cpp / Ollama / LM Studio
Q4_K_M (GGUF)4.89llama.cpp / Ollama / LM Studio
IQ4_XS (GGUF)4.46llama.cpp / Ollama / LM Studio
Q3_K_M (GGUF)4.00llama.cpp / Ollama / LM Studio
Q2_K (GGUF)3.16llama.cpp / Ollama / LM Studio
F16 (GGUF)16.00llama.cpp / Ollama / LM Studio
MXFP4 (gpt-oss native)4.25llama.cpp / Ollama / LM Studio, vLLM / SGLang
BF16 / FP16 (unquantized)16.00vLLM / SGLang
FP8 (W8A8)8.00vLLM / SGLang
AWQ 4-bit (g128, ≈)4.25vLLM / SGLang
GPTQ 4-bit (g128, ≈)4.25vLLM / SGLang
GPTQ 8-bit (g128, ≈)8.25vLLM / SGLang
NVFP4 (Blackwell)4.50vLLM / SGLang
EXL3 (ExLlamaV3)you choose (2–8)ExLlamaV2 / V3
EXL2 (ExLlamaV2)you choose (2–8)ExLlamaV2 / V3
MLX 4-bit4.50MLX
MLX 8-bit8.50MLX

Hardware matters for some formats. FP8 compute needs compute capability ≥ 8.9 (Ada, Hopper, Blackwell); on Ampere cards such as the RTX 3090, vLLM runs FP8 checkpoints as weight-only W8A16 with FP8 Marlin kernels, saving memory but not compute (vLLM FP8 docs). NVFP4 is 4-bit E2M1 values with one FP8 scale per 16 values plus a per-tensor FP32 scale (4.5 bits per weight), about 3.5× smaller than FP16 and 1.8× smaller than FP8, and is computed natively by Blackwell's 5th-gen Tensor Cores (NVIDIA). On older NVIDIA GPUs vLLM falls back to weight-only W4A16 via Marlin (vLLM ModelOpt docs). MXFP4 (gpt-oss) shares one power-of-two scale per 32 values, 4.25 bits per weight; gpt-oss keeps attention and embeddings in BF16, so its real files are larger than params × 4.25 ÷ 8.

GGUF bits-per-weight are llama.cpp's measured values (quantize README); real files vary a little by model. AWQ/GPTQ ≈ 4.25 / 8.25 are our approximation (4 or 8 bits plus group-128 scales and zero points); embeddings and lm_head often stay 16-bit, so files run slightly larger. MLX: group size 64 with a 16-bit scale and bias, so 4-bit = 4.5 bpw (MLX docs). vLLM hardware support: vLLM quantization docs.

RAM matters less than you think

Most calculators tell you to buy as much system RAM as VRAM, or more. If the model fits fully in VRAM, you don't need that. System RAM then only holds the OS and the inference engine, and the weights pass through it once while loading. llama.cpp memory-maps the model file, so pages are read from disk and copied to the GPUs. They don't all have to sit in RAM at once, so RAM can be smaller than the model.

RAM becomes important only when you offload: layers or MoE experts that don't fit on the GPUs run from system RAM, and then both its size and its bandwidth (channels, DDR4 vs DDR5) set your speed.

Maintainer note: our maintainer runs 8× RTX 3090 with just 32 GB of DDR5 ECC RDIMM at home (for a measured 8x 3090 example from another builder, see 8x RTX 3090 serving DeepSeek V4 Flash (LimeChain vLLM kit)), and it works really well, because the models live in the 192 GB of VRAM. Spend the money on GPUs, not RAM, unless you plan to offload.

Caveat: converting or quantizing a model yourself, and some loaders, can need much more RAM for a short time. Keep swap enabled if you do that.

Multi-GPU and multi-node: tensor vs pipeline parallel

Memory adds up: 4× RTX 3090 = 96 GB, 8× = 192 GB, two DGX Sparks = 256 GB. Each GPU loses roughly 1 GB to its CUDA context and buffers (our assumption), and vLLM only uses 0.92 of each GPU by default.

RigBase has 33 measured multi-GPU / multi-node builds; the calculator lists those matching your setup.

Why prefill speed matters for coding assistants

The tokens/sec most benchmarks quote is generation (decode) speed: how fast the answer streams out. Before the first token appears the model must first read the whole prompt. That is prompt processing, or prefill. Chat prompts are short, so prefill hardly matters there. Coding assistants and agents are different. They send the open files, the repo map, tool output and the chat history on every turn, and these prompts easily reach thousands of tokens. On such prompts the wait before the first token (time to first token, TTFT) can take longer than generating the answer.

Prefill is compute-bound, while decode is mostly limited by memory bandwidth. So two rigs with similar generation speed can differ a lot in prefill. Discrete NVIDIA/AMD GPUs usually prefill much faster than unified-memory machines and CPU offload setups. Rough TTFT for a prompt: TTFT ≈ prompt tokens ÷ prefill tok/s (plus model load time; prompt caching in llama.cpp, MLX or vLLM can skip the repeated part).

RigBase now records prefill speed for 168 results on 90 builds, with the prompt length each source measured it at. Where it was measured on 512+ tokens we show an estimated TTFT for an 8k-token prompt, calculated from that measured speed. Across the current data the estimate ranges from Llama 2 7B on Single RTX 4090 (llama.cpp CUDA scoreboard): 14,771 tok/s prefill measured @ 512 tokens → ≈0.55 s to Llama 3.1 405B on Mac Studio M3 Ultra 512GB (Geerling test): 12.92 tok/s prefill measured @ 4,096 tokens → ≈634 s. Prefill usually slows down as prompts get longer, so an estimate taken from a much shorter or much longer prompt is only indicative. Where a source measured TTFT itself, we show it separately as measured. See the "Prompt processing" column on every build and model page.

Not enough VRAM? Rent before you buy. Run the model on a rented 24–96 GB cloud GPU by the hour and see the real speed before spending €1,000+. Try it on Runpod
Referral link: if you sign up with Google and add $10, Runpod gives you and RigBase bonus credit (terms). It never affects our data.

Weights size by quant (GB)

ModelParamsQ6_KQ5_K_MQ4_K_MQ3_K_MParam source
Qwen3.8 27B27B22.219.216.513.5Ollama library tag 27b (nominal)
Qwen3.6 35B-A3B35.51B (3B active)29.125.321.717.7GGUF param count via llamabench.ai; 3B active per name
Qwen3.6 27B27.32B22.419.516.713.6GGUF param count via llamabench.ai
Gemma 4 31B30.7B25.221.918.815.3GGUF param count via llamabench.ai
Gemma 4 26B-A4B25.23B (4B active)20.718.015.412.6GGUF param count via llamabench.ai
Gemma 4 12B11.91B9.88.57.35.9GGUF param count via llamabench.ai
gpt-oss 20B20.91B (3.6B active)17.214.912.810.4GGUF param count via llamabench.ai (OpenAI model card: 21B total, 3.6B active)
gpt-oss 120B117B (5.1B active)96.083.471.658.4OpenAI model card: 117B total, 5.1B active
Qwen3.5 9B8.95B7.36.45.54.5GGUF param count via llamabench.ai
Qwen3.5 122B122B100.187.074.660.9Ollama library tag 122b (nominal)
LFM2.5 24B-A2B23.97B (2.45B active)19.717.114.712.0via llamabench.ai
Nemotron 3.5 Bolt 74B-A9B74.04B (9B active)60.752.845.337.0via llamabench.ai
Nemotron 3 Super 120B-A12B120B (12B active)98.485.673.459.9Ollama library: 120B, 12B active
Nemotron 3.5 Super VL 120B-A12B120B (12B active)98.485.673.459.9NVIDIA launch blog (15 Oct 2026): 120B params; 12B active per model name
Mistral Medium 3.5 128B128B105.091.378.363.9Ollama library: 128B weights
Devstral Small 2 24B24B19.717.114.712.0Ollama library tag 24b
Muse Spark Open 816B-A42B816B (42B active)669.5581.8499.2407.6Hugging Face launch post: ~816B total, ~42B active
GLM-5.3753B617.8536.9460.7376.1Hugging Face listing: 753B
DeepSeek R1 671B671B (37B active)550.5478.4410.5335.2Ollama library: 671B total, 37B active (V3 base)
Llama 3.3 70B (older)70B57.449.942.835.0Ollama library tag 70b
Llama 3.1 8B (older)8B6.65.74.94.0Ollama library tag 8b
Qwen3.8 Flash-Next180B (6B active)147.7128.3110.189.9Official Hugging Face model card: 125B backbone with 6B activated parameters, plus a 51B n-gram embedding table and a 4B multi-token prediction (MTP) module; Hugging Face lists the combined checkpoint as 180B params. params_b=180 is the combined listing; active_b=6 is the activated backbone count.
Nemotron 3.5 Lightning 30B-A3B30B (3B active)24.621.418.415.030B total / 3B active MoE (hybrid Mamba), per DGX Spark benchmark table
Flint 40B-A2.5B39.8B (2.5B active)32.728.424.319.939.8B total / ~2.5B active MoE coding model (Recursive, Apache 2.0), per Hugging Face model card
GLM-5.3 Flash320B (18B active)262.5228.1195.8159.8Z.ai model card: 320B total, 18B active (Hugging Face lists 321B)
Ornith 1.5 122B125.1B (10B active)102.689.276.562.5Hugging Face: 125B incl. vision tower + MTP layer (122B language model, 10B active per halt95/Ornith-1.5-122B-A10B card)
DeepSeek V4.1 Flash748.6B (16B active)614.2533.7458.0373.9vLLM recipe: 552B backbone + 196.6B Engram tables, 16B active per output token; official MXFP4/FP8 checkpoint ~511 GB
GLM-5.2753.3B618.0537.1460.9376.3Hugging Face safetensors total: 753.3B parameters (MoE; the model card does not state the active count)
Ornith 1.5 35B-A3B35.95B (3B active)29.525.622.018.0Hugging Face safetensors total: 35.95B; model card: activates ~3B parameters per token
MiniMax M3428B (23B active)351.1305.1261.9213.8Hugging Face model card: ~428B total, ~23B activated
MiniMax M3.1 Flash428B (23B active)351.1305.1261.9213.8Hugging Face model card: ~428B total, 23B activated per token (quantization-aware trained)
Kolibri-178.1B (3.46B active)64.155.747.839.0Aleph Alpha model card: 78,103,074,560 total, 3,457,573,120 active per token
Step 5 Preview600B (27B active)492.2427.8367.1299.7StepFun model card: 600B total, 27B active (MoE)
Mellum 2.1 12B-A2.5B12B (2.5B active)9.88.67.36.012B total / 2.5B active per the model name (JetBrains Mellum 2.1)
Ling 3.0 Flash124B (5.1B active)101.788.475.961.9inclusionAI model card: 124B total, 5.1B activated (Hugging Face safetensors total 127.5B)
MiMo V2.6 Flash309B (15B active)253.5220.3189.0154.3Xiaomi MiMo model card: sparse MoE, 309B total / 15B activated

gpt-oss ships natively in MXFP4; OpenAI's card says gpt-oss-120b runs on a single 80 GB GPU and gpt-oss-20b within 16 GB of memory.

FAQ

Can I run gpt-oss 120B on 4x RTX 3090?

Yes, by our estimate: gpt-oss 120B in its native MXFP4 checkpoint (65 GB) needs about 65.0 GB for the weights plus 4.8 GB of KV cache at 128k context, 69.8 GB in total, against about 92.0 GB usable on 4× RTX 3090 (96 GB, minus ~1 GB overhead per card). This is arithmetic, not a measurement; check the measured builds linked on the page. gpt-oss uses sliding-window attention on half its layers, which keeps the KV cache small.

Can I run Qwen3 32B on one RTX 3090 at 32k context?

Not fully, by our estimate: Qwen3 32B in Q4_K_M needs about 20.0 GB for the weights plus 8.6 GB of KV cache at 32k context, 28.6 GB in total, against about 23.0 GB usable on one RTX 3090. This is arithmetic, not a measurement; check the measured builds linked on the page. With the KV cache quantized to q4_0 it needs about 22.5 GB, which fits; with FP16 KV the largest context that fits is about 11k tokens.

Can two DGX Sparks run a ~200B model?

Yes, by our estimate: Qwen3.8 Flash-Next in NVFP4 needs about 101.2 GB for the weights plus 3.2 GB of KV cache at 128k context, 104.5 GB in total, against about 238.0 GB usable on 2× DGX Spark (2 × 128 GB, minus ~9 GB per node for OS and runtime). This is arithmetic, not a measurement; check the measured builds linked on the page. NVIDIA says up to four Sparks can be linked over ConnectX-7.

How do I calculate KV cache size?

KV cache bytes = 2 (keys and values) × attention layers × KV heads × head dimension × context tokens × concurrent sequences × bytes per value (FP16 = 2, FP8 = 1, q8_0 ≈ 1.06, q4_0 ≈ 0.56). Read layers, num_key_value_heads and head_dim from the model's config.json. Example: Llama 3.3 70B has 80 layers, 8 KV heads and head_dim 128, so one token costs 2 × 80 × 8 × 128 × 2 B = 327,680 bytes (0.33 MB), and 32k tokens cost 10.7 GB. Sliding-window layers only store their window; linear-attention and Mamba layers keep a fixed-size state.

How much VRAM does an NVFP4 model need?

NVFP4 stores 4-bit values with one FP8 scale per 16 values, about 4.5 bits per weight, so weights take roughly parameters × 0.5625 GB per billion: a 120B model is about 67.5 GB before KV cache. It is about 3.5× smaller than FP16 and 1.8× smaller than FP8 (NVIDIA). It runs natively only on Blackwell GPUs; vLLM falls back to slower weight-only kernels elsewhere.

Which quant should I use?

Q4_K_M (GGUF) or AWQ / GPTQ 4-bit (vLLM) is the usual sweet spot of size and quality. Use Q5_K_M or Q6_K if you have the room, and Q8_0 or FP8 when you want near-lossless output. We do not recommend going below about 4 bits per weight (Q3, Q2) unless nothing else fits, because quality drops faster there.

Does system RAM matter for running local LLMs?

Only if the model does not fit in VRAM. When weights and KV cache sit fully on the GPUs, system RAM just holds the OS and the inference engine and loads the weights once; llama.cpp memory-maps the file, so RAM can be smaller than the model. RAM size and speed matter when you offload layers or MoE experts to the CPU.

Tensor parallel or pipeline parallel?

Tensor parallel (vLLM -tp) splits every layer across GPUs so they work on each token together: faster, but it needs the head count to divide by the GPU count (2, 4, 8 are usual) and good interconnect. Pipeline / layer split (llama.cpp default, vLLM -pp) gives each GPU a block of layers: any GPU count works and it needs little bandwidth, but one stream uses one GPU at a time.

Architecture values come from each model's Hugging Face config.json (linked in the calculator). Everything marked estimate is arithmetic, not a benchmark. Spotted a wrong value? Tell us.