The best local LLM for coding depends on your memory. One pick per tier from 8GB to 64GB+, with vendor-reported scores, licenses and Ollama download sizes.
For a 24GB GPU, the best local coding model in October 2026 is Qwen3.8 27B: Apache-2.0, 256K context, an 18GB Ollama download, and the strongest vendor-reported coding scores of any model that fits. Smaller tiers drop to Devstral Small 2 (16GB) and Qwen3.5 9B (8GB). Larger tiers open up mixture-of-experts models like Laguna XS 2.1 and Qwen3-Coder-Next.
- Qwen3.8 27B, 18GB
- Devstral Small 2, 15GB
- Oct 26, 2026
- Vendor-reported
Key takeaways
- Pick by memory first. Qwen3.8 27B is the pick for 24GB, Devstral Small 2 for 16GB, Qwen3.5 9B for 8GB, Laguna XS 2.1 for a 36GB Mac.
- Every score here is vendor-reported with a different harness. Treat them as directional, not as a head-to-head ranking.
- SWE-bench Verified is losing credibility: OpenAI reported that 59.4% of the 138 hard tasks it audited had flawed tests or descriptions. Newer cards lead with SWE-bench Pro.
- Aider's polyglot leaderboard was last updated on November 20, 2025, so it can't rank this year's models.
- Most picks are Apache-2.0. Laguna XS 2.1 uses OpenMDW-1.1. Read the license before shipping a model inside a product.
Facts checked against model cards and the Ollama library on October 26, 2026. This field changes monthly, so check the cards before you download.
Which is the best local LLM for coding right now?
The best local LLM for coding in late 2026 comes from a short list: seven open-weight models cover almost every consumer setup, and four of them are Qwen releases. The table lists each with its size, license and the best coding score its own card reports. The scores come from different benchmarks and harnesses, so compare within a column, not across rows.
| Model | Params (total / active) | Context | License | Reported coding score | Default Ollama download |
|---|---|---|---|---|---|
| Qwen3.8 27B | 27B dense | 256K | Apache-2.0 | SWE-bench Pro 61.7, LiveCodeBench v6 90.3 | 18GB |
| Qwen3.6 35B-A3B | 35B / 3B | 256K | Apache-2.0 | SWE-bench Verified 73.4, LiveCodeBench v6 80.4 | 23-24GB |
| Laguna XS 2.1 | 33B / 3B | 256K | OpenMDW-1.1 | SWE-bench Verified 70.9 | n/a (fits a 36GB Mac) |
| Qwen3-Coder-Next | 80B / 3B | 256K | Apache-2.0 | SWE-bench Verified 70.6 | 52GB (Q4_K_M) |
| Devstral Small 2 | 24B dense | 256K | Apache-2.0 | SWE-bench Verified 68.0 | 15GB |
| Qwen3.5 9B | 9B dense | 256K | Apache-2.0 | LiveCodeBench v6 65.6 | 6.6-7.6GB |
| gpt-oss-20b | 21B / 3.6B | not stated on card | Apache-2.0 | none reported | 14GB |
Download size is not the same as memory use. The context cache and runtime overhead come on top, so leave a few gigabytes of headroom. For the arithmetic, see local LLM hardware requirements; for what Q4 means, see GGUF quantization explained.
In the “active” column, a mixture-of-experts (MoE) model only runs a fraction of its weights per token, but all of them still have to sit in memory. That is why a 35B-A3B model needs roughly the memory of a 35B model.
What fits in 8GB, 12GB, 16GB, 24GB and 48GB+ of VRAM?
Developers on 16GB cards already show where the limit is. One Hacker News user running Qwen3.8 27B at a 2-bit quant on an RTX 5070 Ti with 16GB reported 128k context at 50-60 tokens/sec (HN, Aug 14, 2026), which is only possible by dropping below the default Q4 download. The rule that follows: pick the largest dense or MoE model whose download leaves a few gigabytes free. One recommendation per tier:
| Memory | Pick | Runner-up | Why |
|---|---|---|---|
| 8GB | Qwen3.5 9B (qwen3.5:9b, 6.6-7.6GB) | qwen3.5:4b (3.3-4.0GB) | The only model that fits with a coding score on its card (LiveCodeBench v6 65.6). The download leaves little room for context, so expect to cap it. |
| 12GB | Qwen3.5 9B with more context headroom | none | No model in the table above fits comfortably between 8GB and 16GB. Spend the extra memory on context, not on a bigger model. |
| 16GB | Devstral Small 2 (devstral-small-2, 15GB) | gpt-oss-20b (14GB) | Mistral reports 68.0% on SWE-bench Verified. The download is tight on a 16GB card once the cache is added. gpt-oss-20b is the safer fit: its card says it runs within 16GB, but it reports no coding score. |
| 24GB | Qwen3.8 27B (qwen3.8:27b, 18GB) | Qwen3-Coder 30B (qwen3-coder:30b, 19GB) | Highest vendor-reported scores of anything that fits, with room for context. |
| 36GB-48GB | Laguna XS 2.1 | Qwen3.6 35B-A3B (23-24GB) | Poolside says Laguna XS 2.1 runs on a Mac with 36GB of RAM. Qwen3.6 35B-A3B reports a higher SWE-bench Verified score (73.4 vs 70.9) on Poolside’s own comparison table. |
| 64GB+ | Qwen3-Coder-Next (52GB at Q4_K_M) | Qwen3.8 27B at higher quantization | 80B total parameters with 3B active. It reports 70.6 on SWE-bench Verified and 44.3 on SWE-bench Pro. |
Two honest gaps. First, the 12GB row is a non-answer, because the model families in this table have a hole between 9B and 24B. Second, the two 3B-active MoE models at the 36GB+ tier don’t beat the dense 27B Qwen on the SWE-bench Pro numbers their cards report: 49.5 for Qwen3.6 35B-A3B and 47.6 for Laguna XS 2.1, versus 61.7 for Qwen3.8 27B. If you have 24GB, you may not need more memory.
A third gap is the 16GB row. Several community reports run Qwen3.8 27B on 16GB cards at Q2 or Q3 with long contexts (see “What do developers report in practice?” below), which this table does not list because those quants are not the default downloads. If you choose that route, expect lower quality than the Q4 builds the vendor scores describe.
What about Macs with unified memory?
On a Mac, the GPU and CPU share one memory pool, so the whole download must fit alongside macOS and your editor. Ollama publishes MLX builds, Apple’s native format, for the Qwen line: qwen3.8:27b-mlx is 18GB, the same size as the default build. Poolside states that Laguna XS 2.1 is “compact enough to run on a Mac with 36 GB of RAM.”
A reasonable mapping from the table above: 16GB Macs use the 9B tier, 24GB Macs are borderline for the 27B, 32-36GB Macs are comfortable with Qwen3.8 27B or Laguna XS 2.1, and 64GB Macs can load Qwen3-Coder-Next. Treat that as a starting point and confirm on your machine, because other applications compete for the same pool.
What do developers report in practice?
Community reports on Hacker News say Qwen3.8 27B is usable on 16GB cards, but only at 2- and 3-bit quants, and that a smaller MoE model often matches it for agent work. These are single-user reports on unspecified prompts, not controlled tests, and none has been independently verified. They are useful because they state hardware and quant, which the model cards don’t.
| Setup (as reported) | Report | Source |
|---|---|---|
| RTX 5070 Ti 16GB, Qwen3.8 27B UD-Q2_K_XL, 128k context, 4-bit KV cache | 50-60 tokens/sec, quality judged well above Qwen3.6 27B | HN, Aug 14 |
| RTX 5080 16GB, UD-Q3_K_XL | 46 tokens/sec, good enough for systems work where the model can test its own output | HN, Oct 8 |
| 2016 Pascal GPU, 16GB, 100k context, q8 cache | Usable at Q2, Q3 is close to Q4 in feel but too slow on that card | HN, Oct 4 |
| RTX 3080 20GB, UD-Q4_K_XL, KV cache offloaded to RAM | 10 tokens/sec at first, 5 at 50k context | HN, Aug 29 |
Three patterns repeat. First, a 16GB card runs the 27B only below Q4. One commenter argues that Q4 variants leave too little room for a useful context on 16GB (HN). Second, quality at low bit depth is a judgment call: one user calls a 2-bit quant much better than the previous generation, another finds the drop from Q4 noticeable even at Q2 versus Q3. Third, the 3B-active MoE is a real alternative. One user running agentic work on systems under 24GB VRAM prefers Qwen3.6 35B-A3B, with experts offloaded to system RAM, and reports that the dense 27B gave comparable results while taking about 1.2 to 2 times longer per task, because it runs more test attempts and compactions (HN). That fits the benchmark gap noted above.
Reliability is the other recurring complaint. A user who tried Qwen3.6-35B-A3B and Qwen3.8-Flash-Next in an agent harness said they could complete tasks but failed often enough to be unusable, and asked how others route work between local and hosted models (HN). A more positive account describes leaving Qwen3.8 27B running an agent loop at the end of the day and keeping the useful pieces (HN). The practical reading: treat a local agent as an overnight draft generator you review, not as an unattended committer.
Which benchmarks matter for coding, and what do they miss?
Prefer SWE-bench Pro and Terminal-Bench over SWE-bench Verified, and check which harness produced the number. Among the models whose cards report SWE-bench Pro, the dense 27B leads:
The scores you will see most:
- SWE-bench Verified: real GitHub issues, 500 tasks. OpenAI reported that it stopped using the benchmark and, per AI Weekly’s summary, that an audit of 138 of the hardest tasks found 59.4% had material issues in test design or problem descriptions. Qwen3.8’s card doesn’t list it and leads with SWE-bench Pro instead.
- SWE-bench Pro: a harder, multi-repository successor from Scale AI. It is not settled either: the same article notes a May 2026 audit claimed its graders mis-graded about a third of trials, which Scale AI had not confirmed.
- LiveCodeBench: competitive-programming style problems, which test algorithms more than repository work. A high score doesn’t mean a model can navigate your codebase.
- Aider polyglot: a useful edit-focused test, but Aider’s leaderboard was last updated on November 20, 2025. It lists DeepSeek-V3.2-Exp at 74.2% as its best open-weight entry and none of the models in this article.
The bigger problem is the harness. Qwen’s card says its numbers use specific settings, such as the Claude Code harness at temperature 1.0. A score is a property of the model plus the scaffold around it, and your editor plugin is a different scaffold. Run your own repository through any shortlisted model before committing.
Agentic coding vs autocomplete: do you need different models?
Yes, in practice. Autocomplete needs low latency on short contexts, so small and fast models win. Agentic work, where a model reads files, runs commands and edits across a repository, needs long context and reliable tool calls.
The model cards line up with this split. Devstral Small 2 ships alongside Mistral’s Vibe CLI. Qwen3-Coder-Next and Laguna XS 2.1 are pitched at agents, with Poolside describing Laguna as built for agentic coding on local hardware. For autocomplete, the 9B tier is the realistic choice because the download leaves memory free for an editor. The cards report no vendor tokens-per-second figures, so this article gives none. For Qwen-specific setup, see the Qwen Coder local guide.
How do local models compare with hosted frontier models?
Local models have closed much of the gap on published agentic benchmarks, but not all of it. Qwen’s own table for Qwen3.8 27B lists Claude Opus 4.6 (Max) at 78.2 on Terminal-Bench 2.1 against 73.0 for the local model, and 53.4 on SWE-bench Pro against 61.7. Those are the vendor’s numbers, run by the vendor. The trade-offs that decide the choice are privacy, cost at volume and refusal behavior rather than a single score. See local LLM vs Claude for coding for the full comparison. If your concern is over-refusal on security tooling, how to run an uncensored LLM locally covers that separately; the license terms of the base model still apply either way.
FAQ
What is the best local LLM for coding on 16GB VRAM?
Devstral Small 2 at 15GB, which Mistral reports at 68.0% on SWE-bench Verified under Apache-2.0. It leaves little headroom for context, so gpt-oss-20b (14GB, runs within 16GB per its card) is the safer second choice.
What is the best open-source LLM to run locally for coding agents?
At 24GB, Qwen3.8 27B, which reports 73.0 on Terminal-Bench 2.1 and 61.7 on SWE-bench Pro. At 64GB or more, Qwen3-Coder-Next is the larger agentic option. All scores are vendor-reported.
Is a local LLM good enough to replace a hosted coding assistant?
For autocomplete, often yes. For long agentic tasks, the published numbers are close but vendor-run and harness-dependent, so test one of your own tasks before switching.
Which benchmark should I trust when comparing local coding models?
None alone. Prefer SWE-bench Pro and Terminal-Bench, check the harness, and note that SWE-bench Verified has known test-quality problems.
Are these models free for commercial use?
Six of the seven are Apache-2.0, which allows commercial use. Laguna XS 2.1 uses OpenMDW-1.1, which Poolside describes as permissive for commercial products. Read each license before you ship.
Sources (10)
- Qwen3.8-27B model card, Hugging Face (Qwen)
- Qwen3.6-35B-A3B model card, Hugging Face (Qwen)
- Devstral-Small-2-24B-Instruct-2512 model card, Hugging Face (Mistral AI)
- Laguna XS 2.1 model card, Hugging Face (Poolside)
- Qwen3-Coder-Next model card, Hugging Face (Qwen)
- Qwen3.5-9B model card, Hugging Face (Qwen)
- qwen3.8 tags and sizes, Ollama library
- OpenAI drops SWE-Bench Verified, backs Pro after flaw audit, AI Weekly
- Hacker News comment: Qwen3.8 27B at 2-bit on a 16GB RTX 5070 Ti, 128k context
- Hacker News comment: Qwen3.6 35B-A3B vs dense Qwen3.8 27B for agentic work