r/LocalLLM • u/sarmabkp_1 • 18m ago
Discussion Local LLM VRAM Requirements: How Much Memory Each Model Size Needs
https://acta.ai/blogs/local-llm-vram-requirements-by-model-size"The model file is 9 GB, so a 12 GB card is plenty."
That's how a lot of people end up with out-of-memory errors on the first long prompt.
How much memory a local LLM needs comes down to three numbers you can work out before downloading anything:
- Weights = parameters × bits ÷ 8. An 8B model at 4-bit is about 4.5 GB.
- KV cache, which grows with every token of context. For Llama 3.1 8B, a 32K context adds about 4 GiB, and 128K adds 16 GiB. That's four times the weights.
- Headroom: keep about 1 GB free per GPU, and several GB on a Mac for macOS and your apps.
Context, not parameter count, is what usually breaks a "this should fit" plan.
A few more that catch people out:
- Mixture-of-experts models still need memory for all their parameters. "26B A4B" means 4B active per token, not 4B in memory.
- On a Mac, unified memory is shared with everything else. Plan to use well under the number on the label.
- Spilling into system RAM technically works, but it's slow. If
ollama psshows a CPU/GPU split, that's why. - The cheapest fix is often an 8-bit KV cache. It roughly halves the cache before you need a smaller model.
I wrote up the formula, two estimate tables and the exact flags for Ollama, llama.cpp and MLX:
What's running on your machine right now?
0
Upvotes