Title card reading 'The Best Local LLM for Coding in August 2026' with the subtitle 'By VRAM: Qwen3-Coder 30B at 24GB · gpt-oss-20b at 16GB · Qwen 2.5 Coder 7B at 8GB', and three tiles labelled '24GB Qwen3-Coder 30B A3B strongest all-round local coder 256K context', '16GB gpt-oss-20b ~140 tok/s fully on-GPU, Apache 2.0', '8GB Qwen 2.5 Coder 7B the reliable workhorse ~4.7GB at Q4', on a white background with blue and cyan gradient accents and the OrcaRouter logo composited bottom-right.
Guides & Insights

The Best Local LLM for Coding in August 2026, By VRAM: Qwen3-Coder 30B, gpt-oss-20b, Qwen 2.5 Coder 7B

Author

Jim Song

Date Published

Latest models · 20View all models
Benchmarks: Artificial Analysis · updated daily
Back to all posts

The best local LLM for coding in August 2026 is decided by your VRAM before anything else. If you have a 24GB card — an RTX 3090 or 4090 — run Qwen3-Coder-30B-A3B-Instruct: 30B total parameters with only 3.3B active per token, a 262,144-token context window, and the best all-round local coding numbers we can verify. On 16GB it is gpt-oss-20b, O​penAI's Apache-2.0 Mixture-of-Experts model that fits fully on-GPU at ~14GB and measures about 140 tokens/sec. On 8GB it is Qwen2.5-Coder-7B, the reliable workhorse at ~4.7GB. The rest of this page is the reasoning, the measured numbers, and the specific situations where each of those picks is wrong.

What page one gets right — and what it skips

Ranking for "best local llm for coding" right now is a mix of one genuinely useful piece and a lot of domain strength. Tembo's guide (June 5, 2026) gets the shape right — it organizes by 8GB / 12–16GB / 24GB tiers and lands on the Qwen Coder family — but it publishes no benchmark scores for the local models, no tokens-per-second figures, no context-window sizes, and no Apple Silicon picks by RAM. A GitHub eval harness (gauravvij/local-llm-coding-eval) has real numbers but no verdict and ran on CPU only. The rest are single-author opinion pieces (XDA, Yahoo Tech) and thin listicles (apidog, Security Boulevard, SitePoint) that rank on domain strength, not on being useful.

What they all skip, in order of how much it costs you:

The agentic gap. Code generation is not the same skill as driving an agent through a multi-file change. Page one barely mentions it; it is the difference between a model you keep and a model you uninstall.

Context windows. Agentic coding burns tokens loading files and test output. A "30B fits in 24GB" claim is meaningless until you ask what context it fits at.

Quantization math. Nobody explains that 4-bit needs roughly the parameter count in gigabytes, or that Q3 buys VRAM at the cost of subtle syntax errors.

Measured speed. Few pieces print tokens/sec for the models they recommend, and the ones that do disagree wildly because context and quantization change everything.

When local is the wrong call. A 2026 field test on a 15,000-line Flutter app (EPAM) still shows cloud frontier models winning the hardest multi-step refactors. None of the listicles tell you when to stop.

The VRAM math most listicles skip

The rule of thumb that makes every other number in this article legible: at 4-bit quantization, a model needs roughly its parameter count in gigabytes — 7B ≈ 5GB, 30B ≈ 18GB+, before KV-cache overhead. Q4 is the coding sweet spot; Q3 and below save VRAM but measurably introduce subtle syntax errors. And the KV cache grows with your context window, which is why "a 30B fits in 24GB" is only true at a context you actually have to specify.

Mixture-of-Experts changes the math in a way that matters for the two big picks below. Total parameters set the footprint; active parameters set the speed. That is why Qwen3-Coder-30B-A3B (30B total, 3.3B active) and gpt-oss-20b (20.9B total, 3.61B active) both feel far faster than their weight on disk suggests, and why DeepSeek V4 Flash — 284B total, 13B active — is a poor local fit even though its API is cheap.

Card titled 'The VRAM math most listicles skip' with a rule box reading 'At 4-bit, a model needs roughly its parameter count in gigabytes, plus KV cache for your context window'. Three columns: 'Qwen3-Coder 30B' FP16 ~61GB, Q8 ~30GB, Q4 ~17-20GB, KV cache at 256K several GB extra; 'gpt-oss-20b' FP16 ~40GB, Q8 ~21GB, MXFP4 ~14GB, KV cache at 128K fits 16GB only at modest context; 'Qwen 2.5 Coder 7B' FP16 ~14GB, Q8 ~7GB, Q4 ~4.7GB, KV cache at 32K fits 8GB with headroom. A warning bar reads 'Q3 and below save VRAM but measurably introduce subtle syntax errors in code — Q4 is the coding sweet spot. MoE changes the math: total parameters set the footprint, active parameters set the speed.' with the OrcaRouter logo composited bottom-right.

24GB VRAM: Qwen3-Coder 30B

Qwen3-Coder-30B-A3B-Instruct is the strongest all-round local coder we can point to right now. Released July 2025 by Alibaba's Qwen team under Apache 2.0, it is a Mixture-of-Experts model with 30B total parameters and 3.3B active per token, a 262,144-token context window, and a 4-bit footprint of roughly 17–20GB — which leaves real headroom on a 24GB card for the KV cache that a long coding session needs.

On the independent local harness we trust most (gauravvij/local-llm-coding-eval, four models run locally via Ollama on CPU), qwen3-coder:30b scored 80% code generation, 77% tool selection, and 80% agent accuracy — the most balanced result of the four, and the only model that was strong at all three jobs at once. Third-party trackers compile its SWE-bench Verified around 50.3, Aider Polyglot at 66.2, and LiveCodeBench v6 at 58.9; treat those as compiled figures, not Alibaba's official numbers, which is all Qwen has published for this model.

Measured speed ranges widely with hardware. The most useful datapoints: a community TurboQuant setup runs it on an 8GB RTX 3060 Ti at ~29 tokens/sec generation with a full 262K context, and the oMLX benchmark measured the 4-bit MLX build on an M4 Pro (48GB) at 73.6 tokens/sec at 1K context, dropping to 13.5 tokens/sec at 64K. On a 24GB card in a normal Ollama setup you should expect the tens-of-tokens-per-second range, not the hundreds — the trade for running a frontier-adjacent coder at home.

The honest caveat: it is not the fastest local coder, and a newer Qwen3-Coder-Next exists aimed at hosted and CLI use rather than quantized local installs. But for agentic, repo-scale work on one card, Qwen3-Coder-30B is the pick today.

16GB VRAM: gpt-oss-20b

On a 16GB card, the answer is gpt-oss-20b — and it is not close. Released August 5, 2025 by O​penAI under Apache 2.0, it is a Mixture-of-Experts model with 20.9B total parameters and 3.61B active per token, a 131,072-token context window, and its native MXFP4 quantization ships at roughly 14GB. That is the decisive fact: it runs 100% on-GPU on a 16GB card, with nothing spilling to system RAM.

Why on-GPU residency matters more than any benchmark: a model that fits in VRAM is 3–11x faster than one that offloads. An independent benchmark recorded 139.93 tokens/sec for gpt-oss-20b on an RTX 4080 — roughly 2.8x a dense alternative at the same footprint — and one 2026 tester's scoring gave it a 52.1 "intelligence index," calling it unmatched in the 16GB class for professional coding and debugging. It is a tight fit, so run it alone and keep the context modest; quality degrades at the top of the window.

The agentic alternative on 16GB is Devstral 24B (devstral-small-2:24b), which posts the only published SWE-bench Verified number among the 16GB-class local coders — 46.8% — but it is slow, often needing CPU offload at ~18 tokens/sec. If your work is multi-file agentic edits and you can eat the speed, Devstral earns its slot; if you want speed plus clean code, gpt-oss-20b is the better default. Dense 14B models — Qwen3-Coder 14B or Qwen2.5-Coder 14B at Q5 — are the comfortable, cheap fallbacks.

8GB VRAM: Qwen 2.5 Coder 7B

On 8GB, the honest answer is Qwen2.5-Coder-7B: 7B parameters at ~4.7GB in Q4_K_M, a 32,768-token native context extendable toward 128K, and the strongest code-completion benchmark scores in the 7B class. It is an older model — released November 2024 — and that is fine, because nothing newer in the 8GB envelope has dethroned it. Community tests put it around 50 tokens/sec on an RTX 4060 or 3070; an independent RTX 4060 test in March 2026 measured 28–35 tokens/sec, a spread driven almost entirely by context settings.

Three things matter on 8GB that don't elsewhere. First, cap the context at 4–8K: the KV cache is what OOMs an 8GB card, not the weights — one benchmark saw speed jump from ~3.6 to ~37 tokens/sec purely from capping context. Second, verify with ollama ps that the model is 100% on-GPU; any CPU share means speed collapses. Third, Q4_K_M, not Q3 — Q3's syntax errors cost you more than the VRAM saves.

The notable 2026 development is that Qwen3-Coder-30B-A3B-Instruct can now be squeezed onto 8GB via TurboQuant KV-cache compression — a community setup measured ~7.5GB and ~29 tokens/sec on an RTX 3060 Ti at full 256K context. It works, and it is fiddly enough that we do not recommend it as a default. If you want a newer out-of-the-box option, Qwen3 8B (~5.2GB, hybrid thinking mode) is a small step up from Qwen2.5-Coder-7B on general reasoning while staying slightly behind on pure code.

Scoreboard card titled 'Three picks, three VRAM tiers' with three columns. Left '24GB · Qwen3-Coder 30B': VRAM at 4-bit ~19GB Q4_K_M, Context 262,144 tokens, Speed measured ~29 t/s tight 8GB run; 50-90 t/s on 24GB, Released Jul 2025, License Apache 2.0, Best for agentic repo-scale work. Middle '16GB · gpt-oss-20b': VRAM ~14GB MXFP4, Context 131,072 tokens, Speed ~140 t/s RTX 4080, Released Aug 5 2025, License Apache 2.0, Best for speed plus clean code. Right '8GB · Qwen 2.5 Coder 7B': VRAM ~4.7GB Q4_K_M, Context 32,768 native (128K via YaRN), Speed ~50 t/s RTX 4060/3070, Released Nov 2024, License Apache 2.0, Best for autocomplete, offline, privacy. Footer reads 'Speeds are third-party measurements; all figures read Aug 10 2026.' with the OrcaRouter logo composited bottom-right.

What about Apple Silicon?

Unified memory changes the calculus in one direction: capacity goes up, generation speed goes down. A 48GB M4 Pro can hold models a 16GB Windows card cannot, but it generates tokens far more slowly at long context. The numbers we have: the 4-bit MLX build of Qwen3-Coder-30B-A3B-Instruct used 16.6GB at 1K context and 25.5GB at 64K on an M4 Pro, with generation falling from 73.6 tokens/sec to 13.5 as the context grew (oMLX benchmark). gpt-oss-20b fits comfortably in 16GB of unified memory and is a fine Mac pick. If you want multimodal on Apple Silicon, Gemma 4 12B runs in roughly 16GB of unified memory with a 256K context — the strongest local option if your coding work is next to image-heavy documents.

The independent numbers: codegen is not the skill that matters

The clearest data we found is a single local benchmark worth citing whole. gauravvij/local-llm-coding-eval ran four models locally via Ollama, on CPU, no cloud — code generation, function calling, and a multi-step agent task — with results that cut against the "bigger codegen number wins" instinct:

Qwen3.6 27B (qwen3.6:27b, dense, ~17GB): 80.0% codegen, 84.6% tools, 100% agent — the best all-rounder.

Qwen3.6 35B A3B (qwen3.6:35b-a3b, MoE, ~18GB): 70.0% codegen, 84.6% tools, 100% agent.

Qwen3-Coder-30B-A3B-Instruct (qwen3-coder:30b, MoE, ~17GB): 80.0% codegen, 76.9% tools, 80% agent — most balanced.

DeepSeek-Coder-V2 33B (deepseek-coder:33b, dense, ~18GB): 90.0% codegen — the best of the four — but 10% agent, dead last on multi-step work.

That last line is the whole lesson. A model that tops pure code generation yet collapses on agent tasks is the model you will uninstall after the first "read this file, change this function, run the test" loop. Judge a local coder by the agentic column, not the codegen column.

Benchmark card titled 'The independent local benchmark — agentic skill is the real gap' with four columns. 'qwen3.6:27b dense ~17GB': Codegen 80.0%, Tools 84.6%, Agent 100%. 'qwen3.6:35b-a3b MoE ~18GB': Codegen 70.0%, Tools 84.6%, Agent 100%. 'qwen3-coder:30b MoE ~17GB': Codegen 80.0%, Tools 76.9%, Agent 80%. 'deepseek-coder:33b dense ~18GB': Codegen 90.0%, Tools 84.6%, Agent 10%. Footer reads 'deepseek-coder:33b tops codegen yet collapses on agent tasks — codegen alone overrates a local coder. All four ran locally via Ollama, CPU-only, no cloud (gauravvij/local-llm-coding-eval, GitHub). On a 15k-LOC refactor, cloud frontier still wins (EPAM field test, 2026).' with the OrcaRouter logo composited bottom-right.

When running locally is the wrong call

Local-first is the right default for privacy, offline work, zero marginal token cost, and autocomplete where latency matters more than ceiling quality. It is the wrong call in specific, recognizable situations — and this is the section page one skips:

The hardest agentic work still beats you. EPAM's 2026 field test on a 15,000-line Flutter app found cloud frontier models (GPT-5.3-codex) still outperforming local models on the most complex multi-step refactoring. If your day is eight-hour refactors of legacy code, local is not ready.

Your context needs exceed your card. A coding agent that loads a whole repo will blow past the KV cache a 16GB card can hold. Qwen3-Coder-30B's 256K context is the reason it wins the 24GB tier — smaller cards lose this game early.

You cannot babysit hardware. The hardware is real money: a 24GB card is the $700–1,600 class, plus electricity and maintenance. At low volume, calling an API is cheaper than the power draw.

DeepSeek V4 Flash is the proof. At 284B total parameters, DeepSeek V4 Flash's 4-bit weights alone are roughly 140GB — not a consumer-card model, full stop. Its 13B-active design is exactly why its API is fast and cheap at $0.15 / $0.29 per 1M tokens (MIT, 1M context). For that model, "run it locally" is the wrong question; the API is the point.

Teams need consistency. If four engineers each run a different quantization of a different model, "works on my machine" becomes a build hazard. Shared API endpoints give you one deterministic target.

If you want the API-side answer to this same question — which cloud coding model is the default when local is not the right trade — we covered it separately in our best-LLM-for-coding guide, and our AI-coding-agents piece covers harnesses like Cline and OpenCode that work with these local models.

How to test before you buy the card

The cheapest way to decide is to run your own prompts before committing to hardware. Ollama or LM Studio get any of the three picks running in minutes, and the test that matters is your repo's real files, not a benchmark. A router earns its place on the adjacent decision: when you are comparing a local candidate against hosted frontier models, one endpoint lets you run the same prompt through both without juggling keys. On OrcaRouter, DeepSeek V4 Flash is served at its provider list price passed through unchanged — $0.15 / $0.29 per 1M tokens, 0% markup — with automatic failover, which makes it a cheap and honest yardstick for "is my local model actually better than the $0.15 API?"

One honest caveat: OrcaRouter does not host Qwen3-Coder-30B-A3B-Instruct or gpt-oss-20b. If your goal is strictly offline, a router is irrelevant to you — self-host and you are done. If your goal is to A/B the same open-weight model against the frontier before you spend on a card, the router's job is the comparison, not the hosting.

The bottom line

Your VRAM decides first, model quality second. On 24GB, run Qwen3-Coder-30B-A3B-Instruct — the strongest all-round local coder, with the 256K context that agentic work needs. On 16GB, run gpt-oss-20b — the rare model that is both fast and fully on-GPU. On 8GB, run Qwen2.5-Coder-7B and keep your context modest. Judge any of them by the agentic column, not the codegen column, and accept that the hardest multi-file refactoring still belongs to the cloud. The numbers above are current as of August 10, 2026 — re-verify the line-up and list prices before you spend, because this space moves weekly.

© 2026 OrcaRouter

For Providers

Run an inference platform? Get your models on OrcaRouter.

Contact us

Join our community

DiscordEmailXGitHubYouTube