Ollama Model Sizes 2026: How Much RAM Does Each Model Really Need
Downloaded a model and your machine froze? Model file size vs RAM - here's the math that prevents the swap-death spiral.
💡 What You Will Learn
Downloaded a model and your machine froze? Model file size vs RAM - here's the math that prevents the swap-death spiral.
📜 Table of Contents
The Swap-Death Spiral
You pull a 40GB model on a 16GB machine, the OS starts swapping, and everything freezes - the classic local-LLM failure. The fix is a simple budget: model file size + runtime overhead must fit in RAM/VRAM, with headroom for your OS and apps.
The Size Math
A model's file size is roughly: parameters x bits per weight / 8. A 7B model at 4-bit quantization is ~4-5GB. At 8-bit (fp16-ish) it doubles. That's why quantization exists: q4 gives you a 4.9GB Llama 8B instead of 16GB.
The Practical Budget
Rule of thumb: your machine needs model_size + 1GB overhead, and ideally 2x RAM headroom total (OS + browser + editor still need memory).
| Machine RAM | Safe max model | Examples |
|---|---|---|
| 8GB | 4-6GB file | Gemma 2B, Qwen 7B q4 |
| 16GB | 7-10GB file | Llama 8B, Qwen 14B q4 |
| 32GB | 16-24GB file | Qwen 32B q4, Llama 70B q3 |
| 64GB | 35-48GB file | Llama 70B q4, Qwen 72B q4 |
How to Check Before You Pull
# show model file sizes without downloading
ollama show <model> --modelfile | head -20
# or check the library page: the 'size' shown is the q4 file
ollama list # after pulling, shows installed sizes
VRAM vs System RAM
- GPU (VRAM): fastest; the whole model should fit in VRAM for good speed.
- CPU (system RAM): slower but works; Ollama offloads layers to GPU if any.
- Mixed: Ollama puts as many layers on GPU as fit, rest on CPU - usable but slower.
The Upgrades That Actually Help
- More RAM > more VRAM for CPU inference; 32GB system RAM unlocks 32B models.
- Quantization: q4_K_M is the quality/size sweet spot; q8 if you have room.
- Context length: big context (32k+) multiplies memory use - reduce it on small machines.
FAQ
Why did my PC freeze? The model + overhead exceeded RAM and the OS swapped to disk - hard. Reduce model size or context.
What does q4 vs q8 mean for quality? q8 is closer to full precision (better quality, 2x size); q4 is the standard tradeoff.
Can I run a 70B on 16GB? Only heavily quantized (q2-q3) and slowly - not recommended.
Does context length affect memory? Yes - KV cache grows with context; 128k context on a small machine will OOM. Keep it modest.
