Best Ollama Model for Coding: Picks by VRAM Tier
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.
The best Ollama model for coding is whichever coder fits your VRAM with room left for context โ and at every tier that is currently a Qwen or Mistral coder. On a 24GB card run qwen2.5-coder:32b. On 16GB, devstral. On 12GB, qwen2.5-coder:14b. On 8GB, qwen2.5-coder:7b. The rest of this page explains why the VRAM tier decides it, and where each pick stops being the right answer.
Model rankings change every few weeks. The amount of memory on your graphics card does not, and it is the constraint that actually determines what you can run. That is why this page is organised by card rather than by leaderboard.
Which Ollama coding model should I run?
| Your VRAM | Pull this | Weights at Q4_K_M | Why |
|---|---|---|---|
| 8GB | qwen2.5-coder:7b | ~5GB | The strongest coder in the 7B class, and it leaves room for a working context |
| 12GB | qwen2.5-coder:14b | ~9GB | A clear quality step over every 7B coder, and the 12GB ceiling |
| 16GB | devstral | ~15GB | Built for agentic coding; see the headroom caveat below |
| 24GB | qwen2.5-coder:32b | ~20GB | The strongest open coding model that runs comfortably on one consumer card |
Sizes are the Q4_K_M weights. They are not the whole memory requirement: the KV cache for your context sits on top, and it grows with how much code you feed the model. A model whose weights exactly fill your card will load and then disappoint you the moment you paste in a real file.
The 16GB caveat worth knowing before you pull
Devstral Small 2 24B is about 15GB at Q4_K_M. Mistral reports 68.0% on SWE-bench Verified for it, which is the strongest agentic-coding figure among models that fit a 16GB card โ that number is Mistral's own published result, not ours. But 15GB of weights on a 16GB card leaves roughly a gigabyte for everything else, which is not much of a context window.
If your work involves an agent reading several files at once, run the mixture-of-experts
gpt-oss:20b or drop to qwen2.5-coder:14b (~9GB) and spend the reclaimed memory on
context instead. More context with a slightly weaker model usually beats a stronger model
that cannot see your codebase. Our 16GB VRAM coding picks
go through the trade in more detail.
Reading articles is good. Building is better.
Free account = the first chapter of all 25 courses, with a per-chapter AI tutor. No card.
Why does VRAM decide this and not the benchmarks?
A model that does not fit does not run โ or rather, Ollama will run it by spilling layers into system RAM, at which point it becomes slow enough that you stop using it. That is the whole game on consumer hardware.
Two models sit tantalisingly just outside the 16GB tier: Qwen3.6 27B at roughly 17GB and Qwen3-Coder 30B at roughly 19GB. Both miss a 16GB card by a margin too small to quantise away without hurting quality, and both fit a 24GB card easily. If you are choosing hardware rather than choosing a model, that gap is the entire argument for 24GB โ see our hardware guide for what that costs at each build tier.
What about DeepSeek Coder?
DeepSeek-Coder 6.7B is the close second at 8GB, and DeepSeek-Coder-V2 Lite 16B โ a mixture-of-experts model that fits in about 10GB โ is a strong 12GB option that feels faster in an editor than its size suggests, because only a fraction of its parameters are active per token.
The practical split: reach for DeepSeek when you are mostly doing fill-in-the-middle completion inline, and for Qwen when you are mostly asking questions and having it write whole functions. Both are a few gigabytes. Pull both and switch.
How do I actually use this in my editor?
Ollama on its own gives you a terminal. To get something that behaves like Copilot you need an editor extension pointed at it:
# pull the model for your tier
ollama pull qwen2.5-coder:14b
# confirm it is serving
curl http://localhost:11434/api/version
Continue.dev is the most direct route for VS Code and JetBrains โ our Continue.dev and Ollama setup guide covers the config file and the two settings people usually get wrong. If you work in the terminal instead, Aider is the most local-model-tolerant of the coding agents by its own documented design goals.
One setting matters more than the model choice for agent work: the context length. Ollama
defaults conservatively, and an agent that cannot see enough of your repository will
behave as though the model is stupid when the real problem is the window. Raise
num_ctx per model rather than globally.
Have the whole stack running before your coffee goes cold
Ten Compose files that come up with one command โ instead of an afternoon of debugging YAML and CUDA flags.
Which tier should I buy for?
If you are choosing a card specifically to run a local coding assistant, the honest ordering is: 24GB is where this becomes genuinely pleasant, 16GB is workable with the context caveat above, 12GB is fine for autocomplete and single-file questions, and 8GB works but you will feel the ceiling within a week.
Our per-tier pages go deeper on each: 8GB, 12GB, 16GB and 24GB. If you have not settled on a card yet, the VRAM calculator will tell you what a specific model needs before you spend anything.
Frequently asked questions
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 structured AI education?
25 courses, 519+ chapters, from $9. Understand AI, don't just use it.
Continue Your Local AI Journey
- PILLARBest Local AI for Coding 2026: 10 Models Tested & Ranked
- 7B vs 14B vs 32B vs 70B for Coding (2026): What Size?
- AI Context Windows: 4K vs 128K vs 1M Tokens Explained (2026)
- Aider + Ollama Setup (2026): Free Local AI Coding Agent
- Best 14B Coding Models (2026): Ranked by HumanEval + VRAM
- Best AI Coding Models Ranked: SWE-bench Leaderboard
- Best AI for JavaScript & TypeScript 2026: 10 Models Ranked
- Best AI Models for Python Development 2026: Top 10 Ranked
- Best Claude Model for Coding: Sonnet 5, Opus 4.8, Fable 5
- Best Ollama Model for Coding (2026): Qwen3-Coder Ranked #1
Comments (0)
No comments yet. Be the first to share your thoughts!