LLM Memory Calculator

Will this model run on my machine? Pick a model and a quantization, set your context length, and enter how much RAM (for CPU) or VRAM (for a GPU) you have. The calculator adds up weights, KV cache and runtime overhead and tells you whether it fits.

Model

Architecture (edit for any model)

You'll find these in the model's config.json: num_hidden_layers, num_key_value_heads, and head_dim (or hidden_size divided by num_attention_heads).

GGUF names (Q4_K_M and so on) are what llama.cpp, Ollama and LM Studio use. Bits per weight are averages.

Workload

Prompt plus answer. Longer context means a bigger KV cache.

Your hardware

Run on

Result

–
  • Model weights–
  • KV cache–
  • Runtime overhead–
  • Left for everything else–

What to expect

Rough generation speed–
Longest context that fits–

Speed is an upper bound: generating each token reads every weight once, so tokens per second ≈ bandwidth ÷ model size. Real numbers are usually 50–80% of this.

Same model, other quantizations

QuantizationTotalSpeedFits?

How the numbers are calculated