The best Ollama model for coding right now is qwen3-coder:30b, a 30B Mixture-of-Experts model with 3.3B active parameters that downloads at 19GB (Q4_K_M) and serves 256K context, the best quality per GB of VRAM on a 24-32GB GPU or a 32GB Mac. For a hard agentic number, devstral:24b scores 46.8% SWE-Bench Verified at 14GB. On 16GB of RAM, run gpt-oss:20b.
This is the current Ollama library, not a 2024 snapshot. Every pull tag, download size, and context window below is verified against ollama.com as of June 28, 2026, and cross-model coding quality uses the Aider polyglot leaderboard rather than saturated HumanEval scores. Pull any model with ollama pull, run it at localhost:11434, pay nothing per token.
Best Ollama Model for Coding
For coding, three picks cover almost every machine. On a 24-32GB GPU or a 32GB Mac, run qwen3-coder:30b: 30B total, 3.3B active per token, 19GB at Q4_K_M, 256K context, fast because MoE only activates a fraction of the weights. If you want a benchmarked agentic coder, run devstral:24b (46.8% SWE-Bench Verified, Apache 2.0). On 16GB of RAM, run gpt-oss:20b.
Best quality-per-VRAM: qwen3-coder:30b
30B MoE, 3.3B active. 19GB at Q4_K_M, 256K context (1M via extrapolation). Trained with long-horizon RL on SWE-Bench-style tasks. Best local coder for a 24-32GB GPU or 32GB Mac.
Best benchmarked agentic coder: devstral:24b
24B dense, 14GB, 128K context, Apache 2.0. 46.8% SWE-Bench Verified (vs GPT-4.1-mini 23.6%, Claude 3.5 Haiku 40.6%). Runs on an RTX 4090 or 32GB Mac. The only local coder with a hard agentic number on its card.
Best on 16GB RAM: gpt-oss:20b
OpenAI open weights, 20B MoE, MXFP4 quant (4.25 bits/param on MoE weights). 14GB, 128K context, runs on 16GB of RAM. The dense fallback is qwen2.5-coder:14b (9GB).
The tradeoffs are concrete. qwen3-coder:30b has the largest context (256K) and the best speed-to-quality ratio, but no published numeric benchmark on its card. devstral:24b is the one to cite when someone wants a measured agentic score, and it is the lightest of the three on disk. gpt-oss:20b is the only one that fits in 16GB of plain RAM, which matters on laptops without a discrete GPU. qwen2.5-coder:32b (below) still leads the prior generation on multi-language code repair.
Master Comparison: Ollama Coding Models
| Pull tag | Params | Download (Q4_K_M) | Context | Best for |
|---|---|---|---|---|
| qwen3-coder:30b | 30B / 3.3B active MoE | 19GB | 256K | 24-32GB GPU, best per-VRAM |
| devstral:24b | 24B dense | 14GB | 128K | Agentic, 46.8% SWE-Bench Verified |
| gpt-oss:20b | 20B MoE (MXFP4) | 14GB | 128K | Runs on 16GB RAM |
| qwen2.5-coder:32b | 32B dense | 20GB | 32K | Prior-gen reference coder |
| qwen2.5-coder:14b | 14B dense | 9.0GB | 32K | 16GB GPU coding |
| qwen2.5-coder:7b | 7B dense | 4.7GB | 32K | 8GB GPU coding |
| deepseek-coder-v2:16b | 16B MoE | 8.9GB | 160K | Budget MoE coder |
| codestral:22b | 22B dense | 13GB | 32K | Fill-in-the-middle, 80+ langs |
| qwen3-coder:480b | 480B / 35B active MoE | 290GB | 256K | Multi-GPU agentic flagship |
| Pull tag | Distilled from | Download (Q4_K_M) | Context | Notes |
|---|---|---|---|---|
| deepseek-r1:8b | Qwen3 | 5.2GB | 128K | Best small reasoning distill |
| deepseek-r1:14b | Qwen | 9.0GB | 128K | Mid-range GPU |
| deepseek-r1:32b | Qwen | 20GB | 128K | Fits a 24GB GPU at Q4 |
| deepseek-r1:70b | Llama | 43GB | 128K | Dual GPU / 64GB Mac |
| deepseek-r1:671b | Full (not a distill) | 404GB | 160K | Datacenter only |
| magistral:24b | Mistral reasoning | 14GB | 128K | Cap context near 40K |
| Pull tag | Params | Download (Q4_K_M) | Context | Best for |
|---|---|---|---|---|
| llama3.3:70b | 70B dense | 43GB | 128K | RAG generation, instruction |
| gemma3:27b | 27B dense | 17GB | 128K | Vision, 140+ languages |
| gemma3:12b | 12B dense | 8.1GB | 128K | Multimodal on a 12GB GPU |
| gemma3:4b | 4B dense | 3.3GB | 128K | Edge vision, gemma3:latest |
| phi4:14b | 14B dense | 9.1GB | 16K | Reasoning at small size |
| mistral-small3.2:24b | 24B dense | 15GB | 128K | Multimodal chat, tools |
| granite4:3b | 3B dense | 2.1GB | 128K | Enterprise micro (Apache 2.0) |
| gpt-oss:120b | 120B MoE (MXFP4) | 65GB | 128K | Single 80GB GPU, Apache 2.0 |
| qwen3:30b | 30B / 3B active MoE | 19GB | 256K | General MoE workhorse |
| llama4:16x17b | 109B / 17B active MoE | 67GB | 10M | Vision, very long context |
| Pull tag | Type | Download / Size | Context | Best for |
|---|---|---|---|---|
| nomic-embed-text | Text embeddings | 274MB | 8,192 tok/chunk | RAG embeddings, code search |
| qwen3-vl:8b | Vision-language | 6.1GB | 256K | OCR, code-from-image |
Download sizes are the Q4_K_M weights from ollama.com. Actual VRAM is the download plus the KV cache, which adds roughly 2-6GB at default context and far more at long context: a 70B model at 32K context adds about 14GB of KV cache alone.
Full Ollama Model List: What People Actually Pull
ollama list shows the models on your machine; ollama.com/library shows the full catalog. Below is the catalog ranked by pulls as of June 2026, which is the practical answer to "what are the Ollama models?" The general-purpose Llama and DeepSeek families dominate downloads, while coding-specific models like qwen2.5-coder sit lower on raw pulls but higher on coding quality.
| Family | Sizes | Pulls | Capabilities |
|---|---|---|---|
| llama3.1 | 8b / 70b / 405b | 116.5M | General, tools |
| deepseek-r1 | 1.5b to 671b | 88.7M | Reasoning, tools, thinking |
| nomic-embed-text | embedding | 76.4M | RAG embeddings |
| llama3.2 | 1b / 3b | 74.5M | Small, tools |
| gemma3 | 270m to 27b | 38.1M | Vision, multilingual |
| qwen2.5-coder | 0.5b to 32b | 17.7M | Code |
| codellama | 7b to 70b | 5.7M | Legacy code |
| glm-4.6 | 357B-class MoE | 2.2M | Agentic coding |
Some models on Ollama are hosted only and have no local weights tag: deepseek-v3.2 (deepseek-v3.2:cloud, 671B), glm-5.2, minimax-m3, kimi-k2.7-code, and qwen3-coder:480b-cloud all run on Ollama's cloud, not your GPU. deepseek-v3.1 has a 671b local tag, but at 404GB it needs multi-GPU or very large RAM. If a model lists only a :cloud tag, you cannot download and run it on consumer hardware.
qwen3-coder:30b: Best Quality-per-VRAM Coder
qwen3-coder:30b is the default coding pick for a 24-32GB GPU or a 32GB Mac. It is a 30B Mixture-of-Experts model that activates 3.3B parameters per token, so it has the memory footprint of a small model and the quality of a much larger one. It ships at 19GB (Q4_K_M) and serves 256K context natively, up to 1M with extrapolation.
The model card states it was trained with long-horizon reinforcement learning on SWE-Bench and similar agentic benchmarks, but publishes no numeric score, so do not quote one. Where it earns its place is the loop coding agents actually run: read a file, search related code, edit across files, run tests. For a published agentic number, use devstral below. For raw single-function generation on the prior generation, use qwen2.5-coder:32b.
Pull and run qwen3-coder:30b
ollama pull qwen3-coder:30b
ollama run qwen3-coder:30b "Find and fix the null pointer in src/auth.ts"
# Drive it as an OpenAI-compatible agent endpoint
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-coder:30b",
"messages": [{"role": "user", "content": "Refactor this module to async/await"}],
"tools": [{"type": "function", "function": {"name": "read_file", "parameters": {"type": "object", "properties": {"path": {"type": "string"}}}}}]
}'qwen3-coder:480b (480B total, 35B active) is the agentic flagship, but at 290GB for Q4_K_M (510GB at q8_0, 960GB at fp16) it needs a multi-GPU server. There is also a 480b-cloud tag. For local work, 30b is the only practical qwen3-coder size; no variant smaller than 30B exists.
devstral:24b: The Benchmarked Single-GPU Agent
devstral:24b is Mistral's agentic coding model and the only local coder on this list with a hard SWE-Bench number on its card: 46.8% SWE-Bench Verified, ahead of GPT-4.1-mini (23.6%) and Claude 3.5 Haiku (40.6%). It is 24B dense, 14GB at Q4_K_M, 128K context, Apache 2.0, text-only, and runs on a single RTX 4090 or a 32GB Mac.
Pick devstral when you are wiring a model into an agent harness and want a measured score behind the choice. It is the lightest of the three top coders on disk, which leaves more VRAM headroom for context. qwen3-coder:30b has more context (256K vs 128K) and the MoE speed advantage, so the practical split is: devstral for a benchmarked 24B dense agent, qwen3-coder for the largest context and best speed-to-quality on a 24-32GB card.
Pull devstral
ollama pull devstral:24b
ollama run devstral:24b "Implement the failing test in tests/test_parser.py"gpt-oss:20b and 120b: OpenAI Open Weights
gpt-oss is OpenAI's open-weights MoE family under Apache 2.0. gpt-oss:20b is the model to run when you do not have a discrete GPU: it is quantized to MXFP4 (4.25 bits per param on the MoE weights), downloads at 14GB, serves 128K context, and runs on 16GB of RAM. gpt-oss:120b (65GB) fits on a single 80GB GPU.
On a 16GB laptop without a GPU, gpt-oss:20b is the best general-purpose model that fits. For dedicated coding on the same hardware, qwen2.5-coder:14b (9GB dense) is the alternative; it trades the 128K context for a stronger code-specific prior in a smaller footprint. Step up to gpt-oss:120b only if you have an 80GB GPU.
Pull gpt-oss on 16GB hardware
ollama pull gpt-oss:20b
ollama run gpt-oss:20b "Explain this stack trace and propose a fix"qwen2.5-coder:32b: The Prior-Generation Reference Coder
qwen2.5-coder:32b is the model that made local coding competitive, and it is still the prior-generation reference. It downloads at 20GB (Q4_K_M), serves 32K context, and leads open-source models on multi-language code repair: 73.7 on Aider code-repair, 65.9 on McEval, and 75.2 on MdEval, the top open-source MdEval score. The family spans 0.5b to 32b, so it scales down to almost any GPU.
The full size ladder: 0.5b (398MB), 1.5b (986MB), 3b (1.9GB), 7b (4.7GB), 14b (9.0GB), 32b (20GB). The 7b variant is the right starting point for an 8GB GPU; the 14b is the best fit for 16GB. The main reason to choose qwen3-coder:30b over this is context (256K vs 32K) and agentic training; the reason to stay here is the published code-repair lead and the wide range of small tags.
Match the tag to your GPU
# 8GB GPU
ollama pull qwen2.5-coder:7b
# 16GB GPU
ollama pull qwen2.5-coder:14b
# 24GB GPU
ollama pull qwen2.5-coder:32bDeepSeek-R1 Distills: Reasoning on Local Hardware
DeepSeek-R1 is a thinking model that reasons step by step before answering. The full model is 671B and needs about 404GB, so for local use DeepSeek shipped distilled checkpoints. The 8B is distilled from Qwen3 (5.2GB), the 14B and 32B from Qwen (9.0GB, 20GB), and the 70B from Llama (43GB). All serve 128K context; the full 671B serves 160K. The family has 88.7M pulls.
Pick the size to your GPU: deepseek-r1:8b for laptops, deepseek-r1:14b for mid-range, deepseek-r1:32b to fill a 24GB card, deepseek-r1:70b for dual-GPU or a 64GB Mac. On the Aider polyglot leaderboard, DeepSeek R1-0528 reaches 71.4%, near the top of open-weight models, but that is the full-scale model; the local distills trade quality for fit. Reasoning models think before answering, so expect higher latency than a same-size non-reasoning model.
R1 distills emit a thinking trace before the answer, which adds tokens and time. The payoff is on debugging, math, and logic where the chain of thought catches errors. For autocomplete and quick snippets, a non-reasoning coder like qwen2.5-coder is faster.
More Coders: Codestral and DeepSeek-Coder-V2
Two more code-specific models earn a place. codestral:22b is Mistral's first code model, trained on 80-plus languages with fill-in-the-middle; it downloads at 13GB, serves 32K context, and tops RepoBench for long-range repository code generation. deepseek-coder-v2:16b is an MoE coder at 8.9GB with a 160K context window, the budget pick when you want more than a 7B model on a 12-16GB GPU.
codestral:22b is the pick for fill-in-the-middle completion inside an editor and for repository-scale generation where its RepoBench lead shows. deepseek-coder-v2:16b earns its slot on context: 160K is the largest of the budget coders, useful for reading across several files on a mid-range GPU. The much larger deepseek-coder-v2:236b exists (133GB) but is an older release capped at 4K context, so skip it.
General, RAG and Multimodal Models
For RAG generation, llama3.3:70b is the workhorse: 70B dense, 43GB, 128K context, roughly Llama 3.1 405B quality at a fraction of the size. Pair it with nomic-embed-text (274MB, 8,192 tokens per chunk) for embeddings. For multimodal work, the gemma3 family adds vision and 140-plus languages from 270M to 27B.
gemma3:27b (17GB) reports MMLU 78.6, GSM8K 82.6, HumanEval pass@1 48.8, and DocVQA 85.6, with a QAT variant that cuts memory roughly 3x. gemma3:12b (8.1GB) is the single-12GB-GPU multimodal pick, and gemma3:4b (3.3GB) is the edge default. phi4:14b (9.1GB) packs strong reasoning into a small model but is capped at 16K context, so it is not a RAG model. mistral-small3.2:24b (15GB, 128K) adds vision and improved function calling. For enterprise tool-calling and RAG with an Apache 2.0 license, IBM's granite4 spans granite4:3b (2.1GB) up to granite4:32b-a9b-h (32B total, 9B active MoE).
For reliable function calling, qwen3 and granite4 are trained for it, gemma3 supports it, and llama3.3 handles it. Ollama's endpoint takes tool definitions in the OpenAI format. See Ollama's tool-calling docs for the schema.
7B vs 14B vs 32B vs 70B: How Much Does Size Buy?
More parameters buy more coding quality, but the curve is steep and the format matters. The Aider polyglot leaderboard, which scores models on real diff-edits, is the clearest cross-model signal because HumanEval is saturated. The top open-weight scores come from 671B-class models; locally runnable sizes land far lower, and small models score poorly partly because they struggle with the strict diff-edit format.
| Model | Aider polyglot | Roughly needs | Locally runnable? |
|---|---|---|---|
| DeepSeek-V3.2-Exp Reasoner | 74.2% | 400GB+ | No (datacenter) |
| DeepSeek R1-0528 | 71.4% | 400GB+ | No (datacenter) |
| Qwen3 235B A22B | 59.6% | ~142GB | Multi-GPU only |
| DeepSeek V3-0324 | 55.1% | 400GB+ | No (datacenter) |
| Qwen3 32B | 40.0% | ~20GB | Yes, one 24GB GPU |
| Llama 4 Maverick | 15.6% | 245GB | Multi-GPU only |
| Codestral 25.01 | 11.1% | 13GB | Yes |
| Gemma 3 27B IT | 4.9% | 17GB | Yes |
The practical reading: a locally runnable model on one 24GB GPU (Qwen3 32B class) lands around 40% on this strict format, while the 59.6% tier needs ~142GB and the 70%-plus tier needs 400GB-plus. That gap is the reason to use a code-specialized model (qwen3-coder, devstral) plus an apply step for edits, rather than expecting a single small general model to one-shot diffs. Quantization compresses this further: smaller models lose the most accuracy at Q4.
Quantization: Where Quality Degrades
Ollama defaults to Q4_K_M, roughly 4.5 bits per weight. That is a real step down from q8_0 and fp16, and it is most visible on small models and on exact-output tasks like code. For coding, prefer q8_0 when VRAM allows; the difference shows up as fewer subtle off-by-one and API-misuse errors.
| Quant | Download | Bits/weight (approx) | When to use |
|---|---|---|---|
| Q4_K_M (default) | 19GB | ~4.5 | 24GB GPU, fits with context |
| q8_0 | 32GB | ~8 | 32GB+ VRAM, best quality |
| fp16 | 61GB | 16 | Reference precision, multi-GPU |
Two rules hold across the library. First, on small hardware a larger model at Q4 usually beats a tiny model at Q4, because models under 7B lose the most quality from 4-bit quantization. Second, gpt-oss ships natively at MXFP4 (4.25 bits on the MoE weights), so its 14GB size already reflects aggressive quantization; there is no higher-precision local tag to step up to. If exact output matters and you have outgrown local precision, run the model at a higher precision quant or on hardware that fits the full-precision weights.
VRAM Cheat Sheet: What Runs on Your Hardware
The single biggest factor in local speed is whether the model fits entirely in VRAM. A model in GPU memory runs several times faster than one spilling to system RAM. This maps hardware tiers to the best current models, using download size as the floor and leaving room for the KV cache.
| Memory | Examples | Best coding model | Best general model |
|---|---|---|---|
| 8GB | RTX 3060, RTX 4060, M2 Air | qwen2.5-coder:7b | llama3.1:8b |
| 12GB | RTX 3060 12GB, RTX 4070 | deepseek-coder-v2:16b | gemma3:12b |
| 16GB (incl. RAM) | RTX 4060 Ti, 16GB laptop | qwen2.5-coder:14b | gpt-oss:20b |
| 24-32GB | RTX 3090, RTX 4090, 32GB Mac | qwen3-coder:30b / devstral:24b | deepseek-r1:32b |
| 48GB+ | 2x RTX 3090, A6000, 64GB Mac | qwen2.5-coder:32b (q8_0) | llama3.3:70b |
| 80GB | H100, A100 80GB | qwen3-coder:30b (fp16) | gpt-oss:120b |
These figures assume default context. Expanding context adds KV cache: a 70B model adds about 14GB at 32K context and over 40GB at 128K. Set OLLAMA_KV_CACHE_TYPE=q8_0 to roughly halve KV cache memory with minimal quality loss, or cap num_ctx in your Modelfile.
Sources
Every model number above traces to one of these primary sources, verified June 28, 2026.
- ollama.com/library: full catalog, sizes, and pull counts.
- qwen3-coder and its tags: params, download sizes per quant, context.
- devstral: 46.8% SWE-Bench Verified, license, size.
- gpt-oss: MXFP4 quant, 16GB RAM, Apache 2.0.
- qwen2.5-coder: Aider repair 73.7, McEval 65.9, MdEval 75.2.
- gemma3: MMLU 78.6, HumanEval 48.8, vision.
- deepseek-r1 tags: distill sources, sizes, context.
- Aider polyglot leaderboard: cross-model diff-edit coding quality.
Frequently Asked Questions
What is the best Ollama model for coding in 2026?
qwen3-coder:30b for most developers: a 30B MoE with 3.3B active params, 19GB at Q4_K_M, 256K context, the best quality per GB of VRAM on a 24-32GB GPU or 32GB Mac. For a hard benchmark, devstral:24b scores 46.8% SWE-Bench Verified at 14GB. On 16GB of RAM, gpt-oss:20b.
How do I list all Ollama models?
ollama list shows your local models; ollama.com/library shows the full catalog. Most-pulled as of June 2026: llama3.1 (116.5M), deepseek-r1 (88.7M), nomic-embed-text (76.4M), llama3.2 (74.5M), gemma3 (38.1M), qwen2.5-coder (17.7M).
What is the best Ollama coding model on 16GB?
gpt-oss:20b. MXFP4 quant, 14GB, 128K context, runs on 16GB of RAM. The dense code-specialized alternative is qwen2.5-coder:14b (9GB, 32K context). Below 16GB, use qwen2.5-coder:7b (4.7GB).
Which Ollama coding model has a real SWE-Bench score?
devstral:24b: 46.8% SWE-Bench Verified on its card, ahead of GPT-4.1-mini (23.6%) and Claude 3.5 Haiku (40.6%). Most other local coders publish no SWE-Bench number, so be skeptical of HumanEval figures quoted elsewhere; many are stale or unsourced.
How much VRAM do I need to run Ollama models?
The Q4_K_M download is the floor, plus 2-6GB for KV cache: qwen2.5-coder:7b 4.7GB, gpt-oss:20b 14GB, qwen3-coder:30b 19GB, qwen2.5-coder:32b 20GB, llama3.3:70b 43GB. A model that fits entirely in VRAM runs several times faster than one spilling to system RAM.
Does quantization hurt coding quality?
Yes, measurably. Ollama defaults to Q4_K_M (~4.5 bits/weight). For coding, prefer q8_0 when VRAM allows: qwen3-coder:30b is 19GB at Q4, 32GB at q8_0, 61GB at fp16. Models under 7B lose the most at Q4, so a larger Q4 model usually beats a tiny one on the same hardware.
Can I use Ollama models with coding agents, and run them hosted later?
Yes. Any agent that accepts an OpenAI base URL works with Ollama at http://localhost:11434/v1. When you outgrow local hardware, most hosted inference providers expose the same OpenAI-compatible API, so you swap the base URL and model name without changing code.
