Best Ollama Models for Coding (December 2026): What to Pull for Your Hardware
This guide answers one practical question: which model should you ollama pull for coding on the machine you have? Every tag, download size and context limit below was checked against the Ollama library on December 3, 2026. It is a research-based guide built from the library pages and model publishers’ documentation. We did not benchmark these models ourselves, and where a ranking is our judgement we say so.
If you want hardware-first advice that covers other runtimes too, read best AI models for coding locally. For open-weight coding models that are too large to run at home, including licence comparisons, see best open-source coding models. New to Ollama? Start with the Ollama complete guide or browse the local AI hub.
The short answer
| Your memory (GPU VRAM or Apple unified memory) | Pull this first | Why |
|---|---|---|
| 8GB | qwen3:8b (5.2GB) | Smallest model that is still useful for chat-style coding help |
| 12 to 16GB | deepseek-r1:14b (9.0GB) or qwen3:14b (9.3GB) | Reasoning for debugging, or a faster general coder |
| 16 to 24GB | devstral:24b (14GB) | Built for coding agents, Apache 2.0, 128K context |
| 24GB | devstral-small-2:24b (15GB) | Newer Devstral with 384K context and image input; needs Ollama 0.13.3+ |
| 24 to 32GB | qwen3-coder:30b (19GB) or qwen3.6:27b (18 to 19GB) | Strongest coding options that still fit on one high-end consumer GPU or a 32GB Mac |
| Autocomplete only | codestral:22b (13GB) | Fill-in-the-middle model for tab completion, but only 32K context |
The download size is not the memory you need. Add room for the context window (the KV cache) and runtime overhead, which is why a 14GB model is listed for 16 to 24GB machines. The memory section below shows how to check the real figure on your own machine.
The models, with verified tags
All sizes and context limits are as listed on each model’s Ollama library page on December 3, 2026.
| Tag | Download | Context | Input | Licence (as stated by the publisher) | Best use |
|---|---|---|---|---|---|
qwen3:8b | 5.2GB | 40K | Text | Not stated on the library page; see model card | Quick questions, small edits on 8GB machines |
qwen3:14b | 9.3GB | 40K | Text | Not stated on the library page; see model card | General coding help at 12 to 16GB |
deepseek-r1:14b | 9.0GB | 128K | Text | MIT weights, distilled from Qwen 2.5 (Apache 2.0) | Step-by-step debugging; slower because it reasons first |
gpt-oss:20b | 14GB | 128K | Text | Apache 2.0 | Reasoning and tool use; MXFP4 weights |
codestral:22b | 13GB | 32K | Text | Mistral licence, not Apache; check before commercial use | Tab autocomplete (fill-in-the-middle) |
devstral:24b | 14GB | 128K | Text | Apache 2.0 | Agentic coding: exploring a repo, multi-file edits |
devstral-small-2:24b | 15GB | 384K | Text, image | Apache 2.0 | Same job with a much longer context; needs Ollama 0.13.3+ |
qwen3.6:27b | 18 to 19GB | 256K | Text, image | See Qwen model card | Agentic coding with a dense 27B model |
qwen3-coder:30b | 19GB | 256K | Text | See Qwen model card | Coding-specialised MoE: 30B total, 3.3B active per token |
gemma4:26b | 16 to 19GB | 256K | Text, image | Gemma terms of use | General model with image input; MoE with 3.8B active |
How we would choose between the 24 to 32GB options
This is editorial judgement, not a benchmark result:
devstral:24bis the safest default for agent tools such as Aider and OpenCode. The library describes it as built for coding agents, it is Apache 2.0, and at 14GB it leaves room for a long context on a 24GB card. Our Devstral Small 2 guide covers the newerdevstral-small-2:24b.qwen3-coder:30bis a mixture-of-experts model. Only 3.3B parameters are active per token, so it generates faster than its size suggests, but all 19GB must still fit in memory.qwen3.6:27bis dense, so every parameter is used for every token. Expect it to be slower thanqwen3-coder:30bon the same hardware. Its advantage is image input (screenshots of errors or UIs) and the newer Qwen generation. See how to run Qwen 3.6 locally.
If you can, try two of them on a task from your own repository. Your codebase, language and editor setup matter more than any public leaderboard.
Models to stop pulling
Several models that appeared in earlier versions of this guide and in many 2026 tutorials no longer work as a plain ollama pull:
| Model | Status on December 3, 2026 | What to do instead |
|---|---|---|
glm-5.1 | Retired from the Ollama library on September 25, 2026 | Use GLM through its API, or pick a model from the table above |
deepseek-v4-flash | Retired from the Ollama library on August 27, 2026 | deepseek-r1:14b locally, or DeepSeek’s hosted API |
kimi-k2.6 | Listed only as kimi-k2.6:cloud (1.04T parameters); no local tags | It runs on Ollama’s cloud, not on your machine |
devstral-small:24b | This tag never existed | devstral:24b or devstral-small-2:24b |
A cloud tag runs on Ollama’s servers. Your prompts and code leave your machine, which defeats the main reason many developers choose local models.
How much memory you actually need
Three things share your GPU or unified memory: the model weights (roughly the download size), the KV cache for the context window, and runtime overhead. The KV cache grows linearly with context length, so the same model can fit at 8K context and fail at 128K.
Check the real number instead of guessing:
ollama pull devstral:24b
ollama run devstral:24b "Write a Python function that parses ISO 8601 dates."
ollama ps
ollama ps shows the loaded size and the CPU/GPU split. If the processor column shows a CPU share on a machine with a dedicated GPU, the model did not fit in VRAM and generation will be much slower. Reduce the context window, pick a smaller tag, or see Ollama out-of-memory fixes and slow inference fixes.
Coding agents need more context than chat. An agent that reads several files can easily need 32K tokens or more. Set the context explicitly rather than relying on the default, and if you see truncated answers or lost instructions, read context length exceeded.
For the arithmetic behind VRAM estimates and quantization levels, see how much VRAM you need for AI and GGUF vs GPTQ vs AWQ.
Connecting a model to your editor
Aider (terminal)
Aider’s documentation recommends the ollama_chat/ prefix for Ollama models:
ollama pull devstral:24b
aider --model ollama_chat/devstral:24b
Full walkthrough, including context settings: Aider with Ollama.
Continue (VS Code and JetBrains)
Continue can use one model for chat and edits and a second, smaller one for autocomplete. A common split is devstral:24b for chat and codestral:22b for tab completion, but both together need about 27GB for weights alone. On a 24GB card, pair devstral:24b with a small model such as qwen3:4b (2.5GB) for completion instead. The current configuration format is covered in our Continue + Ollama setup guide.
When local is not enough
Local models are a good fit for private code, offline work and avoiding per-token costs. Hosted frontier models still handle large refactors and long agent sessions better. Many developers use a local model for routine work and a hosted model for the hardest tasks.
If your laptop is the bottleneck, you can run the same Ollama setup on a rented GPU. See best hosting for Ollama in production, the Vultr deployment guide and our cloud GPU provider comparison. Compare Ollama with other runtimes in Ollama vs LM Studio vs vLLM.
Sources
- Ollama library model pages (tags and download sizes, checked December 3, 2026): qwen3, deepseek-r1, qwen3.6, codestral, gemma4, kimi-k2.6
What changed in this update
December 3, 2026: rebuilt the guide around tags verified in the Ollama library. We removed retired and non-existent model tags (glm-5.1, deepseek-v4-flash, devstral-small:24b) and the incorrect claim that Kimi K2.6 runs locally in 24GB. We also removed third-party benchmark scores we could not trace to a published method, added licences and context limits, and replaced the earlier “we tested 10 models” framing, which was not backed by a documented test.
FAQ
What is the best Ollama model for coding?
For most developers with a 24GB GPU or a 32GB Mac, devstral:24b is the best starting point: built for coding agents, Apache 2.0, 14GB download and 128K context. With more memory, try qwen3-coder:30b or qwen3.6:27b. On 8GB, use qwen3:8b.
Which Ollama model is best for autocomplete?
codestral:22b supports fill-in-the-middle completion, which is what tab autocomplete needs. Its context is only 32K and its licence is not Apache, so check Mistral’s terms for commercial use. On smaller machines, a small Qwen model is a practical completion model.
Can I run Kimi K2.6 or GLM-5.1 locally with Ollama?
Not as of December 3, 2026. Kimi K2.6 is listed only as a cloud model on Ollama, and GLM-5.1 was retired from the library on September 25, 2026.
How much RAM do I need for an Ollama coding model?
Roughly the download size plus a few gigabytes for context and overhead: about 8GB for qwen3:8b, 16GB for 14B models and 24GB for devstral:24b with a useful context window. Run ollama ps after loading a model to see the real figure on your machine.