★ Reading this for free? Get 25 structured AI courses + per-chapter AI tutor — the first chapter of every course free, no card.Start free in 30 secondsOr own every course: $149 once
📅 Published: August 31, 2026🔄 Last Updated: November 2, 2026✓ Manually Reviewed
Coding

Best Ollama Model for Coding: Picks by VRAM Tier

2026-08-31
9 min
Barsha Mohapatra

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.

Free chapter · Ollama Mastery

Learn Ollama properly, from install to daily driver

15 chapters: installing it on Windows, macOS and Linux, reading the model library, Modelfiles, making Ollama use your GPU, the API, and the errors that actually happen. Chapter 1, “What Ollama Is (and Three Jobs It's Wrong For)”, is free with an account. No card.

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 qwen3-coder:30b. On 16GB, devstral-small-2:24b. On 12GB, qwen2.5-coder:14b. On 8GB, qwen2.5-coder:7b. With 64GB of GPU or unified memory, qwen3-coder-next. 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 VRAMPull thisWeights at Q4_K_MPublished coding scoreWhy
8GBqwen2.5-coder:7b4.7GBHumanEval 88.4% (Qwen2.5-Coder report)The strongest coder in the 7B class, and it leaves room for a working context
12GBqwen2.5-coder:14b9.0GBHumanEval 89.6% (Qwen2.5-Coder report)A clear quality step over every 7B coder, and the 12GB ceiling
16GBdevstral-small-2:24b15GBSWE-bench Verified 68.0% (Mistral); 56.4% on swebench.comBuilt for agentic coding; see the headroom caveat below
24GBqwen3-coder:30b19GB51.6% SWE-bench Verified on swebench.com (OpenHands)Coding-specific MoE: 3.3B active per token, so it generates at small-model speed, with a 256K native context
48-64GB+qwen3-coder-next52GBSWE-bench Verified 70.6% (Qwen technical report)The strongest Qwen coder that fits a 64GB Mac or two 32GB cards

Sizes are the Q4_K_M weights as Ollama lists them (re-read November 2, 2026). Scores are as published by the vendor or the official swebench.com board, read October-November 2026; vendor and board numbers use different agent harnesses, so compare within a column source, not across.

Two 24GB alternatives worth knowing. qwen3.6:27b (18GB) is a dense general model whose Qwen model card reports 77.2% on SWE-bench Verified with Qwen's own agent, and qwen3.8:27b (18GB) is the newer all-rounder. Both beat the 30B coder on paper; the 30B is faster per token because only 3.3B of its parameters run each step. qwen2.5-coder:32b (20GB) still runs well for chat and completion but scores only 9.0% as an autonomous agent on swebench.com, so it is no longer the 24GB pick.

Sizes 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 (devstral-small-2:24b) is 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; the official swebench.com board lists the same model at 56.4% with its own harness. But 15GB of weights on a 16GB card leaves roughly a gigabyte for everything else, which is not much of a context window. (The plain devstral tag is the older Devstral Small, a 14GB download.)

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 18GB 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 if I have 48GB or more?

Two RTX 3090s or 4090s (48GB), two 32GB RTX 5090s, an 80GB data-center card, or a Mac with 64GB+ of unified memory opens the next step: qwen3-coder-next, an 80B mixture-of-experts model with 3B parameters active per token. Ollama's Q4_K_M build is 52GB, so 48GB is not quite enough to hold it on the GPU; 64GB is the realistic floor. Its technical report lists 70.6% on SWE-bench Verified with the SWE-Agent harness, against 76.0% for Claude Sonnet 4.5 in the same harness. The Qwen3-Coder-Next guide has the full table and setup. With 48GB, a 30B-class model at Q8 (qwen3-coder:30b-a3b-q8_0, 32GB) plus a long context is the better use of the memory.

Is Ollama fast enough for coding?

Ollama runs llama.cpp underneath, so its speed is the model's speed on your hardware. Our reference measurement: qwen2.5-coder:7b generated 29.0 tokens per second on an Apple M3 Pro (18GB, 150 GB/s) with Ollama 0.40.13 on 2 November 2026, against a bandwidth ceiling of 32 tok/s for its 4.7GB file. A discrete GPU with more memory bandwidth raises that ceiling: an RTX 4060's 272 GB/s gives the same file a ~58 tok/s ceiling. On a rented NVIDIA L4 (24 GB, 300 GB/s) the same tag measured 52.0 tok/s (Ollama 0.40.13, 3 November 2026; every row is on /benchmarks). The MoE models above (qwen3-coder:30b, qwen3-coder-next) generate much faster than their total size suggests, because only a few billion parameters are read per token; we do not quote a ceiling for them.

Own it instead of renting it

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.

What about DeepSeek Coder?

DeepSeek-Coder 6.7B (deepseek-coder:6.7b, 3.8GB) is the close second at 8GB, and DeepSeek-Coder-V2 Lite 16B (deepseek-coder-v2:16b) — a mixture-of-experts model that is an 8.9GB download — 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.

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. Above 24GB, the next useful step is 64GB of GPU or unified memory for Qwen3-Coder-Next.

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

🎯
AI Learning Path

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.

Or own it for life — Lifetime $149 $599, pay once
Once your hardware is sorted

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.

$149 once unlocks everything, forever — about $0.27/chapter for life. Prefer to spread it out? Pro is $79/year (saves 27%) or $8.99/month.
Secure checkout by Lemon Squeezy — your card never touches this siteInstant access the moment you payFirst chapter of every course is free — try before you buy

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.

Reading now
Join the discussion
Tagsollamacodingqwenqwen3-coderdevstralvram

Barsha Mohapatra

Local AI Master writes hands-on courses and hardware guides for running AI on machines you own. Content is checked against current releases and corrected when readers tell us it is wrong.

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.

AI Learning Path
More on AI Models for Coding
See the full Best Local AI for Coding guide.

Comments (0)

No comments yet. Be the first to share your thoughts!

What is the best Ollama model for coding overall?

There is no single answer, because the binding constraint is your VRAM rather than the model rankings. On a 24GB card, Qwen3-Coder 30B (qwen3-coder:30b, 19GB) is the coding pick, with Qwen3.6 27B as the dense alternative. On 16GB, Devstral Small 2 24B (devstral-small-2:24b) is the agentic-coding pick if you can live with a short context, otherwise gpt-oss 20B. On 12GB, Qwen 2.5 Coder 14B. On 8GB, Qwen 2.5 Coder 7B. With 64GB or more of GPU or unified memory, Qwen3-Coder-Next (52GB). Picking the biggest model your card can hold at Q4_K_M, with room left for context, will serve you better than chasing a leaderboard position.

Is Ollama good for coding?

Yes, for most day-to-day work, with two conditions. First, the model has to fit in your GPU or unified memory with room for context; a model that spills into system RAM becomes too slow to use interactively. Second, you need an editor or agent on top: Ollama serves the model, and tools such as Continue.dev, Cline or Aider turn it into an assistant. Ollama itself adds little overhead because it runs llama.cpp underneath. On an Apple M3 Pro we measured qwen2.5-coder:7b at 29.0 tokens per second with Ollama 0.40.13, comfortably faster than reading speed. Where hosted models still lead is long, multi-file agentic work, which needs both a stronger model and more memory than most desktops have.

How much VRAM do I need for a local coding model?

Eight gigabytes is the practical floor for a useful coding model, and it runs any 7B coder at Q4_K_M with room for a modest context. Twelve gets you the 14B class, which is a clear quality step. Sixteen opens the 20-24B models. Twenty-four is where the 32B coders fit and a local assistant starts to feel genuinely comparable to a hosted one. Below 8GB you are better served by a cloud API or by using the model for autocomplete only.

Is Qwen 2.5 Coder better than DeepSeek Coder?

At the same size they are close, and the honest answer is that it depends on the task. Qwen 2.5 Coder is the stronger general instruction-following coder in our recommendations at every tier. DeepSeek-Coder has a reputation for fill-in-the-middle completion, which is what you want if you are mainly using the model as an inline autocomplete inside an editor rather than as a chat assistant. Both are worth pulling; they are a few gigabytes each.

Can Ollama replace GitHub Copilot?

For autocomplete and for questions about code you already have, yes — pair Ollama with Continue.dev in VS Code or JetBrains and you have a local assistant that costs nothing per month and sends nothing to a third party. Where hosted assistants still lead is long-context reasoning over a large repository and agentic multi-file edits, both of which are memory-bound and therefore hardware-bound. A 24GB card narrows that gap considerably.

Does a coding-specific model beat a general model at coding?

Usually, at the same parameter count, yes — a coder variant has seen far more code during training and tends to produce more syntactically reliable output. The exception is reasoning-heavy work such as debugging an unfamiliar system or designing an approach, where a strong general model of the same size can be the better companion. If you have the disk space, keeping one of each and switching is a reasonable habit.

Ready to Go Beyond Tutorials?

25 structured courses with hands-on chapters - build RAG chatbots, AI agents, and ML pipelines on your own hardware.

Was this helpful?

Barsha Mohapatra

Written by

Barsha Mohapatra

Founder and Editor, Local AI Master · Founder, Little AI Master

Founder of Little AI Master and the editor behind every course and guide on Local AI Master. Years of tutoring students taught her where AI education actually fails.

📚
Free · no account required

Grab the AI Starter Kit — career roadmap, cheat sheet, setup guide

No spam. Unsubscribe with one click.

🎯
AI Learning Path

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.

Or own it for life — Lifetime $149 $599, pay once
Free Tools & Calculators