How We Calculate LLM Memory and Speed
Last reviewed
Every requirement on PublicAIHub comes from one fit engine. This page explains what it calculates, the assumptions it makes, and where the model data comes from, so you can check any number yourself.
What the engine calculates
For a model, a quantization and a conversation length, it adds three parts:
- Weights: parameters × bits per weight ÷ 8. Q4_K_M uses about 4.85 bits per weight, Q8_0 about 8.5 and F16 16.
- KV cache: 2 × layers × KV heads × head size × tokens × 2 bytes (F16). For models where some layers only look at a short window (Gemma 3, gpt-oss, OLMo 3), those layers are counted at the window size, not the full conversation.
- Runtime overhead: about 0.6 GB for the GPU context and compute buffers.
How much memory a device gives a model
- NVIDIA, AMD and Intel GPUs: 95% of VRAM; the rest is kept for the driver and display.
- Apple Silicon Macs: macOS lets the GPU use about two thirds of memory up to 36 GB, and about three quarters above that, unless you raise the limit yourself.
A model fits when it uses up to 90% of that memory, is tight between 90% and 100%, and offloads when part of it has to run from system RAM.
Speed estimates
Generating text is limited mainly by memory bandwidth: every new token reads the model's active weights once. We divide the device's bandwidth by the bytes read per token and apply a real-world efficiency factor. For mixture-of-experts models we count only the active parameters. These are estimates; measured benchmarks replace them when available.
Defaults
Unless you change them in the calculator, pages assume Q4_K_M and an 8,000-token conversation, which matches how most people run models in Ollama and LM Studio.
Where the model data comes from
Layer counts, KV heads, head sizes and context lengths are taken from each model's official config.json and model card on Hugging Face. Licences come from the official model card. Ollama tags are checked against the Ollama library, including which build each tag points to, because short tags such as qwen3:30b are sometimes moved to newer models.
Keeping it current
Each page shows when it was last reviewed. We re-check tags, licences and specs when a model or device changes, and correct errors as soon as we find them.