LLM RAM & VRAM Split Calculator

Your model is bigger than your GPU - so where does each piece go? This calculator plans the split between GPU VRAM and system RAM: which transformer layers are offloaded to the CPU, whether the KV cache and runtime overhead still fit on each tier, what generation speed you can expect from the two memory bandwidths, and the exact --n-gpu-layers command to run it. Pick a model, set your context and hardware, get the plan.

Private by design. Every calculation happens in your browser with JavaScript. Your model choices, hardware details and plans never leave this page - nothing is uploaded, logged, or stored.

1 · Model

Pick a preset (real published architecture values) or enter your own. KV heads and head dimension come from the model's config.json (num_key_value_heads, hidden_size ÷ num_attention_heads) - they set the KV cache size.

MoE only: parameters read per token (e.g. 3.3 for Qwen3 30B A3B). Blank for dense models.

2 · Quantization & context

Weights use the conservative (high) end of the GGUF size range so the plan is safe. The KV cache grows linearly with context length and sequence count.

3 · Your hardware

The GPU preset fills in typical VRAM and memory bandwidth (both editable). Bandwidth drives the speed estimate: token generation is mostly reading weights from memory.

Split plan

What lives on each tier at the recommended split. VRAM is checked against 92% of your total (driver and display reserve); RAM against what you said is free.

TierLayersWeightsKV cacheOverheadTotalStatus

Which quantization fits GPU-only?

Every quant level at your current context length and hardware, with the plan it would produce. The selected row is highlighted.

QuantWeightsTotal footprintPlanEst. speed

Run it

Ready-to-run commands for the recommended split. --n-gpu-layers N offloads the last N layers to the GPU (llama.cpp convention); Ollama's num_gpu takes the same number.

Why split a model between GPU and RAM

Most local LLMs do not fit entirely in one GPU, but that does not mean they cannot run. llama.cpp, Ollama and LM Studio all support partial offloading: the transformer is split layer by layer, some layers execute on the GPU with their weights in VRAM, and the rest execute on the CPU with their weights in system RAM. The model still produces identical output - the split changes only speed. Getting the split right matters because the cost is not linear. A GPU memory bus typically moves 300-1000 GB/s while dual-channel DDR4 manages around 40 GB/s, so a layer that costs a fraction of a millisecond in VRAM costs several milliseconds in RAM. The question is never "can I run it?" but "how many layers can I keep fast, and what does the rest cost me per token?" This calculator answers both: it finds the largest split that fits your two memory pools and prices it in estimated tokens per second.

How the split is calculated

Three components make up the footprint. Weights are total parameters times the quantization's bits per weight, using the high end of the size range (nominal bits plus scale-metadata overhead) so the plan does not run out of room at load time. The KV cache is sized from the model's real architecture: 2 × layers × KV heads × head dimension × bytes-per-element, per token, multiplied by your context length and sequence count - grouped-query models with few KV heads (Llama 3.1, Qwen2.5) grow much more slowly than multi-head ones. Runtime overhead covers the framework's compute buffers, CUDA context and working memory: roughly half a gigabyte for llama.cpp, a bit more for Ollama or LM Studio, and over a gigabyte for vLLM or Transformers. The fit check is conservative in two ways: only 92% of your VRAM is treated as usable (the driver reserves the rest, and a Windows desktop display eats some too), and RAM is checked against what you declared free, not what the machine owns. If everything fits in VRAM, the plan is GPU-only. Otherwise the calculator walks the layer count down from the top until the GPU tier (its share of weights, plus the KV cache if it stays on the GPU, plus overhead) fits in usable VRAM while the CPU tier (the remaining weights, plus the KV cache if moved) fits in free RAM - that is your --n-gpu-layers value. The speed estimate is bandwidth math: each generated token reads every active weight once, so time per token is the GPU-resident bytes divided by GPU bandwidth plus the CPU-resident bytes divided by RAM bandwidth. For MoE models only the active parameters are read per token, which is why a 30B A3B model can generate quickly even when its full weights are split.

How to use this calculator

  1. Pick your model from the preset list - the presets carry real layer counts, KV head counts and head dimensions, which is what makes the KV estimate trustworthy. For a custom model, read those three values from the model card's config.json. For MoE models, also enter the active parameter count: it sets the speed, while the total sets the memory.
  2. Choose the quantization and context length you actually intend to run. Context is the silent budget killer - 128k of F16 KV cache on a large model can outweigh the weights themselves. If you are not sure what precision your server will use, Q8_0 KV is the safe default: half the size of F16 with negligible quality loss.
  3. Select your GPU preset (it fills in typical VRAM and bandwidth) and enter how much system RAM you can actually give the process. On a Windows desktop, leave room for the OS and display; on Apple Silicon the "GPU" and "RAM" are the same pool, so treat VRAM as the slice macOS allows the GPU and RAM as the rest.
  4. Read the verdict first: GPU-only means no offloading at all; mixed tells you exactly how many layers stay fast; CPU-only means this configuration will be slow and the quantization ladder below shows which level would change that. The stacked bars show what fills each tier, and a red hatched segment means a tier is exceeded.
  5. Compare the estimated speed with the GPU-only figure in the verdict card to see what offloading costs you per token. If the number is disappointing, the ladder shows the quantization that would fit GPU-only at your context length - or shorten the context, which shrinks the KV cache linearly.
  6. Take the plan with you: copy the report as text, download the CSV with the tier breakdown and the full quantization ladder, or copy the share link so someone else can review the same setup.

A worked example: Qwen2.5 32B on a 12 GB card with 32 GB of RAM

Qwen2.5 32B has 32.8 billion parameters across 64 layers with 8 KV heads and 128-dimensional heads. At Q4_K_M the weights land near 19 GB (the conservative end), and an 8k context of F16 KV cache adds about 2.2 GB, plus 0.5 GB of llama.cpp overhead - a 21.7 GB total against a 12 GB card. GPU-only is out. The calculator walks the split down: with the KV cache staying on the GPU, roughly 28 of 64 layers fit in the usable VRAM alongside it, and the remaining 36 layers (about 10.5 GB) sit comfortably in free RAM. The speed estimate blends both tiers: the GPU portion of each token reads at ~360 GB/s but the CPU portion crawls at ~40 GB/s, landing near 3-4 tokens per second - usable for chat, painful for long generations. The ladder then does the interesting work: it shows that Q3_K_M brings the weights down far enough for a much larger GPU share, and that dropping to Q2_K or shortening context to 4k with Q8_0 KV can recover a full GPU-only run at ~15 tokens per second on the same card. Same model, same hardware - three different experiences, decided by one number in the command line.

Common mistakes when planning a split

  • Forgetting the KV cache entirely. The weights fit, the server starts, and then it crashes or silently offloads at runtime because the context's KV cache has nowhere to go. The cache is not a rounding error: at long contexts on large models it exceeds the weights. Budget it explicitly, and quantize it (Q8_0 halves it for almost nothing).
  • Assuming RAM speed is "close enough" to VRAM speed. A 9× bandwidth gap means every offloaded layer costs 9× longer per token than the same layer in VRAM. A split that looks like "only 40% on CPU" can still halve your throughput, because the slow tier is on the critical path of every single token.
  • Mixing MoE total and active parameters. Capacity scales with total parameters (all experts must be stored); speed scales with active parameters (only the routed experts are read per token). Entering the total into the speed math overstates how slow a MoE model will feel; entering the active count into the memory math underestimates what you need to store.
  • Planning against 100% of your VRAM. Drivers reserve memory before your process even starts, and on Windows the desktop compositor holds a share. A plan that fits at 100% fails at load time; this calculator checks against 92% for exactly that reason.
  • Judging the split by prompt speed instead of generation speed. Prefill is compute-bound, so offloading layers hits prompt processing much harder than it hits token generation. If your workload is long-document summarization rather than chat, weight the CPU tier's cost more heavily than the tok/s figure suggests.

Privacy

This tool is entirely client-side. The split math, the bandwidth estimates and the command generation all run in JavaScript inside your own browser tab, so nothing you enter touches a server. There is no account, no tracking of your inputs, and no data retention - close the tab and everything is gone.

Related tools

Once the split is planned, the rest of the local-LLM sizing workflow:


Luke Keam
Spot a bug or want a custom utility built? I'd love to hear from you. Get in touch
Luke Keam | techgeek.biz