Skip to main content
PromptQuorumBuilt for humans. Structured for AI.
Home/Local LLMs
Best Models

Best Local LLMs for Coding 2026: Qwen3.8 27B, Devstral, Laguna

·9 min readBy · Founder of PromptQuorum · Discovery engine for open-weight & open-source AI

The best local LLM for coding in 2026 is Qwen3.8 27B (Alibaba, Apache 2.0, dense 27B): Qwen reports 61.7 on SWE-bench Pro, and it runs in 18 GB with a 256K context window via `ollama run qwen3.8`. Devstral Small 2 (24B, 15 GB) is the best agentic-coding model for 16 GB machines, Laguna XS 2.1 (Poolside, 20 GB) targets long-horizon agentic sessions, Codestral 22B remains the FIM pick for IDE autocomplete, and Qwen3 8B is the pick for 8 GB RAM. Kimi K2.6 and Kimi K2.7 Code are the largest open coders, but at 1T parameters they are cloud-only on Ollama and need roughly 300 GB or more of memory to run locally. SWE-bench Pro and SWE-bench Verified are the primary benchmarks; scores are vendor-reported on different harnesses, so read them as directional.

Key Takeaways

  • Best overall local coding model: Qwen3.8 27B — dense 27B, Apache 2.0, 18 GB download, 256K context, 61.7 SWE-bench Pro and 90.3 LiveCodeBench v6 (Qwen-reported). `ollama run qwen3.8`.
  • Best for agentic coding on 16 GB: Devstral Small 2 (Mistral AI) — 24B, 15 GB, 65.8% SWE-bench Verified (Mistral-reported), built for tool calling and multi-file edits.
  • Best for long-horizon agentic sessions: Laguna XS 2.1 (Poolside) — 33B total / 3B active MoE, 20 GB, 256K context, OpenMDW-1.1 license.
  • Best for IDE autocomplete: Codestral 22B (Mistral AI) — FIM-optimized, 13 GB, native Continue.dev support.
  • Best for 8 GB RAM: Qwen3 8B — 5 GB VRAM used, best quality-speed tradeoff at this tier.
  • Kimi K2.6 and K2.7 Code are not a consumer-hardware pick: both are 1T-parameter models that Ollama lists only as cloud tags; local runs need roughly 300 GB or more of memory.
  • SWE-bench Pro and Verified replace HumanEval as the primary benchmarks — they test real GitHub issue resolution, not single-function Python generation. Vendor-reported scores use different harnesses and are directional, not head-to-head.
  • For AI coding assistant workflows (VS Code, Cursor), see Local LLMs for Coding Workflows.

📍 In One Sentence

The best local coding LLM in 2026 is Qwen3.8 27B (Apache 2.0, 18 GB, 61.7 SWE-bench Pro as reported by Qwen) for a 24 GB GPU or 32 GB Mac, with Devstral Small 2 for agentic coding on 16 GB and Qwen3 8B for 8 GB.

💬 In Plain Terms

SWE-bench measures how well an AI fixes real GitHub bugs — higher is better. A "dense" model like Qwen3.8 27B uses all of its parameters for every token, which keeps behavior predictable; the huge Kimi models are "mixture-of-experts" models that still need hundreds of gigabytes of memory to hold their weights.

Qwen3.8 27B (Alibaba, Apache 2.0) is the best local LLM for coding on a single 24 GB GPU or a 32 GB Mac in 2026: Qwen reports 61.7 on SWE-bench Pro and 90.3 on LiveCodeBench v6, and it runs as an 18 GB download with a 256K context window (`ollama run qwen3.8`). Devstral Small 2 (24B, 15 GB) is the pick for agentic coding on 16 GB, Laguna XS 2.1 (Poolside, 20 GB) for long-horizon sessions, and Qwen3 8B for 8 GB machines. Kimi K2.6 and Kimi K2.7 Code are 1T-parameter models: Ollama lists them only as cloud tags, and local runs need roughly 300 GB or more of memory.

Slide Deck: Best Local LLMs for Coding 2026: Qwen3.8 27B, Devstral, Laguna

Interactive 14-slide presentation covering: what makes a good coding LLM, reported SWE-bench Pro and Verified scores, hardware-matched model selection (8 GB, 16 GB, 24 GB+), Qwen3.8 27B, Devstral Small 2, Laguna XS 2.1, Codestral 22B and Qwen3 8B, why Kimi K2.6 is not a local pick, and IDE integration with Continue.dev. Download the reference card as PDF.

Browse the slides below or download as PDF for offline reference. Download Reference Card (PDF)

Best Local LLMs for Coding 2026: Qwen3.8 27B, Devstral, Laguna

Quick Facts — Local Coding LLMs at a Glance

  • Best overall: Qwen3.8 27B (Alibaba) — dense 27B, Apache 2.0, 18 GB on Ollama, 256K context, 61.7 SWE-bench Pro, 90.3 LiveCodeBench v6 (Qwen-reported).
  • Previous Qwen generation: Qwen 3.6 27B — 77.2% SWE-bench Verified and 53.5 SWE-bench Pro (Qwen-reported); still a solid fallback, superseded by Qwen3.8 27B.
  • Best for agentic coding at 24B: Devstral Small 2 (Mistral AI, France) — 15 GB, 65.8% SWE-bench Verified, Apache 2.0, tool calling and multi-file edits. Requires Ollama 0.13.3 or later.
  • Best for long-horizon agentic sessions: Laguna XS 2.1 (Poolside) — 33B total / 3B active MoE, 20 GB, 256K context, SWE-bench Verified 70.9%, SWE-bench Multilingual 63.1%, OpenMDW-1.1 license.
  • Best large MoE for 64 GB machines: Qwen3-Coder-Next — 80B total / 3B active, 52 GB Q4, 256K context.
  • Best for IDE autocomplete: Codestral 22B (Mistral) — FIM-optimized, Continue.dev integration, 13 GB, 32K context.
  • Best for 8 GB RAM: Qwen3 8B — 5 GB VRAM used, best quality-speed tradeoff.
  • Frontier-scale open weights: Kimi K2.6 and Kimi K2.7 Code (Moonshot AI) — 1T total / 32B active MoE, 256K context. Ollama offers only `:cloud` tags; local GGUF builds need about 310–470 GB depending on quantization.
  • Benchmark shift: SWE-bench Pro and Verified (real GitHub issues) are the primary metrics for practical coding. HumanEval (single Python functions) is still useful for small-model comparison.
  • Recommended setup: 24 GB GPU or 32 GB unified memory (runs Qwen3.8 27B; macOS keeps about 8 GB of a Mac's memory); 16 GB is enough for Devstral Small 2.

🏆 Best Local LLMs for Coding (Quick Picks)

  • Best overall: Qwen3.8 27B — dense 27B, 18 GB, 256K context, 61.7 SWE-bench Pro (Qwen-reported). `ollama run qwen3.8`
  • Best for agentic coding at 24B: Devstral Small 2 — multi-file edits, tool calling, 15 GB. `ollama run devstral-small-2`
  • Best for long-horizon agentic coding: Laguna XS 2.1 — 33B/3B active MoE, 20 GB, 256K context. `ollama run laguna-xs-2.1`
  • Best large MoE (64 GB machines): Qwen3-Coder-Next — 80B/3B active, 52 GB. `ollama run qwen3-coder-next`
  • Best for repository-aware completion on 24 GB: Qwen3-Coder 30B — 30B/3.3B active MoE, 19 GB, 256K context. `ollama run qwen3-coder:30b`
  • Best for IDE autocomplete: Codestral 22B — FIM-optimized for Continue.dev, 13 GB. `ollama run codestral:22b`
  • Best for 8 GB RAM: Qwen3 8B — 5 GB VRAM. `ollama run qwen3:8b`
  • 👉 If unsure: use Qwen3 8B on 8–16 GB laptops, Qwen3.8 27B on a 24 GB GPU or a 32 GB Mac.
  • 👉 If you have 16 GB: Devstral Small 2 is the best agentic fit; Qwen3.8 27B (18 GB) needs a 24 GB card or a 32 GB Mac.
  • 👉 If you need long agentic sessions: try Laguna XS 2.1 or Devstral Small 2.
  • 👉 If you need IDE completion: use Codestral 22B with Continue.dev.

🛠️Practice: Match model size to your hardware first. With 8 GB, use Qwen3 8B. With 16 GB, use Devstral Small 2. With a 24 GB GPU or a 32 GB Mac, use Qwen3.8 27B. Kimi K2.6 and K2.7 Code are not practical local picks: Ollama offers them only as cloud tags and local builds need 300 GB or more.

In One Sentence

The best local coding LLM in 2026 is Qwen3.8 27B (18 GB, 61.7 SWE-bench Pro as reported by Qwen), with Devstral Small 2 for agentic coding on 16 GB, Laguna XS 2.1 for long-horizon sessions, Codestral 22B for IDE autocomplete, and Qwen3 8B for 8 GB RAM.

In Plain Terms

Running a coding model locally is like installing an AI coding assistant on your laptop — it keeps your code private, works offline, but is slower than cloud APIs like GitHub Copilot.

What Makes a Local LLM Good for Coding?

In 2026, SWE-bench Pro and SWE-bench Verified have largely replaced HumanEval as the primary practical coding benchmarks. They test the model's ability to resolve real GitHub issues — multi-file changes, understanding codebases, writing tests — not just generating single functions. Qwen reports 61.7 on SWE-bench Pro for Qwen3.8 27B and 77.2% on SWE-bench Verified for the earlier Qwen 3.6 27B.

Code-specific models are fine-tuned on large code corpora (GitHub, Stack Overflow, documentation) and often include fill-in-the-middle (FIM) training -- the ability to complete code given both the preceding and following context, which is required for IDE autocomplete.

General-purpose models like Llama 3.1 8B score 72% on HumanEval, which is competitive. But dedicated coding models at the same size score 5-15% higher because their training data and fine-tuning prioritize code generation accuracy over general language tasks.

📌Note: Vendor-reported SWE-bench scores use different agent harnesses, task sets and settings (Qwen's 61.7 SWE-bench Pro uses the Claude Code harness with corrected tasks), so two published numbers are directional, not a head-to-head test. HumanEval remains useful for single-function comparison, but SWE-bench better predicts development workflow performance.

#1 Qwen3.8 27B — Best Overall Local Coding LLM

Qwen3.8 27B (Alibaba, released August 2026) is the best local coding LLM for a 24 GB GPU or a 32 GB Mac. It is a dense 27B model (all parameters active per token) under Apache 2.0. Qwen reports 61.7 on SWE-bench Pro, 73.0 on Terminal Bench 2.1 and 90.3 on LiveCodeBench v6. The Ollama download is 18 GB with a 256K context window.

`ollama run qwen3.8`. It accepts text and images, supports tool calling and thinking mode, and handles multi-file analysis, debugging and refactoring. Qwen reported 53.5 on SWE-bench Pro for the previous Qwen 3.6 27B (77.2% on SWE-bench Verified); `ollama run qwen3.6:27b` remains a valid fallback.

Spec
Value
SWE-bench Pro61.7 (Qwen-reported)
LiveCodeBench v690.3 (Qwen-reported)
ArchitectureDense (all 27B active)
Ollama size (Q4_K_M)18 GB
Context window256K tokens
LicenseApache 2.0
Ollama commandollama run qwen3.8

🔍Insight: Qwen runs SWE-bench Pro with the Claude Code harness and a refined task set with corrected problem tasks, so 61.7 is not directly comparable with other vendors' published scores. Treat it as a strong, vendor-reported signal, not a head-to-head test.

#2 Devstral Small 2 — Best for Agentic Coding at 24B

Devstral Small 2 (Mistral AI) is purpose-built for agentic coding workflows — multi-file edits, code generation with tool calling, and debugging loops. 24B parameters, 15 GB on Ollama, 65.8% on SWE-bench Verified (Mistral-reported), Apache 2.0. `ollama run devstral-small-2` (requires Ollama 0.13.3 or later).

Best choice for developers using aider, Claude Code-style workflows, or multi-step code modifications on a 16 GB machine. It reads error feedback, edits across files and supports image input.

Spec
Value
SWE-bench Verified65.8% (Mistral-reported)
Best forAgentic workflows, multi-file edits
Ollama size15 GB
Context window384K tokens (Ollama)
LicenseApache 2.0
Ollama commandollama run devstral-small-2

💡Tip: Agentic coding = reason → write code → run → observe errors → fix → iterate. Devstral Small 2 handles this loop at a 15 GB footprint, which makes it the practical agentic pick for 16 GB machines where Qwen3.8 27B (18 GB) does not fit.

#3 Laguna XS 2.1 and Qwen3-Coder-Next — Long-Horizon Agentic Coding

Laguna XS 2.1 (Poolside, July 2, 2026) targets long-horizon agentic coding. 33B total / 3B active MoE, 256K context, OpenMDW-1.1 license, SWE-bench Verified 70.9% and SWE-bench Multilingual 63.1%. The Ollama default is 20 GB (Q4_K_M). `ollama run laguna-xs-2.1`.

Qwen3-Coder-Next (Alibaba, February 2026) is the larger MoE option for 64 GB machines: 80B total / 3B active parameters, 52 GB at Q4_K_M, 256K context. `ollama run qwen3-coder-next`. For a smaller repository-aware coder on 24 GB, `ollama run qwen3-coder:30b` (30B total / 3.3B active, 19 GB, Apache 2.0) is the established alternative.

If you want the largest context window for multi-hour agentic sessions, pick Laguna XS 2.1; if you want an EU-origin, Apache 2.0 model at a smaller footprint, choose Devstral Small 2.

Spec
Value
Laguna XS 2.1 size20 GB (33B total / 3B active)
Laguna XS 2.1 SWE-bench70.9% Verified / 63.1% Multilingual
Qwen3-Coder-Next size52 GB (80B total / 3B active)
Context window256K tokens (both)
Ollama commandslaguna-xs-2.1 / qwen3-coder-next

🔍Insight: MoE models store all parameters in memory but compute with only a few billion per token, so they generate quickly for their size while still needing RAM for the full weights (20 GB for Laguna XS 2.1, 52 GB for Qwen3-Coder-Next).

#4 Codestral 22B — Best for IDE Autocomplete

Codestral 22B (Mistral AI) remains the dedicated FIM model for IDE autocomplete. Purpose-built for fill-in-the-middle completion with Continue.dev in VS Code and Cursor. It is the oldest model on this page (the Ollama build is about two years old) and still the most FIM-focused option.

`ollama run codestral:22b`. Trained for IDE-style completion where context comes from both before and after the cursor. Strong on Python, JavaScript, TypeScript, Go, and Rust. The Ollama build has a 32K context window.

For repository-aware completion, `ollama run qwen3-coder:30b` is the strongest open-weight alternative (Apache 2.0, 19 GB). For a small reasoning-capable coder on 16 GB, `ollama run gpt-oss:20b` (OpenAI open-weight, 21B total / 3.6B active MoE, adjustable reasoning) is also a solid pick.

Spec
Value
Best forFIM (IDE autocomplete)
Ollama size13 GB
Context window32K tokens
FIM supportYes (primary use case)
IDE integrationContinue.dev, Cursor
Ollama commandollama run codestral:22b

🔍Insight: Codestral 22B from Mistral AI is built specifically for FIM (fill-in-the-middle) completion. Combined with Continue.dev, it provides a local alternative to GitHub Copilot autocomplete.

#5 Qwen3 8B — Best Coding Model for 8 GB RAM

Qwen3 8B is the 8 GB tier recommendation for coding. Strong coding performance, multilingual, uses only 5 GB VRAM. Qwen3.8 currently ships only as a 27B model on Ollama, so Qwen3 8B remains the smallest current Qwen pick. For detailed guidance on VRAM requirements for other coding models, see the VRAM requirements guide →. `ollama run qwen3:8b`.

🔍Insight: Qwen3 8B is the recommended starting point for 8 GB machines: strong multilingual support, fast inference, and good code quality on real-world tasks.

Why Kimi K2.6 and K2.7 Code Are Not a Practical Local Pick

Kimi K2.6 and Kimi K2.7 Code (Moonshot AI) are the largest open-weight coding models on this list, but they are not a consumer-hardware pick. Both are 1T-parameter MoE models with 32B active parameters and a 256K context window. Moonshot AI reported 58.6 on SWE-bench Pro for Kimi K2.6; Kimi K2.7 Code builds on K2.6 for long-horizon coding sessions.

On Ollama, both are listed only as cloud tags (`kimi-k2.6:cloud`, `kimi-k2.7-code:cloud`), which send your prompts to Ollama's hosted service. Running them locally means a community GGUF build: Unsloth lists about 310 GB for 1-bit and 325–350 GB for 2-bit quantization of K2.7 Code, so they fit workstation or server hardware, not laptops.

⚠️Warning: A `:cloud` tag is not local inference. If privacy is the reason you want a local model, use Qwen3.8 27B, Devstral Small 2 or Laguna XS 2.1 instead.

How Do Coding Models Compare? SWE-bench + HumanEval

Model
HumanEval
SWE-bench
RAM
FIM
Qwen3.8 27B—61.7 (Pro)18 GB—
Qwen 3.6 27B—77.2% (Verified) / 53.5 (Pro)~22 GB—
Devstral Small 2—65.8% (Verified)15 GB—
Laguna XS 2.1 (MoE)—70.9% (Verified)20 GB (3B active)—
Qwen3-Coder-Next (MoE)—varies by scaffold52 GB (3B active)—
Kimi K2.6 (MoE)—58.6 (Pro)300+ GB (cloud on Ollama)—
Codestral 22B——13 GBYes (primary)
Qwen2.5-Coder 32B——20 GBYes
Qwen3 8B——5 GBYes
DeepSeek-R1 14B——10 GBNo
Vendor-reported benchmark scores by model: Qwen3.8 27B 61.7 SWE-bench Pro, Qwen 3.6 27B 77.2% SWE-bench Verified, Laguna XS 2.1 70.9% SWE-bench Verified, Devstral Small 2 65.8% SWE-bench Verified, Kimi K2.6 58.6 SWE-bench Pro. Harnesses and task sets differ, so compare within a column only.
Vendor-reported benchmark scores by model: Qwen3.8 27B 61.7 SWE-bench Pro, Qwen 3.6 27B 77.2% SWE-bench Verified, Laguna XS 2.1 70.9% SWE-bench Verified, Devstral Small 2 65.8% SWE-bench Verified, Kimi K2.6 58.6 SWE-bench Pro. Harnesses and task sets differ, so compare within a column only.

📌Note: HumanEval measures single-function Python generation. SWE-bench measures real-world multi-file code changes. "Pro" and "Verified" are different SWE-bench variants and are not interchangeable: a 77.2% Verified score and a 61.7 Pro score cannot be compared directly. All scores are vendor-reported. HumanEval figures for older models (Qwen2.5-Coder 32B, Qwen3 8B) are carried over from earlier versions of this page and have not been re-verified.

Which Model Fits Which Coding Task?

  1. 1
    Python function debugging and multi-file refactoring -- Qwen3.8 27B is the first choice: a dense model keeps all 27B parameters active per token, which suits multi-file reasoning. Devstral Small 2 is the lighter alternative when only 16 GB is available. Pick: Qwen3.8 27B.
  2. 2
    Agentic loops (plan → edit → run tests → fix) -- Devstral Small 2 and Laguna XS 2.1 were built for tool calling and long sessions. Laguna XS 2.1 offers a 256K context window; Devstral Small 2 uses less memory. Pick: Laguna XS 2.1 for long sessions, Devstral Small 2 for 16 GB machines.
  3. 3
    FIM / IDE autocomplete (VS Code) -- Fill-in-the-middle needs a model trained for it. Codestral 22B and Qwen3 8B work through Continue.dev; Kimi models, Laguna and Devstral are not FIM-focused. Pick: Codestral 22B.
  4. 4
    Quick scripting on 8 GB laptops -- Qwen3 8B handles everyday scripts, SQL and boilerplate at low latency. Expect weaker results on large type systems and multi-file changes. Pick: Qwen3 8B.

🔍Insight: Larger models score higher on SWE-bench-style tasks (multi-file debugging and refactoring) than 8B models; for everyday scripting the gap narrows. Match the model to the task, then to your memory budget.

Which Coding Model Balances Speed and Output Quality Best?

Task
Qwen3.8 27B
Devstral Small 2
Qwen3 8B
Codestral 22B
Multi-file refactoring, debuggingFirst choice (dense, 18 GB)Good (15 GB)Limited on large changesNot its focus
Agentic loops with tool callingStrong (tools, thinking)Built for itBasicNot its focus
Boilerplate, REST APIs, testsStrong, slowerStrongFast, check validationFast, generic
FIM autocomplete (cursor mid-line)Not its focusNot its focusSupportedBest fit (FIM)

💡Tip: Key insight: The 18 GB and 15 GB models are slower per token than 8B models but more accurate on reasoning-heavy tasks. For IDE autocomplete, use FIM-optimized models only (Codestral 22B, Qwen3 8B). Throughput depends on your GPU, quantization and context length, so benchmark on your own machine.

🛠️Practice: Practical recommendation: Choose by task type. For batch code generation or refactoring reviews, use Qwen3.8 27B. For agentic loops on 16 GB, use Devstral Small 2. For real-time IDE autocomplete, use Codestral 22B or Qwen3 8B, where latency matters most.

Which Local Coding LLM Should You Use?

The model you choose matters, but how you prompt it matters more for code quality. Structured prompting techniques — specifying language, constraints, test cases, and output format — dramatically improve code generation accuracy. The prompt engineering guide covers 80 techniques across fundamentals, frameworks, and evaluation methods.

For a complete IDE workflow built around these models, see Replace GitHub Copilot With a Local LLM — the open-source stack (Continue.dev + Ollama + Qwen3-Coder) that pairs cleanly with the picks above.

  • 8 GB RAM, coding focus: `ollama run qwen3:8b` -- 5 GB VRAM used, best model for this tier.
  • 16 GB RAM: `ollama run devstral-small-2` -- best for agentic coding at 24B (multi-file edits, debugging loops), 15 GB.
  • 24 GB GPU or 32 GB Mac (best quality): `ollama run qwen3.8` -- Qwen3.8 27B, 18 GB, 61.7 SWE-bench Pro (Qwen-reported).
  • Long-horizon agentic sessions: `ollama run laguna-xs-2.1` -- 20 GB, 256K context, SWE-bench Verified 70.9%.
  • 64 GB machines: `ollama run qwen3-coder-next` -- 80B MoE with 3B active, 52 GB.
  • IDE autocomplete in VS Code: `ollama run codestral:22b` via Continue.dev -- FIM-optimized, best local Copilot alternative.
Hardware-matched model selection: 8 GB RAM → Qwen3 8B (5 GB VRAM); 16 GB RAM → Devstral Small 2 (15 GB, agentic coding); 24 GB GPU or 32 GB Mac → Qwen3.8 27B (18 GB, 61.7 SWE-bench Pro, Qwen-reported); long-horizon agentic sessions → Laguna XS 2.1 (20 GB, 256K context).
Hardware-matched model selection: 8 GB RAM → Qwen3 8B (5 GB VRAM); 16 GB RAM → Devstral Small 2 (15 GB, agentic coding); 24 GB GPU or 32 GB Mac → Qwen3.8 27B (18 GB, 61.7 SWE-bench Pro, Qwen-reported); long-horizon agentic sessions → Laguna XS 2.1 (20 GB, 256K context).

🛠️Practice: Match model size to your hardware first, then optimize for your use case. If you have 8 GB, Qwen3 8B is the best choice. With 16 GB, use Devstral Small 2. With 24 GB or more, use Qwen3.8 27B. Better to have a model that runs well than the perfect model that struggles.

Best Coding LLMs for 8 GB VRAM (RTX 3060 12GB / RTX 3070 8GB / RX 6800 16GB)

On machines with 8 GB RAM, Qwen3 8B is the best choice for coding — it needs only 5 GB VRAM, leaving 3 GB for your IDE, browser, and other applications. Qwen3 8B includes FIM (fill-in-the-middle) support for VS Code autocomplete via Continue.dev.

  • Qwen3 8B (recommended) — 5 GB VRAM, 20–35 tok/sec, FIM support. `ollama run qwen3:8b`
  • Phi-4 Mini 3.8B — 68% MMLU (reasoning), 2.5 GB VRAM, best for lightweight inference. `ollama run phi4-mini`
  • Llama 3.2 3B — 40–60 tok/sec, 2.5 GB VRAM, good fallback for very constrained setups. `ollama run llama3.2:3b`

Best Coding LLMs for 16 GB VRAM (RTX 4070 Ti 16GB / RTX 5070 Ti 16GB / 24 GB cards)

With 16 GB, Devstral Small 2 (15 GB) is the best fit for agentic coding. Qwen3.8 27B (18 GB download) needs a 24 GB GPU or a 32 GB unified-memory Mac; it is the best choice when you have that headroom.

  • Devstral Small 2 — best for agentic coding, tool calling, multi-file edits, 15 GB. `ollama run devstral-small-2`
  • Qwen3.8 27B — best overall, dense 27B, 18 GB, 256K context, fits a 24 GB card. `ollama run qwen3.8`
  • Qwen3-Coder 30B — 30B/3.3B active MoE, 19 GB, repository-aware completion on a 24 GB card. `ollama run qwen3-coder:30b`

Best Coding LLMs for 6 GB VRAM (Budget GPUs / Integrated Graphics)

For machines with 4–6 GB VRAM (budget GPUs, older laptops, Intel iGPU), Phi-4 Mini 3.8B is the best choice — it achieves 68% MMLU reasoning performance while using only 2.5 GB VRAM. This leaves ~3.5 GB for your system.

  • Phi-4 Mini 3.8B (recommended) — 68% MMLU reasoning, 2.5 GB download, excellent for logic and debugging. `ollama run phi4-mini`
  • Qwen3 4B — smaller variant, 4 GB VRAM, balanced quality-speed for budget hardware. `ollama run qwen3:4b`

🧭 Who Should Use What: Personas and Recommendations

  • Beginner (no local LLM experience): LM Studio + Qwen3 8B -- GUI, no terminal needed, includes FIM for code completion, 5 GB VRAM.
  • Laptop developer (8–16 GB RAM, everyday coding): Ollama + Qwen3 8B (8 GB machines) or Devstral Small 2 (16 GB machines) -- balanced quality and performance, runs smoothly for hours.
  • Advanced developer (debugging, refactoring, complex reasoning, 24 GB+): Ollama + Qwen3.8 27B (dense model, 18 GB) -- handles multi-file context and algorithm design.
  • Long-horizon agentic sessions (plan → code → test → iterate): Ollama + Laguna XS 2.1 (256K context, SWE-bench Verified 70.9%) or Devstral Small 2 -- built for tool calling and multi-step runs.
  • IDE-first workflow (VS Code, Cursor, JetBrains): Continue.dev + Codestral 22B -- FIM-optimized for in-editor code completion at cursor position, best local Copilot alternative.
  • Privacy-critical environments (GDPR, HIPAA, proprietary code): Any local model above via Ollama (not a `:cloud` tag) -- no external API calls for inference, so your code stays on your machine as long as your editor plugins and other tools also make no network calls.

⚠️Warning: ❌ Avoid: Running Qwen3.8 27B (18 GB) on machines without a 24 GB GPU or a 32 GB Mac. Once the model spills into system RAM, speed falls sharply. Use Qwen3 8B or Devstral Small 2 on smaller machines.

⚠️Warning: ❌ Avoid: Using general-purpose models (Llama 3.1 8B) when you need IDE autocomplete. Only code-specific models with FIM support work for in-editor completion -- Codestral 22B, Qwen3 8B.

🔍Insight: Beginner → intermediate → advanced is also a progression in hardware requirements. Start with Qwen3 8B (8 GB), upgrade to Devstral Small 2 (16 GB) as you add tools and workflows, and move to Qwen3.8 27B (24 GB+) when you need maximum reasoning quality.

❌ When NOT to Use Local LLMs for Coding

  • You need latest framework knowledge (2025+ APIs): Local models are trained on fixed cutoff dates, so they can miss APIs released after training. For recent framework versions, supply the current documentation in the prompt or use a frontier cloud model such as GPT-5.6 or Claude Sonnet 5.
  • You need multi-file reasoning across large codebases (100k+ tokens): Local models degrade on very long context. Latency becomes prohibitive. Cloud models (GPT-5.6, Claude) handle 100k+ token contexts natively. For architectural refactoring of entire services, use cloud models.
  • Latency must be <300ms (real-time interactive coding): Local models run at 15-25 tokens/sec on CPU (typical laptops), producing a 5-10 second delay per response. GitHub Copilot and Claude in IDE complete suggestions in <1 second. For keystroke-level autocomplete, local models are too slow.
  • You need best-in-class debugging accuracy: On complex debugging tasks (tracing multiple function call stacks, identifying subtle type errors), frontier cloud models such as GPT-5.6 and Claude Sonnet 5 generally still lead local models on real-world code issues. Local models are strong at generation; frontier models tend to be stronger at diagnosis.
  • You cannot tolerate hallucination in generated code: Smaller local models can generate syntactically valid but logically incorrect code on complex tasks, and larger cloud models are generally more reliable. For mission-critical code (payment systems, security), require human review of all generated code.

🔍Insight: 👉 Local LLMs are best for: Privacy + offline work + cost control — NOT for peak performance. If maximum accuracy matters more than these three factors, use cloud APIs.

📊 Best Local LLMs for Coding Compared (Decision Matrix)

Unsure which coding model to pick? PromptQuorum lets you send one prompt to multiple models simultaneously (Qwen3.8, Devstral, GPT-5.6, Claude) and see side-by-side outputs, real response times, and accuracy on YOUR code. Try PromptQuorum free — 5 minutes, no signup.

Model
Best For
VRAM
Speed
Strength
When to Pick
Qwen3.8 27BBest overall, multi-file reasoning~18 GBdepends on GPU61.7 SWE-bench Pro (Qwen-reported), dense 27B, 256K context, Apache 2.0You have a 24 GB GPU or 32 GB Mac and want the best local quality
Devstral Small 2Agentic coding workflows at 24B~15 GBdepends on GPU65.8% SWE-bench Verified (Mistral-reported), tool calling, multi-file edits, Apache 2.0You use aider, multi-step workflows, or Claude Code-style agents on 16 GB
Laguna XS 2.1Long-horizon agentic coding~20 GB (3B active)depends on GPUSWE-bench Verified 70.9%, 256K context, 33B total/3B active MoE, OpenMDW-1.1 licenseYou run multi-hour agentic sessions and need a 256K context window
Qwen3-Coder-NextLarge MoE on 64 GB machines~52 GB (3B active)depends on GPU80B total/3B active MoE, 256K contextYou have 64 GB of unified memory and want a larger coder
Codestral 22BIDE autocomplete (VS Code, Cursor)~13 GBdepends on GPUFIM-optimized, best local Copilot alternative, Continue.dev nativeYou want keystroke-level IDE autocomplete via Continue.dev
Qwen3 8BLaptop coding, best for 8 GB RAM~5 GBfastest in this listImproved coding, FIM support, multilingualYou have 8 GB RAM and want the best local coding model for that tier
Kimi K2.6 / K2.7 CodeFrontier-scale open weights300+ GB (cloud tag on Ollama)server-class1T total/32B active MoE, 256K contextYou have workstation or server hardware, or accept a cloud tag
GPT-5.6 (cloud)Latest APIs, complex reasoning, peak performanceN/A (cloud)<1 secBest accuracy, recent knowledge cutoff, multi-file reasoningYou need peak performance, real-time latency, or latest framework knowledge
Claude Sonnet 5 (cloud)Code review, architectural decisions, debugging accuracyN/A (cloud)<1 secBest for code understanding, debugging, multi-file contextYou prioritize debugging accuracy and code review over cost or privacy

How Do Regional Requirements Affect Your Coding Model Choice?

EU / GDPR

For EU software development teams working on proprietary codebases, local code generation means source code never leaves the organization's infrastructure. GDPR Article 32 requires appropriate technical security measures -- transmitting source code to cloud AI APIs creates an additional data processor relationship under Article 28. Local inference eliminates this.

Qwen2.5-Coder 32B (Alibaba, Apache 2.0) and DeepSeek-Coder V2 (DeepSeek, MIT) both run fully on-premises. For EU organizations preferring an EU-origin model: Mistral's code-capable models (Mistral Small 3.1, Codestral, Devstral Small 2) are from Mistral AI (France); Devstral Small 2 carries an Apache 2.0 licence, while Codestral's licence terms differ and should be checked. Qwen3.8 27B uses Apache 2.0; Kimi K2.6 uses a Modified MIT license (commercial use permitted with an attribution clause); Laguna XS 2.1 uses OpenMDW-1.1 (permissive, commercial use permitted, not OSI-approved) -- always confirm licence terms before commercial deployment. The EU AI Act (effective February 2025) classifies AI-assisted code generation for critical infrastructure as potentially high-risk -- on-premises inference keeps the pipeline within your existing security perimeter.

Japan (METI)

METI cybersecurity guidelines increasingly cover AI tool usage in software development. Qwen3-Coder handles Japanese code comments and variable naming conventions natively -- useful for Japanese-developed codebases with Japanese inline documentation. For compliance records, the Ollama tag (e.g., qwen2.5-coder:32b) provides the exact version identifier required by METI AI governance documentation.

China

Under China's Data Security Law (数据安全法), source code for critical information infrastructure may not be processed by foreign cloud services. Qwen3.8 27B and Qwen3-Coder (Alibaba, Apache 2.0) are the natural choices for Chinese enterprise coding workflows -- Chinese developer, Apache 2.0 licence, full on-premises deployment via Ollama. Kimi K2.6 (Moonshot AI) is also Chinese-origin but needs server-class hardware for local use. This is not legal advice; check the requirements that apply to your case.

What Are Common Mistakes With Local Coding Models?

  • Using HumanEval as the only benchmark for model selection: HumanEval tests single-function Python generation. In real development, you need multi-file reasoning, test generation, and codebase understanding. SWE-bench is a better predictor of real-world coding performance. A model with a strong SWE-bench score is a better bet for practical workflows than one with a high HumanEval score and no SWE-bench result.
  • Misjudging MoE models by their active parameters: Laguna XS 2.1 has only 3B active parameters, but all 33B must sit in memory (20 GB). MoE models generate fast for their size, yet the full weights still need RAM -- which is why a 1T-parameter model like Kimi K2.6 needs 300+ GB locally.
  • Using a general-purpose model instead of a code-specific model: Qwen3 8B (coding-specific) performs better on real-world tasks than Llama 3.1 8B general (general-purpose) despite similar HumanEval scores. For IDE autocomplete, always use a code-specific model with FIM support.
  • Not setting context length for multi-file review: Ollama's Modelfile spec defaults num_ctx to 2048, but the current runtime picks a VRAM-tiered default (4K under 24 GiB, 32K from 24–48 GiB, 256K above). Most code files are 1,000-3,000 tokens. Set `PARAMETER num_ctx 32768` in your Modelfile for any coding task involving full files or multiple functions in context.
  • Using Q3_K_S on coding models to save RAM: Quantization below Q4_K_M noticeably degrades code generation accuracy -- logical errors and syntax mistakes increase. For coding tasks, use Q4_K_M minimum. If RAM is tight, choose a smaller model at Q4_K_M over a larger model at Q3_K_S.
  • Prompt engineering determines output quality regardless of model: Specifying language, constraints, test cases, and error handling in your prompt dramatically reduces hallucinated code. See how to write better code with AI for production-tested patterns.

⚠️Warning: Never use quantization below Q4_K_M for coding models. Q3_K_S saves RAM but introduces syntax errors and logical bugs. This is not a worthwhile tradeoff for code generation -- either use Q4_K_M or choose a smaller model at full precision.

Frequently Asked Questions

What is the best local LLM for coding?

Qwen3.8 27B (Alibaba, Apache 2.0) — dense 27B, 18 GB, 256K context, 61.7 SWE-bench Pro as reported by Qwen. `ollama run qwen3.8`. For agentic coding on 16 GB: Devstral Small 2. For long-horizon sessions: Laguna XS 2.1. For IDE autocomplete: Codestral 22B. For 8 GB machines: Qwen3 8B.

Which Qwen model is best for coding?

Qwen3.8 27B is the best general Qwen pick for coding on a 24 GB GPU or 32 GB Mac (18 GB, 61.7 SWE-bench Pro, Qwen-reported). Qwen3-Coder-Next (80B total / 3B active, 52 GB) suits 64 GB machines, Qwen3-Coder 30B (19 GB) suits repository-aware completion, and Qwen3 8B (5 GB) is the choice for 8 GB RAM.

Is Qwen the best local LLM for coding?

For most consumer hardware, Qwen3.8 27B currently has the strongest reported coding scores of the models that run locally, but no single model wins every task. Devstral Small 2 fits 16 GB machines and is built for agentic loops, Laguna XS 2.1 targets long sessions, and Codestral 22B is more specialized for IDE autocomplete. Scores are vendor-reported on different harnesses, so test on your own code.

Can I run Kimi K2.6 or Kimi K2.7 Code locally?

Only on server-class hardware. Both are 1T-parameter MoE models (32B active). Ollama lists them only as cloud tags (`kimi-k2.6:cloud`, `kimi-k2.7-code:cloud`), which are not local inference. Community GGUF builds for K2.7 Code need about 310 GB (1-bit) to 350 GB (2-bit). For local coding on consumer hardware, use Qwen3.8 27B, Devstral Small 2 or Laguna XS 2.1.

What are Devstral Small 2 and Laguna XS 2.1?

Both are agentic coding models. Devstral Small 2 (Mistral AI, Apache 2.0) is a 24B model at 15 GB with 65.8% on SWE-bench Verified as reported by Mistral -- `ollama run devstral-small-2`. Laguna XS 2.1 (Poolside, July 2, 2026) is a 33B total / 3B active MoE model at 20 GB with a 256K context window, scoring 70.9% on SWE-bench Verified and 63.1% on SWE-bench Multilingual under the OpenMDW-1.1 license -- `ollama run laguna-xs-2.1`.

What is HumanEval and why does it matter?

HumanEval is a benchmark of 164 Python programming problems. The model must generate a correct function body for each. Pass@1 (percentage solved on first attempt) is the standard metric. It is still widely used to compare small coding models, but it tests single functions rather than real projects.

What is fill-in-the-middle (FIM) and which models support it?

FIM is the ability to complete code given both the code before and after the cursor -- the pattern used by IDE autocomplete. Codestral 22B, Qwen3-Coder, DeepSeek-Coder, and Starcoder2 support FIM. Llama 3.1 8B general does not. For IDE integration, use an FIM-capable model.

Can local coding models replace GitHub Copilot?

Codestral 22B via Continue.dev can cover most autocomplete tasks. For complex multi-file reasoning, cloud models still tend to have an edge on the hardest tasks. Trade-off: local models are slower but fully private and run on your own hardware.

How much RAM do I need for local coding LLMs?

Minimum 4 GB (tiny 3B models), practically 8 GB+ for usable coding. 16 GB runs Devstral Small 2 (15 GB). 24 GB of GPU memory or a 32 GB Mac runs Qwen3.8 27B (18 GB); on the Mac, about 6 GB remains for context after macOS takes 8 GB. A rule of thumb: Q4_K_M weights take roughly 0.6 GB per billion parameters, plus memory for the context window.

How much context does a 500-line Python file use?

Approximately 2,000-3,000 tokens for a 500-line Python file. Ollama's runtime default (VRAM-scaled) token context may be insufficient. Set `PARAMETER num_ctx 16384` minimum for single-file code review. For multi-file analysis, use 32768 or 65536 context.

Are local coding models fast enough for development?

Yes for iterative workflows. Speed depends on your GPU, quantization and context length. Smaller models such as Qwen3 8B respond quickly on laptops; larger models are slower per token. Waiting several seconds per response is acceptable for request-and-review use, but not for keystroke-level autocomplete, where you should use a small FIM model.

Can local LLMs replace GPT-5.6 for coding?

Not entirely. Local models (Qwen3.8 27B, Devstral Small 2) lag frontier cloud models on latest framework knowledge (APIs after the training cutoff), very long multi-file reasoning (100k+ tokens), and debugging accuracy. They have narrowed the gap on everyday multi-file coding tasks and keep your code private.

Which language does Qwen3-Coder support best?

Python is the primary training language. JavaScript, TypeScript, Java, C++, Go, Rust, and SQL are all well-supported. The model also handles PHP, Ruby, Swift, and Kotlin. For non-Python languages, HumanEval scores are lower but still competitive.

Is DeepSeek-Coder safe to use for proprietary code?

When running locally via Ollama, DeepSeek-Coder makes no external connections. Your code stays on your hardware. The data concern with DeepSeek applies to their cloud API (api.deepseek.com), not to local Ollama inference. Local inference sends no code to DeepSeek's servers.

Can I use local coding models for SQL generation?

Yes -- Qwen3.8 27B and Devstral Small 2 both handle SQL generation. Provide the table schema in the prompt context. For complex multi-join queries, use 32K context to include the full schema. Set a system prompt: "You are an expert SQL developer. Generate only valid SQL."

What is SWE-bench and why is it replacing HumanEval?

SWE-bench tests a model's ability to resolve real GitHub issues — reading codebases, making multi-file changes, and writing tests. Unlike HumanEval (which tests single Python functions), SWE-bench predicts how a model performs in actual development workflows. SWE-bench Verified and SWE-bench Pro are different variants, so their scores are not interchangeable. In 2026, SWE-bench is the primary benchmark for evaluating coding models for real-world use.

How do I connect a local coding model to VS Code?

Install the Continue.dev extension from the VS Code marketplace. In Continue settings, select Ollama as the provider and specify your model (e.g., `qwen3:8b`, `qwen3.8`, `codestral:22b`). The extension connects to Ollama at localhost:11434 automatically. Use Cmd+I (macOS) or Ctrl+I (Windows) to trigger inline code generation.

Sources

A Note on Third-Party Facts

This article references third-party AI models, benchmarks, prices, and licenses. The AI landscape changes rapidly. Benchmark scores, license terms, model names, and API prices can shift between the time of writing and the time you read this. Before making deployment or compliance decisions based on this article, verify current figures on each provider’s official source: Hugging Face model cards for licenses and benchmarks, provider websites for API pricing, and EUR-Lex for current GDPR and EU AI Act text.

Run PromptQuorum with a local LLM, your own API keys, or both — you pick the backend.

Download the PromptQuorum Beta →

← Back to Local LLMs

MCP