Best Ollama Models for 8GB, 12GB, 16GB & 24GB VRAM (Full Table)
Want to go deeper than this article?
Free account unlocks the first chapter of all 25 courses — RAG, agents, MCP, voice AI, MLOps, real GitHub repos.
Ollama’s running. Here’s what to build with it. Go from “ollama run” to RAG apps, agents, and fine-tuned models — structured and hands-on. First chapter free.
Published on April 11, 2026 · Updated September 2026 · 19 min read
Quick answer: the best Ollama models by GPU are Llama 3.1 8B for 8GB VRAM (Qwen 2.5 Coder 7B if you code), Qwen 2.5 14B for 12GB, Gemma 3 27B for 16GB, and Qwen 2.5 32B — or the much faster MoE Qwen 3 30B-A3B — for 24GB. Here is the RAM/VRAM each popular model needs at Q4_K_M (the default quant), plus the minimum GPU/unified memory to load it fully on-GPU. Full per-family tables and bandwidth-derived throughput ceilings are further down.
| Model | Q4_K_M size | Min VRAM | Fits on |
|---|---|---|---|
| Llama 3.2 1B | 0.8GB | 2GB | Any GPU / phone-class |
| Llama 3.2 3B | 1.9GB | 3GB | 4GB GPU |
| Llama 3.1 8B | 4.9GB | 6GB | 8GB GPU |
| Qwen 2.5 7B | 4.4GB | 5.5GB | 8GB GPU |
| Qwen 2.5 Coder 7B | 4.4GB | 5.5GB | 8GB GPU |
| Gemma 3 12B | 7.3GB | 8.5GB | 12GB GPU |
| Qwen 2.5 14B | 8.7GB | 10GB | 12GB GPU |
| Gemma 3 27B | 15.9GB | 17GB | 16GB GPU (tight) / 24GB |
| Qwen 2.5 32B | 18.8GB | 20GB | 24GB GPU |
| Qwen 2.5 Coder 32B | 18.8GB | 20GB | 24GB GPU |
| Llama 3.3 70B | 40.0GB | 42GB | 48GB+ unified / dual 24GB |
| Llama 3.1 405B | 229.0GB | 232GB | Multi-GPU server |
Rule of thumb: min VRAM ≈ the Q4_K_M file size + ~1–1.5GB overhead (KV cache at 2K context). Best pick for 6GB: a 3–4B at Q4 (laptop GPUs); 8GB: Llama 3.1 8B (general) or Qwen 2.5 Coder 7B (code); 12GB: a 14B at Q4; 16GB: Gemma 3 27B Q4_K_M; 24GB: Qwen 2.5 32B Q4_K_M; 32GB: a 32B at Q5/Q6 with full context on an RTX 5090. Each of those links ranks the full shortlist for that card. RAM vs VRAM: models run fastest fully in VRAM; if they spill to system RAM, expect 2–10× slower generation.
Want the math done for a specific model and context length? Plug your numbers into our interactive VRAM calculator. For the full picture on CPU, disk, and OS-level needs beyond raw model size, see the Ollama system requirements guide, and for task-by-task picks rather than raw sizing, see best Ollama models. If you'd rather have hardware matched to a model for you than work it out from a table, the local model picker course walks through that decision step by step.
This page exists so you never have to google "how much VRAM does Llama 70B need" again. It collects the published Q4/Q5/FP16 file size for every popular Ollama model, the minimum memory to load it fully on-GPU, and the throughput ceiling that each model's size imposes on three common machines.
On the throughput numbers: we do not own an RTX 3060, an RTX 4090 or an M4 Max, and none of the figures below were timed on one. Every tok/s column is an arithmetic ceiling — published memory bandwidth divided by the model's weight size — and is labelled as such. That is a genuinely useful number, because it is the speed the hardware physically cannot exceed. It is not a prediction of what you will see.
Bookmark this page. Sizes and ceilings both move only when a model or a card changes, so it stays correct far longer than a benchmark run would.
How to Read This Table
Each model entry includes:
- Q4_K_M size — 4-bit quantization, the sweet spot for most users (minimal quality loss, biggest memory savings)
- Q5_K_M size — 5-bit quantization, slightly better quality, ~20% more memory
- FP16 size — Full precision, maximum quality, 2x memory vs Q4
- Min VRAM — The minimum VRAM needed to load the Q4_K_M version entirely on GPU (includes ~1GB overhead for KV cache at 2K context)
- 3060 ceiling — Arithmetic throughput ceiling on an RTX 3060 12GB (entry-level AI GPU)
- 4090 ceiling — Arithmetic throughput ceiling on an RTX 4090 24GB (high-end consumer)
- M4 Max ceiling — Arithmetic throughput ceiling on an Apple M4 Max with 48GB unified memory
Where the ceiling numbers come from
Generating one token requires reading the entire weight set out of memory exactly once. That makes decoding memory-bandwidth bound, and it gives a hard upper limit that needs no benchmarking at all:
Ceiling (tok/s) = memory bandwidth (GB/s) ÷ model file size (GB)
The three reference machines, using each vendor's published bandwidth: RTX 3060 12GB — 360 GB/s, RTX 4090 — 1008 GB/s, Apple M4 Max — 546 GB/s. A dash means the model does not fit that machine's memory, so it would offload to CPU and the ceiling no longer applies.
Three caveats, and they matter:
- A ceiling is not a measurement. Real output lands below it — often well below — once sampling, attention over a growing KV cache, and runtime overhead are counted. Use the ceiling to rule things out, not to predict a number.
- At roughly 2GB of weights or less the ceiling stops being the binding constraint (marked ‡ in the tables). The four-digit figures on the 1B rows are arithmetically correct and practically meaningless: at that size, kernel launch overhead and sampling dominate long before bandwidth does. Read those rows as "bandwidth is not your problem here".
- MoE models break the formula (marked † in the tables). A Mixture-of-Experts model only activates a fraction of its weights per token, so bytes moved per token are far below the file size. Those rows carry an explanation rather than a number.
Because the ceiling depends only on published bandwidth and published file sizes, it does not drift between Ollama point releases the way a benchmark does. Ollama's latest stable release as of this September 2026 refresh is v0.34.0 — see the Ollama version history for what changed, or the Ollama system requirements guide for install sizes and hardware floors.
Reading articles is good. Building is better.
Free account = the first chapter of all 25 courses, with a per-chapter AI tutor. No card.
Llama 3.x Family
The workhorse family. Meta's Llama models are the most-used open-weight models for good reason — strong quality across the board.
| Model | Params | Q4_K_M | Q5_K_M | FP16 | Min VRAM | 3060 ceiling | 4090 ceiling | M4 Max ceiling |
|---|---|---|---|---|---|---|---|---|
| Llama 3.2 1B | 1.24B | 0.8GB | 0.9GB | 2.5GB | 2GB | 450‡ | 1260‡ | 680‡ |
| Llama 3.2 3B | 3.21B | 1.9GB | 2.3GB | 6.4GB | 3GB | 190‡ | 530‡ | 290‡ |
| Llama 3.1 8B | 8.03B | 4.9GB | 5.7GB | 16.1GB | 6GB | 73 | 205 | 110 |
| Llama 3.3 70B | 70.6B | 40.0GB | 48.0GB | 141.0GB | 42GB | — | — | 14 |
| Llama 3.1 405B | 405B | 229.0GB | 275.0GB | 810.0GB | 232GB | — | — | — |
‡ At roughly 2GB of weights or less, bandwidth stops being the binding constraint — see caveat 2 above.
Notes:
- Llama 3.1 8B is the single most popular Ollama model. It fits on any 8GB GPU with room to spare.
- Llama 3.3 70B at Q4_K_M needs 42GB — runs on M4 Max 48GB or dual 24GB GPUs. Does not fit on a single RTX 4090.
- Llama 3.1 405B is impractical for consumer hardware. Included for completeness. Requires 4x A100 80GB or equivalent.
# Pull Llama models
ollama pull llama3.2:1b
ollama pull llama3.2:3b
ollama pull llama3.2 # defaults to 8B Q4_K_M
ollama pull llama3.3:70b-instruct-q4_K_M
How Much VRAM Does Llama 4 Need?
Meta's Llama 4 generation is built on Mixture-of-Experts (MoE), so the memory math is different from the dense Llama 3.x models above. You still have to fit every expert weight in memory (so the file is large), but only a fraction of parameters activate per token (so it runs faster than a dense model of the same total size). This is the single most common point of confusion people hit when sizing hardware for Llama 4.
| Model | Total / Active params | Q4_K_M | Min VRAM | Fits on |
|---|---|---|---|---|
| Llama 4 Scout | 109B / 17B active | 67GB (Ollama library) | ~68GB | 80GB+ unified / multi-GPU 80GB+ combined / H100 80GB |
| Llama 4 Maverick | 400B / 17B active | ~210–230GB | ~230GB | Multi-GPU server only |
Notes:
- Llama 4 Scout is the smallest Llama 4 and still needs 67GB at Q4_K_M (per the Ollama library) because all 16 experts must be resident. It does not fit a single 24GB consumer GPU — plan on an 80GB+ Apple Silicon machine, a multi-GPU rig with 80GB+ combined VRAM (dual RTX 5090s' 64GB combined is not quite enough), or a data-center card. Once loaded, it generates at the speed of a ~17B dense model thanks to MoE routing.
- Llama 4 Maverick is firmly server-class. Treat it like the 405B entry in the table: included for completeness, not for a desktop.
- If Llama 4 is out of reach, a Q4_K_M Llama 3.3 70B (40GB) on 48GB Apple Silicon remains the most accessible top-tier Llama for local use. Verify the exact tag and size against the official Ollama library before pulling, since MoE quant sizes vary by release.
Qwen 2.5 / Qwen 3 Family
Alibaba's Qwen models punch above their weight on code, math, and multilingual tasks. Qwen 2.5 Coder is the best local coding model at every size.
| Model | Params | Q4_K_M | Q5_K_M | FP16 | Min VRAM | 3060 ceiling | 4090 ceiling | M4 Max ceiling |
|---|---|---|---|---|---|---|---|---|
| Qwen 2.5 0.5B | 0.49B | 0.4GB | 0.5GB | 1.0GB | 1.5GB | 900‡ | 2520‡ | 1370‡ |
| Qwen 2.5 1.5B | 1.54B | 1.0GB | 1.2GB | 3.1GB | 2GB | 360‡ | 1010‡ | 550‡ |
| Qwen 2.5 3B | 3.09B | 1.9GB | 2.2GB | 6.2GB | 3GB | 190‡ | 530‡ | 290‡ |
| Qwen 2.5 7B | 7.62B | 4.4GB | 5.2GB | 15.2GB | 5.5GB | 82 | 230 | 125 |
| Qwen 2.5 14B | 14.8B | 8.7GB | 10.3GB | 29.5GB | 10GB | 41 | 115 | 63 |
| Qwen 2.5 32B | 32.5B | 18.8GB | 22.5GB | 65.0GB | 20GB | — | 54 | 29 |
| Qwen 2.5 72B | 72.7B | 42.0GB | 50.0GB | 145.0GB | 44GB | — | — | 13 |
| Qwen 3 8B | 8.2B | 5.0GB | 5.9GB | 16.4GB | 6.5GB | 72 | 200 | 110 |
| Qwen 3 14B | 14.8B | ~9.0GB | 10.6GB | 29.6GB | 10.5GB | 40 | 110 | 61 |
| Qwen 3 30B-A3B (MoE) | 30.5B / 3.3B active | 19GB | — | 61.0GB | ~20GB | — | MoE† | MoE† |
| Qwen 3 32B | 32.8B | 19.2GB | 23.0GB | 65.6GB | 21GB | — | 52 | 28 |
‡ At roughly 2GB of weights or less, bandwidth stops being the binding constraint — see caveat 2 above. † MoE: only ~3.3B of 30.5B parameters activate per token, so bytes moved per token are closer to a 2GB model than a 17GB one. The formula does not apply; expect throughput in the same neighbourhood as a small dense model.
Notes:
- Qwen 2.5 7B is the go-to if you want code+math strength on an 8GB GPU.
- Qwen 2.5 14B Q4_K_M at 8.7GB barely fits on a 12GB RTX 3060 — you get it running but context window is limited.
- Qwen 2.5 32B is the sweet spot for 24GB GPUs. Fits with room for a decent context window.
- Qwen 3 models use a hybrid thinking architecture (think/no-think modes). Slightly larger than Qwen 2.5 at the same parameter count.
- Qwen 3 30B-A3B is the standout for 24GB GPUs in 2026. It is a Mixture-of-Experts model: ~30B total params (Ollama's default
qwen3:30b-a3b/qwen3:30btag is 19GB, needing ~20GB to load — verified against the Ollama library September 2026), but only ~3.3B activate per token. That is the whole point — you pay 32B-class memory but move roughly a tenth of those bytes per token, so it generates like a small dense model rather than a 30B one. If you have the VRAM, it is often a better pick than the dense Qwen 3 32B for interactive use. - Qwen3.6 27B (
ollama pull qwen3.6:27b) is the newest dense pick for 24GB cards — 18GB per the Ollama library, which against the RTX 4090's 1008 GB/s puts the arithmetic ceiling near 56 tok/s. The Qwen3.6-27B guide has full specs, quant sizes and VRAM figures. If you want the whole Ollama workflow — install, model library, Modelfiles, GPU offload, serving — in one place, the Ollama Mastery course covers it; the first chapter is free with an account.
# Pull Qwen models
ollama pull qwen2.5:0.5b
ollama pull qwen2.5:7b
ollama pull qwen2.5:14b
ollama pull qwen2.5:32b
ollama pull qwen2.5:72b
ollama pull qwen3:8b
ollama pull qwen3:14b
ollama pull qwen3:30b-a3b # MoE, 19GB, fits 24GB
ollama pull qwen3:32b
Run this on your own machine and stop paying every month
Pay once and keep it. No renewal, no per-token bill, and nothing you feed it ever leaves your hardware.
Gemma 3 & Gemma 4 Family
Google's Gemma 3 models are surprisingly strong at small sizes. Gemma 3 4B punches way above its weight and is a top pick for constrained devices. The Gemma 4 generation landed in summer 2026 — Gemma 3 with published file sizes first, then the Gemma 4 planning estimates.
| Model | Params | Q4_K_M | Q5_K_M | FP16 | Min VRAM | 3060 ceiling | 4090 ceiling | M4 Max ceiling |
|---|---|---|---|---|---|---|---|---|
| Gemma 3 1B | 1.0B | 0.7GB | 0.8GB | 2.0GB | 2GB | 510‡ | 1440‡ | 780‡ |
| Gemma 3 4B | 3.9B | 2.5GB | 3.0GB | 7.8GB | 3.5GB | 145 | 400 | 220 |
| Gemma 3 12B | 12.2B | 7.3GB | 8.7GB | 24.4GB | 8.5GB | 49 | 140 | 75 |
| Gemma 3 27B | 27.2B | 15.9GB | 19.0GB | 54.4GB | 17GB | — | 63 | 34 |
‡ At roughly 2GB of weights or less, bandwidth stops being the binding constraint — see caveat 2 above.
Notes:
- Gemma 3 4B at 2.5GB Q4_K_M is excellent for Raspberry Pi 5 (8GB) or old laptops.
- Gemma 3 12B is a strong 12GB GPU choice, rivaling models twice its size on instruction following.
- Gemma 3 27B fits on a single RTX 4090 (24GB) at Q4_K_M with tight context, or comfortably on 32GB Apple Silicon.
# Pull Gemma models
ollama pull gemma3:1b
ollama pull gemma3:4b
ollama pull gemma3:12b
ollama pull gemma3:27b
Gemma 4 (Summer 2026)
Gemma 4 has since shipped on Ollama with published sizes: the 12B Unified is a 7.6GB download, so a 12GB card runs it comfortably, and both the 26B MoE and the 31B dense flagship fit a single 24GB card. The whole family ships under Apache 2.0. Sizes below are the exact download sizes from the Ollama library (checked September 2026), not estimates — no ceiling column because per-chip bandwidth still varies too much to generalize.
| Model | Params | Size (Ollama default tag) | Min VRAM | Fits on |
|---|---|---|---|---|
| Gemma 4 12B Unified | 12B (text+image, 256K ctx) | 7.6GB | ~9GB | 12GB GPU (8GB only with short context) |
| Gemma 4 26B | 26B MoE, ~3.8B active | 19GB | ~20GB | 24GB GPU |
| Gemma 4 31B | 31B dense | 20GB | ~21GB | 24GB GPU |
Notes:
- The E2B and E4B members are not as tiny as their names suggest: Ollama's default
gemma4:e2btag is 7.2GB andgemma4:e4bis 9.6GB, because the effective-parameter count excludes the multimodal embeddings that still have to be resident. Plan on an 8GB+ GPU or 16GB Mac for either, not a phone-class device — see the Ollama system requirements guide for the full 2026-model memory table. - The 12B Unified handles text and images in one model with a 256K context. Long context costs VRAM on top of the weights, so treat 12-16GB as the practical floor if you actually want that window.
- Check the current tags on the official Ollama library before pulling, and see our full Gemma 4 hardware guide for the tier-by-tier breakdown.
Phi-4 Family
Microsoft's Phi-4 models achieve remarkable reasoning for their size. Phi-4 3.8B consistently beats 7B models from other families on logic and math tasks.
| Model | Params | Q4_K_M | Q5_K_M | FP16 | Min VRAM | 3060 ceiling | 4090 ceiling | M4 Max ceiling |
|---|---|---|---|---|---|---|---|---|
| Phi-4 Mini (3.8B) | 3.82B | 2.3GB | 2.8GB | 7.6GB | 3.5GB | 155 | 440 | 235 |
| Phi-4 (14B) | 14.0B | 8.2GB | 9.8GB | 28.0GB | 9.5GB | 44 | 125 | 67 |
Notes:
- Phi-4 Mini at 2.3GB Q4_K_M is the best reasoning model you can fit on a 4GB GPU.
- Phi-4 14B needs a 12GB GPU minimum. Performance is excellent for code review and analytical tasks.
# Pull Phi models
ollama pull phi4-mini # 3.8B
ollama pull phi4 # 14B
Mistral / Mixtral Family
Mistral's models and their Mixture-of-Experts (MoE) Mixtral variants. MoE models use more disk space but activate only a fraction of parameters per token, giving better quality per FLOP.
| Model | Params | Q4_K_M | Q5_K_M | FP16 | Min VRAM | 3060 ceiling | 4090 ceiling | M4 Max ceiling |
|---|---|---|---|---|---|---|---|---|
| Mistral 7B v0.3 | 7.25B | 4.4GB | 5.1GB | 14.5GB | 5.5GB | 82 | 230 | 125 |
| Mistral Small 24B | 24.0B | 14.0GB | 16.8GB | 48.0GB | 15.5GB | — | 72 | 39 |
| Mixtral 8x7B | 46.7B (12.9B active) | 26.4GB | 31.7GB | 93.4GB | 28GB | — | — | MoE† |
| Mixtral 8x22B | 176B (39B active) | 80.0GB | 96.0GB | 352.0GB | 82GB | — | — | — |
† MoE: only 12.9B of 46.7B parameters activate per token, so roughly 7.3GB moves per token rather than the full 26.4GB. Against the M4 Max's 546 GB/s that is a ceiling near 75 tok/s rather than 21 — the file size overstates the work.
Notes:
- Mistral 7B is a solid all-rounder, competitive with Llama 3.1 8B. Slightly smaller file size.
- Mixtral 8x7B has 46.7B total params but only activates 12.9B per token. Needs 28GB VRAM to hold, but moves roughly a quarter of that per token, so it generates like a ~13B model. Quality approaches 70B dense models.
- Mixtral 8x22B is a server-class model. 80GB minimum VRAM. Requires A100 80GB or multi-GPU.
# Pull Mistral/Mixtral models
ollama pull mistral # 7B
ollama pull mistral-small # 24B
ollama pull mixtral # 8x7B
DeepSeek R1 Distills
DeepSeek's R1 reasoning model distilled into smaller architectures. These models "think" step-by-step and show their reasoning chain.
| Model | Base | Q4_K_M | Q5_K_M | FP16 | Min VRAM | 3060 ceiling | 4090 ceiling | M4 Max ceiling |
|---|---|---|---|---|---|---|---|---|
| DeepSeek R1 1.5B | Qwen 2.5 1.5B | 1.0GB | 1.2GB | 3.1GB | 2GB | 360‡ | 1010‡ | 550‡ |
| DeepSeek R1 7B | Qwen 2.5 7B | 4.4GB | 5.2GB | 15.2GB | 5.5GB | 82 | 230 | 125 |
| DeepSeek R1 8B | Llama 3.1 8B | 4.9GB | 5.7GB | 16.1GB | 6GB | 73 | 205 | 110 |
| DeepSeek R1 14B | Qwen 2.5 14B | 8.7GB | 10.3GB | 29.5GB | 10GB | 41 | 115 | 63 |
| DeepSeek R1 32B | Qwen 2.5 32B | 18.8GB | 22.5GB | 65.0GB | 20GB | — | 54 | 29 |
| DeepSeek R1 70B | Llama 3.3 70B | 40.0GB | 48.0GB | 141.0GB | 42GB | — | — | 14 |
‡ At roughly 2GB of weights or less, bandwidth stops being the binding constraint — see caveat 2 above.
Notes:
- R1 distills have the same VRAM requirements and the same ceilings as their base models (same architecture, same parameter count, same file size).
- The "thinking" tokens add output length, and the ceiling is per token — so a reasoning model at the same tok/s ceiling still takes longer to reach an answer. A simple question might generate 500+ reasoning tokens before the final answer. Budget accordingly.
- R1 7B on an 8GB GPU gives you step-by-step reasoning that rivals much larger non-reasoning models on math and logic.
# Pull DeepSeek R1 distills
ollama pull deepseek-r1:1.5b
ollama pull deepseek-r1:7b
ollama pull deepseek-r1:8b
ollama pull deepseek-r1:14b
ollama pull deepseek-r1:32b
ollama pull deepseek-r1:70b
Code Models
Specialized models for code generation, completion, and review. These are fine-tuned on code and perform better than general-purpose models on programming tasks.
| Model | Params | Q4_K_M | Q5_K_M | FP16 | Min VRAM | 3060 ceiling | 4090 ceiling | M4 Max ceiling |
|---|---|---|---|---|---|---|---|---|
| Qwen 2.5 Coder 1.5B | 1.54B | 1.0GB | 1.2GB | 3.1GB | 2GB | 360‡ | 1010‡ | 550‡ |
| Qwen 2.5 Coder 7B | 7.62B | 4.4GB | 5.2GB | 15.2GB | 5.5GB | 82 | 230 | 125 |
| Qwen 2.5 Coder 14B | 14.8B | 8.7GB | 10.3GB | 29.5GB | 10GB | 41 | 115 | 63 |
| Qwen 2.5 Coder 32B | 32.5B | 18.8GB | 22.5GB | 65.0GB | 20GB | — | 54 | 29 |
| Qwen3-Coder 30B (MoE) | 30.5B / ~3B active | 19GB | — | — | ~20GB | — | MoE† | — |
| CodeLlama 7B | 6.74B | 3.8GB | 4.5GB | 13.5GB | 5GB | 95 | 265 | 145 |
| CodeLlama 13B | 13.0B | 7.4GB | 8.8GB | 26.0GB | 8.5GB | 49 | 135 | 74 |
| CodeLlama 34B | 33.7B | 19.1GB | 22.8GB | 67.4GB | 20.5GB | — | 53 | 29 |
| StarCoder2 3B | 3.03B | 1.8GB | 2.2GB | 6.1GB | 3GB | 200‡ | 560‡ | 305‡ |
| StarCoder2 7B | 6.74B | 3.8GB | 4.5GB | 13.5GB | 5GB | 95 | 265 | 145 |
| StarCoder2 15B | 15.5B | 9.0GB | 10.8GB | 31.0GB | 10.5GB | 40 | 110 | 61 |
‡ At roughly 2GB of weights or less, bandwidth stops being the binding constraint — see caveat 2 above. † MoE: only ~3B of 30.5B parameters activate per token, so roughly 1.9GB moves per token rather than the full 19GB. The formula does not apply — expect small-dense-model throughput from a 32B-class model.
Notes:
- The Qwen 3 wave changed the coding pecking order. Qwen3-Coder 30B is an MoE with only ~3B params active per token, so it delivers 32B-class code while moving roughly a tenth of a dense 32B's bytes per token — that is where the speed advantage comes from, not from a smaller file. It also brings a 256K native context built for agent workflows. Qwen 2.5 Coder 32B is still the strongest dense coder and a fine choice if you already run it, but the MoE is the one to pull first. Full rankings in our best local coding models guide.
- Do not undersize Qwen3-Coder-Next (80B total, ~3B active) — it is a bigger MoE than it sounds. Ollama's default
qwen3-coder-nexttag is Q4_K_M at 52GB, so despite the small active-parameter count it needs a 64GB-class machine (dual GPU or a high-memory Apple Silicon Mac) to hold the full expert set resident, not a 16GB card. Check the current size on the Ollama library before planning hardware around it. - Qwen 2.5 Coder 7B is the best coding model for 8GB GPUs. Outperforms CodeLlama 13B despite being smaller.
- CodeLlama is aging but still widely used. If you are already using it, consider switching to Qwen 2.5 Coder at the same size.
- StarCoder2 excels at code completion (fill-in-the-middle) rather than instruction following.
# Pull code models
ollama pull qwen3-coder:30b # MoE, 19GB, fits 24GB
ollama pull qwen3-coder-next # 3B active, runs on 16GB
ollama pull qwen2.5-coder:7b
ollama pull qwen2.5-coder:14b
ollama pull qwen2.5-coder:32b
ollama pull codellama:7b
ollama pull codellama:13b
ollama pull codellama:34b
ollama pull starcoder2:3b
ollama pull starcoder2:7b
ollama pull starcoder2:15b
Legacy Models: Llama 2 Memory Requirements
Llama 2 7B at FP16 needs ~14GB of VRAM (13.5GB of weights plus KV cache); at Q4_K_M it drops to ~4.1GB and runs on any 6GB GPU. The 13B and 70B follow the same math: two bytes per parameter at FP16, roughly 30% of that at Q4_K_M.
| Model | Params | Q4_K_M | FP16 | Min VRAM (Q4_K_M) | Min VRAM (FP16) |
|---|---|---|---|---|---|
| Llama 2 7B | 6.74B | 4.1GB | 13.5GB | 5GB | ~14GB |
| Llama 2 13B | 13.0B | 7.9GB | 26.0GB | 9GB | ~27GB |
| Llama 2 70B | 69B | 41.4GB | 138.0GB | 43GB | ~140GB |
Notes:
- Running Llama 2 7B unquantized (FP16) means a 16GB card — it does not fit 12GB once the KV cache is counted. In practice almost nobody should: Q4_K_M carries the usual 1-3% quality cost at less than a third of the memory.
- Ollama's default
llama2tags ship Q4_0, slightly smaller than Q4_K_M: 3.8GB for 7B, 7.4GB for 13B, 39GB for 70B. - Llama 2 is two generations old. Unless you are reproducing older research or maintaining an existing pipeline, Llama 3.1 8B beats Llama 2 13B across the board at a third of the memory.
# Pull Llama 2 (legacy)
ollama pull llama2 # 7B, Q4_0
ollama pull llama2:13b
ollama pull llama2:70b
Quick Reference: What Fits on Your GPU
Find your GPU (or unified memory) capacity and see what models you can run at full speed (100% VRAM, no CPU offload).
These tables answer "what fits". For "how fast", divide your card's bandwidth by the size in the third column — the ceiling formula from the "How to Read This Table" section above. Handy reference bandwidths: RTX 4060 272 GB/s, RTX 3060 12GB 360 GB/s, RTX 4070 504 GB/s, RTX 3090 936 GB/s, RTX 4090 1008 GB/s, RTX 5090 1792 GB/s. Apple publishes per-chip figures that vary widely across the M-series, so check the one you own.
8GB VRAM (RTX 3060 8GB, RTX 4060, M1/M2 8GB)
| Model | Quant | Size | Quality |
|---|---|---|---|
| Llama 3.1 8B | Q4_K_M | 4.9GB | Strong general |
| Qwen 2.5 7B | Q4_K_M | 4.4GB | Best for code/math |
| Gemma 3 4B | Q5_K_M | 3.0GB | Great for small tasks |
| Phi-4 Mini 3.8B | Q5_K_M | 2.8GB | Best tiny reasoner |
| DeepSeek R1 7B | Q4_K_M | 4.4GB | Chain-of-thought |
| Qwen 2.5 Coder 7B | Q4_K_M | 4.4GB | Best coding for 8GB |
Top pick: Llama 3.1 8B Q4_K_M for general use, Qwen 2.5 Coder 7B for programming. On an RTX 4060 (272 GB/s) that 4.9GB file puts the ceiling near 55 tok/s.
12GB VRAM (RTX 3060 12GB, RTX 4070)
Everything from 8GB, plus:
| Model | Quant | Size | Quality |
|---|---|---|---|
| Qwen 2.5 14B | Q4_K_M | 8.7GB | Significant quality jump |
| Gemma 3 12B | Q4_K_M | 7.3GB | Excellent instruction |
| Phi-4 14B | Q4_K_M | 8.2GB | Strong reasoning |
| Llama 3.1 8B | Q5_K_M | 5.7GB | Higher quality 8B |
| CodeLlama 13B | Q4_K_M | 7.4GB | Solid code model |
Top pick: Qwen 2.5 14B Q4_K_M. The jump from 7B to 14B is the single biggest quality improvement per dollar in local AI. On an RTX 3060 12GB (360 GB/s) the 8.7GB file caps generation at about 41 tok/s; an RTX 4070 (504 GB/s) raises that to about 58. If you are still choosing a card rather than sizing one you own, our RTX 5070 for local AI breakdown covers exactly what 12GB runs and when paying up for 16GB is worth it.
16GB VRAM (RTX 4080, RTX 5060 Ti, M1 Pro/M2 Pro 16GB)
Everything from 12GB, plus:
| Model | Quant | Size | Quality |
|---|---|---|---|
| Mistral Small 24B | Q4_K_M | 14.0GB | Strong all-rounder |
| Gemma 3 27B | Q4_K_M | 15.9GB | Near-70B quality |
| Qwen 2.5 14B | Q5_K_M | 10.3GB | Higher quality 14B |
Top pick: Gemma 3 27B Q4_K_M squeezes in and delivers impressive quality. Note that at 15.9GB it leaves almost nothing for the KV cache on a 16GB card, so plan on a short context or step down a size.
24GB VRAM (RTX 3090, RTX 4090, M3 Pro 24GB)
Everything from 16GB, plus:
| Model | Quant | Size | Quality |
|---|---|---|---|
| Qwen 2.5 32B | Q4_K_M | 18.8GB | Near-70B quality |
| Qwen3-Coder 30B (MoE) | Q4_K_M | 19GB | Best local coding |
| Qwen 2.5 Coder 32B | Q4_K_M | 18.8GB | Strongest dense coder |
| DeepSeek R1 32B | Q4_K_M | 18.8GB | Best local reasoning |
| CodeLlama 34B | Q4_K_M | 19.1GB | Mature code model |
| Qwen 2.5 14B | FP16 | 29.5GB | — (too large) |
Top pick: Qwen 2.5 32B Q4_K_M. Best overall dense model that fits on a single consumer GPU. Its 18.8GB against an RTX 4090's 1008 GB/s is a ceiling near 54 tok/s, and near 50 on a 3090's 936 GB/s — the two cards are much closer here than their price gap suggests, because capacity is identical and bandwidth differs by only 8%.
32GB Unified Memory (M2 Pro/Max 32GB, M3 Pro 36GB)
Everything from 24GB, plus:
| Model | Quant | Size | Quality |
|---|---|---|---|
| Mixtral 8x7B | Q4_K_M | 26.4GB | MoE, broad knowledge |
| Qwen 2.5 32B | Q5_K_M | 22.5GB | Higher quality 32B |
Apple's unified-memory bandwidth varies enormously across chips at the same capacity — a Pro and a Max with identical RAM are not the same machine for inference. Check your specific chip's published figure before applying the ceiling formula.
48GB+ Unified Memory (M3 Max 48GB, M4 Max 48GB+)
Everything from 32GB, plus:
| Model | Quant | Size | Quality |
|---|---|---|---|
| Llama 3.3 70B | Q4_K_M | 40.0GB | Top-tier open model |
| Qwen 2.5 72B | Q4_K_M | 42.0GB | Excellent multilingual |
| DeepSeek R1 70B | Q4_K_M | 40.0GB | Best open reasoning |
Top pick: Llama 3.3 70B Q4_K_M. Running a 70B model on a laptop is genuinely impressive — but do the arithmetic before you expect it to feel snappy: 40GB against the M4 Max's 546 GB/s is a ceiling of about 14 tok/s, and that is the number you cannot beat, not the number you will get.
64GB+ (M4 Ultra, dual GPU, server)
Everything from 48GB, plus:
| Model | Quant | Size | Quality |
|---|---|---|---|
| Llama 3.3 70B | Q5_K_M | 48.0GB | Best quality 70B |
| Qwen 2.5 72B | Q5_K_M | 50.0GB | Higher quality 72B |
| Mixtral 8x22B | Q4_K_M | 80.0GB | Needs 82GB+ (64GB not enough) |
Stepping from Q4_K_M to Q5_K_M costs about 20% more bytes per token, so it costs about 20% off the throughput ceiling too. That is the real price of the quality bump at this size.
For more on choosing hardware for your target models, see our RAM requirements guide and VRAM requirements guide.
Ollama Pull Commands: Every Model
Copy-paste ready. Every model referenced in this article:
# === LLAMA FAMILY ===
ollama pull llama3.2:1b
ollama pull llama3.2:3b
ollama pull llama3.2 # 8B, default quant
ollama pull llama3.3:70b-instruct-q4_K_M
# === QWEN FAMILY ===
ollama pull qwen2.5:0.5b
ollama pull qwen2.5:1.5b
ollama pull qwen2.5:3b
ollama pull qwen2.5:7b
ollama pull qwen2.5:14b
ollama pull qwen2.5:32b
ollama pull qwen2.5:72b
ollama pull qwen3:8b
ollama pull qwen3:32b
# === GEMMA FAMILY ===
ollama pull gemma3:1b
ollama pull gemma3:4b
ollama pull gemma3:12b
ollama pull gemma3:27b
# === PHI FAMILY ===
ollama pull phi4-mini
ollama pull phi4
# === MISTRAL/MIXTRAL ===
ollama pull mistral
ollama pull mistral-small
ollama pull mixtral
# === DEEPSEEK R1 DISTILLS ===
ollama pull deepseek-r1:1.5b
ollama pull deepseek-r1:7b
ollama pull deepseek-r1:8b
ollama pull deepseek-r1:14b
ollama pull deepseek-r1:32b
ollama pull deepseek-r1:70b
# === CODE MODELS ===
ollama pull qwen3-coder:30b
ollama pull qwen3-coder-next
ollama pull qwen2.5-coder:1.5b
ollama pull qwen2.5-coder:7b
ollama pull qwen2.5-coder:14b
ollama pull qwen2.5-coder:32b
ollama pull codellama:7b
ollama pull codellama:13b
ollama pull codellama:34b
ollama pull starcoder2:3b
ollama pull starcoder2:7b
ollama pull starcoder2:15b
# === LEGACY (LLAMA 2) ===
ollama pull llama2
ollama pull llama2:13b
ollama pull llama2:70b
Browse the full model library at ollama.com/library.
How Much Does Context Length Add to VRAM?
The "Min VRAM" column in every table above assumes a modest 2K-token context. In real use — long chats, RAG pipelines, agents, large code files — the KV cache grows with context length and can quietly become the thing that pushes you out of VRAM. This is the #1 reason a model that "should fit" suddenly spills to CPU. RAG setups pay a second tax: an embedder sits in VRAM alongside the chat model, though the best Ollama embedding models for RAG are small enough that a few hundred MB to ~1GB covers it.
The KV cache scales roughly linearly with context. A useful approximation for a typical dense model at Q4_K_M:
Extra VRAM for context ≈ 0.5 GB per 2K tokens (7-8B model)
≈ 1.0 GB per 2K tokens (14B model)
≈ 1.5-2.0 GB per 2K tokens (32B+ model)
| Model (Q4_K_M) | 2K ctx | 8K ctx | 32K ctx |
|---|---|---|---|
| Llama 3.1 8B | ~6GB | ~7.5GB | ~14GB |
| Qwen 2.5 14B | ~10GB | ~13GB | ~22GB |
| Qwen 2.5 32B | ~20GB | ~24GB | ~36GB |
Notice what this means in practice: a 32B model that fits a 24GB GPU at 2K context will not fit the same card at 32K context — it needs ~36GB. If you run long-context workloads, size your hardware against the right-hand column, not the headline number. Two ways to claw back memory: enable KV-cache quantization (OLLAMA_KV_CACHE_TYPE=q8_0 roughly halves cache size at a tiny quality cost), or set a smaller num_ctx for the model. These are approximate; exact KV-cache size depends on the model's head count and hidden dimension. The broader VRAM requirements guide covers bandwidth and bus-width effects on top of capacity.
If you are working with a tight memory budget, the safest move is to drop a size class and run a smaller model at a longer context rather than a bigger model that constantly spills — see the best local AI models for 8GB RAM for picks that leave headroom for context.
Memory Math: How to Calculate Any Model
If a model is not in this table, you can estimate its VRAM requirement:
FP16 size (GB) = Parameters (B) × 2
Q4_K_M size ≈ FP16 × 0.28 to 0.32 (varies by architecture)
Q5_K_M size ≈ FP16 × 0.34 to 0.38
Q8_0 size ≈ FP16 × 0.50 to 0.55
Min VRAM needed = Model file size + 1.0 GB (KV cache at 2K context)
+ 0.5 GB per 2K additional context tokens
Example: A new 20B model you want to run at Q4_K_M:
- FP16 size: 20 × 2 = 40GB
- Q4_K_M: 40 × 0.30 = ~12GB
- Min VRAM: 12 + 1.0 = ~13GB
- Fits on a 16GB GPU with room for 4K context
For a thorough explanation of quantization levels and their quality tradeoffs, read our quantization explained guide. To find the best models for tight memory budgets, see best models for 8GB RAM.
Frequently Asked Questions
See the FAQ section below for answers to common questions about Ollama memory requirements.
Keep This Bookmarked
This table gets updated as new models release — the August 2026 refresh added Gemma 4, the Qwen 3 coder wave, and the Llama 2 legacy table; the September 2026 refresh re-verified every Gemma 4, Qwen3.6, Qwen3-Coder and Llama 4 size against the live Ollama library and corrected several that had drifted. The Ollama ecosystem moves fast — new model families appear every few weeks, and existing ones get updated quantization options.
The core principle stays constant: check the Q4_K_M file size, add 1-1.5GB for overhead, and compare against your available VRAM. If it fits with room to spare, you will have a good experience. If it barely fits, expect limited context windows and occasional slowdowns.
Building a new machine around a specific model? Start with the hardware requirements guide to size your GPU, RAM, and storage correctly.
Ollama’s running. Here’s what to build with it.
Go from “ollama run” to RAG apps, agents, and fine-tuned models — structured and hands-on. First chapter free.
Stop piecing Ollama together from blog posts
Ollama Mastery is 15 chapters end to end — install, model choice, Modelfiles, GPU offload, the API, and the 20 errors that actually happen. Plus 24 more courses.
Liked this? 25 full AI courses are waiting.
From fundamentals to RAG, agents, MCP servers, voice AI, and production deployment with real GitHub repos. First chapter free, every course.
Build Real AI on Your Machine
RAG, agents, NLP, vision, and MLOps - chapters across 25 courses that take you from reading about AI to building AI.
Want the structured version?
Hands-on courses on local AI, from $8.99 a month. The first chapter of each is free.
Keep going
- PILLARLocal AI Hardware Requirements (2026): Complete Guide
- AI Hardware Requirements: CPU, GPU and RAM for Beginners
- AI RAM Requirements 2026: How Much for 7B, 13B, 70B Models?
- AI Server Build Under $1,500: Parts List and What Fits
- AMD GPU Not Supported by ROCm? HSA_OVERRIDE Values
- AMD MI50 32GB for Local LLMs: The Used VRAM King, Honestly
- AMD Ryzen AI Max+ 395 (Strix Halo) for Local AI 2026
- Apple M4 for Local AI: Mac Studio + MacBook Guide (2026)
- Benchmark Your Local AI Setup: tok/s, TTFT, VRAM
- Best GPU for AI Video Generation: By VRAM Tier (2026)
Comments (0)
No comments yet. Be the first to share your thoughts!