Best Ollama Models: The 2026 List, Ranked for Coding, RAG & Agents (June 2026)

The current Ollama library ranked with verified pull tags, download sizes, context windows, and VRAM. Best local coder: qwen3-coder:30b (30B/3.3B MoE, 19GB, 256K context). devstral:24b scores 46.8% SWE-Bench Verified. gpt-oss:20b runs on 16GB RAM.

June 28, 2026 ยท 1 min read
Best Ollama Models: The 2026 List, Ranked for Coding, RAG & Agents (June 2026)

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.

Verified against the live Ollama library, June 28, 2026Updated June 28, 2026: replaced the prior lineup with the current library (qwen3-coder, devstral, gpt-oss, gemma3, granite4), re-verified every pull tag, download size, and context window against ollama.com, and swapped unverifiable HumanEval claims for SWE-Bench Verified and Aider polyglot numbers.
46.8%
devstral:24b SWE-Bench Verified
19GB
qwen3-coder:30b download (Q4)
16GB RAM
Runs gpt-oss:20b (MXFP4)
$0
Local inference cost 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

Coding Models: Tags, Size, Context
Pull tagParamsDownload (Q4_K_M)ContextBest for
qwen3-coder:30b30B / 3.3B active MoE19GB256K24-32GB GPU, best per-VRAM
devstral:24b24B dense14GB128KAgentic, 46.8% SWE-Bench Verified
gpt-oss:20b20B MoE (MXFP4)14GB128KRuns on 16GB RAM
qwen2.5-coder:32b32B dense20GB32KPrior-gen reference coder
qwen2.5-coder:14b14B dense9.0GB32K16GB GPU coding
qwen2.5-coder:7b7B dense4.7GB32K8GB GPU coding
deepseek-coder-v2:16b16B MoE8.9GB160KBudget MoE coder
codestral:22b22B dense13GB32KFill-in-the-middle, 80+ langs
qwen3-coder:480b480B / 35B active MoE290GB256KMulti-GPU agentic flagship
Reasoning Models (DeepSeek-R1 distills + full)
Pull tagDistilled fromDownload (Q4_K_M)ContextNotes
deepseek-r1:8bQwen35.2GB128KBest small reasoning distill
deepseek-r1:14bQwen9.0GB128KMid-range GPU
deepseek-r1:32bQwen20GB128KFits a 24GB GPU at Q4
deepseek-r1:70bLlama43GB128KDual GPU / 64GB Mac
deepseek-r1:671bFull (not a distill)404GB160KDatacenter only
magistral:24bMistral reasoning14GB128KCap context near 40K
General, RAG & Multimodal Models
Pull tagParamsDownload (Q4_K_M)ContextBest for
llama3.3:70b70B dense43GB128KRAG generation, instruction
gemma3:27b27B dense17GB128KVision, 140+ languages
gemma3:12b12B dense8.1GB128KMultimodal on a 12GB GPU
gemma3:4b4B dense3.3GB128KEdge vision, gemma3:latest
phi4:14b14B dense9.1GB16KReasoning at small size
mistral-small3.2:24b24B dense15GB128KMultimodal chat, tools
granite4:3b3B dense2.1GB128KEnterprise micro (Apache 2.0)
gpt-oss:120b120B MoE (MXFP4)65GB128KSingle 80GB GPU, Apache 2.0
qwen3:30b30B / 3B active MoE19GB256KGeneral MoE workhorse
llama4:16x17b109B / 17B active MoE67GB10MVision, very long context
Embedding & Vision Helpers
Pull tagTypeDownload / SizeContextBest for
nomic-embed-textText embeddings274MB8,192 tok/chunkRAG embeddings, code search
qwen3-vl:8bVision-language6.1GB256KOCR, 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.

Most-Pulled Ollama Models (June 2026)
FamilySizesPullsCapabilities
llama3.18b / 70b / 405b116.5MGeneral, tools
deepseek-r11.5b to 671b88.7MReasoning, tools, thinking
nomic-embed-textembedding76.4MRAG embeddings
llama3.21b / 3b74.5MSmall, tools
gemma3270m to 27b38.1MVision, multilingual
qwen2.5-coder0.5b to 32b17.7MCode
codellama7b to 70b5.7MLegacy code
glm-4.6357B-class MoE2.2MAgentic coding
Cloud-only tags will not run locally

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.

30B / 3.3B
Total / active params
19GB
Download at Q4_K_M
256K
Native context (1M extended)
MoE
Architecture

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"}}}}}]
  }'
The 480b tag is not a local model

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.

46.8%
SWE-Bench Verified
24B
Dense parameters
14GB
Download at Q4_K_M
128K
Context window

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.

20B
MoE params (gpt-oss:20b)
14GB
Download (MXFP4)
128K
Context window
Apache 2.0
License

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.

75.2
MdEval (#1 open-source)
73.7
Aider code-repair
20GB
Download at Q4_K_M
32K
Context window

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:32b

DeepSeek-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.

8B to 671B
Distill sizes + full
20GB
32B distill (24GB GPU)
128K
Distill context
88.7M
Library 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.

Reasoning costs latency

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.

13GB
codestral:22b download
160K
deepseek-coder-v2:16b context
8.9GB
deepseek-coder-v2:16b download
32K
codestral context

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.

78.6
gemma3:27b MMLU
48.8
gemma3:27b HumanEval pass@1
43GB
llama3.3:70b download
274MB
nomic-embed-text size

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).

Tool calling for agents

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.

Aider Polyglot (diff-edit) by Open-Weight Size
ModelAider polyglotRoughly needsLocally runnable?
DeepSeek-V3.2-Exp Reasoner74.2%400GB+No (datacenter)
DeepSeek R1-052871.4%400GB+No (datacenter)
Qwen3 235B A22B59.6%~142GBMulti-GPU only
DeepSeek V3-032455.1%400GB+No (datacenter)
Qwen3 32B40.0%~20GBYes, one 24GB GPU
Llama 4 Maverick15.6%245GBMulti-GPU only
Codestral 25.0111.1%13GBYes
Gemma 3 27B IT4.9%17GBYes

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.

qwen3-coder:30b Across Quantizations
QuantDownloadBits/weight (approx)When to use
Q4_K_M (default)19GB~4.524GB GPU, fits with context
q8_032GB~832GB+ VRAM, best quality
fp1661GB16Reference 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.

Hardware Tier to Best Model
MemoryExamplesBest coding modelBest general model
8GBRTX 3060, RTX 4060, M2 Airqwen2.5-coder:7bllama3.1:8b
12GBRTX 3060 12GB, RTX 4070deepseek-coder-v2:16bgemma3:12b
16GB (incl. RAM)RTX 4060 Ti, 16GB laptopqwen2.5-coder:14bgpt-oss:20b
24-32GBRTX 3090, RTX 4090, 32GB Macqwen3-coder:30b / devstral:24bdeepseek-r1:32b
48GB+2x RTX 3090, A6000, 64GB Macqwen2.5-coder:32b (q8_0)llama3.3:70b
80GBH100, A100 80GBqwen3-coder:30b (fp16)gpt-oss:120b
KV cache eats memory

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.

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.