A local LLM for coding gives you an assistant that reads your code without sending it anywhere, never meters your usage, and keeps working offline. In 2026 the open models are good enough to be genuinely useful. The catch is that “best” depends on two things people often mix up: how much memory you have, and what kind of help you want. Tab autocomplete, chat about your code and agentic multi-file editing each want a different model. This guide lists the current open coding models with their sizes, licences and memory needs, and says which to pick at each tier.
Quick answer by memory
- 8GB: Qwen2.5-Coder 7B for chat (4.7GB download). For tab autocomplete, the small
qwen2.5-coder:1.5bthat Continue recommends. - 12–16GB: Qwen2.5-Coder 14B (9.0GB download) comfortably.
- 24GB: Qwen3-Coder 30B-A3B or Devstral Small 2 (15GB download). Mistral says Devstral Small 2 runs on “a single RTX 4090 or a Mac with 32GB RAM”. gpt-oss-20b also belongs in this tier rather than the one below — its download is only 14GB, but our directory puts its working requirement at 17.1GB.
- 64GB and up: Qwen3-Coder-Next (52GB download at Q4), the strongest local option here by its vendor’s published score.
The models, side by side
Download sizes are the default tags from the Ollama library, checked 17 September 2026. A download size is not the VRAM you need. The context’s KV cache comes on top, and coding assistants use long contexts. The “recommended VRAM” column is the 4-bit figure from our models directory and includes room for a working context. Models not yet in the directory show “—”.
| Model | Parameters | Context | Licence | Ollama tag | Download | Recommended VRAM |
|---|---|---|---|---|---|---|
| Qwen3-Coder-Next | 80B (3B active) | 256K | Apache 2.0 | qwen3-coder-next |
52 GB | — |
| Qwen3-Coder 30B-A3B | 30.5B (3.3B active) | 256K | Apache 2.0 | qwen3-coder:30b |
19 GB | 21.6 GB |
| Devstral Small 2 | 24B | 256K | Apache 2.0 | devstral-small-2 |
15 GB | — |
| gpt-oss-20b | 20.9B (3.6B active) | 128K | Apache 2.0 | gpt-oss:20b |
14 GB | 17.1 GB |
| Codestral 22B | 22.2B | 32K | Mistral Non-Production | codestral:22b |
13 GB | 16.0 GB |
| Qwen2.5-Coder 32B | 32.8B | 32K native, 128K with YaRN | Apache 2.0 | qwen2.5-coder:32b |
20 GB | 24.0 GB |
| Qwen2.5-Coder 14B | 14.8B | 32K native, 128K with YaRN | Apache 2.0 | qwen2.5-coder:14b |
9.0 GB | 12.0 GB |
| Qwen2.5-Coder 7B | 7.6B | 32K native, 128K with YaRN | Apache 2.0 | qwen2.5-coder:7b |
4.7 GB | 8.0 GB |
Parameter counts from each model’s Hugging Face safetensors index; context and licence from the model cards and configs.
One context figure needs explaining. Qwen advertises “long-context support up to 128K tokens” for Qwen2.5-Coder, but the shipped config.json is set to 32,768 tokens, and reaching 128K means enabling YaRN extrapolation yourself. So 32K is what you get by default through Ollama, and that is the number to plan around unless you have configured otherwise. The Qwen3-Coder models are genuinely 256K natively, with no extra step.
Three jobs, three different picks
1. Tab autocomplete
Autocomplete fills in code at your cursor, continuously. That needs a fast model trained for fill-in-the-middle prompts, not a big chat model. Continue’s documentation says large commercial models “won’t generate useful completions” because they aren’t trained on the autocomplete prompt format. It adds that most state-of-the-art autocomplete models are “no more than 10b parameters”, and that going beyond this “does not significantly improve performance”. It recommends qwen2.5-coder:1.5b through Ollama, and advises against “thinking” models because they generate too slowly for a task that needs speed. Among the larger models, Qwen’s repository states that fill-in-the-middle “is supported in every version of Qwen3-Coder”. Mistral’s card shows fill-in-the-middle examples for Codestral.
2. Chat and edits
For explaining code, writing functions and reviewing diffs, take the largest coding model that fits with room for context. On 24GB that’s Qwen3-Coder 30B-A3B. It’s a mixture-of-experts model with only 3.3B parameters active per token, so it generates faster than a dense model of similar total size. All 30.5B parameters still have to fit in memory. On smaller cards, Qwen2.5-Coder 14B or 7B. Why active parameters set the speed and total parameters set the memory is covered in our guide to tokens per second.
3. Agentic coding
Agents explore a repository, run tools and edit several files at once. Two models are built for this. Mistral describes Devstral Small 2 as “an agentic LLM for software engineering tasks” that “excels at using tools to explore codebases, editing multiple files and power software engineering agents”. It lists Mistral Vibe, Cline, Kilo Code, Claude Code, OpenHands and SWE Agent as supported scaffolds. Qwen describes Qwen3-Coder as supporting agentic coding in tools such as Qwen Code and Cline, with a purpose-built function-call format. If you want to point Claude Code at a local model, our Ollama vs Claude page covers what that setup supports.
Vendor-published scores — read with care
Both vendors publish a SWE-bench Verified result, a benchmark of resolving real GitHub issues. Qwen3-Coder-Next: 70.6%, recorded in the model repository’s own evaluation results and attributed to the Qwen3-Coder-Next technical report. Devstral Small 2: 68.0%, from the table on its model card.
These two numbers are not directly comparable. Qwen’s result names SWE-Agent as the harness, and a SWE-bench score is a property of the model and the agent scaffold wrapped around it — the same weights score differently under a different harness. Mistral also notes that the competitor figures in its table are “based on publicly reported values” rather than its own reruns. So read both as a rough signal of the tier these models are in, not as a ranking. BFWR doesn’t run its own benchmarks, and the only test that settles it is your own codebase.
Licences matter for work use
- Apache 2.0 (Qwen3-Coder, Qwen3-Coder-Next, Qwen2.5-Coder, Devstral Small 2, gpt-oss-20b): commercial use allowed.
- Codestral 22B uses the Mistral AI Non-Production License. It limits use to “testing, research, Personal, or evaluation purposes in Non-Production Environments”, and bars supplying the model “in the course of a commercial activity”. The licence does state that Mistral claims “no ownership rights in and to the Outputs”. If the model will run inside a product or a work service, choose an Apache 2.0 model instead.
Our model licence checker covers the rest of the directory.
Setting it up
Pull the model with Ollama, then connect your editor. Our free local Copilot alternative guide walks through VS Code with Continue (chat and autocomplete) and Cline (agentic), and what works in Cursor. Both of those are still actively developed; our maintenance audit of local AI pair programming tools checks which assistants are still shipping commits and which have gone quiet.
ollama pull qwen3-coder:30b
ollama pull qwen2.5-coder:1.5b
Raise the context length before you start real work — coding tools send a lot of code with every request, and the default is conservative. Not sure what your hardware holds? The model recommender starts from your RAM or VRAM, and the VRAM calculator sizes a specific model at the context length you plan to use.
FAQ
Is a local coding model as good as Claude or GitHub Copilot?
Not on the hardest multi-step work; the largest hosted models are ahead. For everyday completion, explanation and focused edits, the models above are useful, and your code stays private.
What’s the best local model for autocomplete?
A small, fast model trained for fill-in-the-middle prompts. Continue recommends qwen2.5-coder:1.5b. Bigger chat models are slower and not better at this job.
How much VRAM do I need for a local coding LLM?
8GB runs a 7B coding model. 24GB is where Qwen3-Coder 30B-A3B and Devstral Small 2 become practical. Leave headroom for context, because coding tools send a lot of code with each request.
Can I use Codestral at work?
Not in production. Its non-production licence restricts deployment to testing, research, personal and evaluation use. Use an Apache 2.0 model for anything commercial.
Do I really get a 128K context with Qwen2.5-Coder?
Not by default. The shipped config is 32,768 tokens; 128K requires enabling YaRN. If you need a long context without configuring anything, the Qwen3-Coder models are 256K natively.
Sources
- Model cards: Qwen3-Coder-Next, Qwen3-Coder-30B-A3B-Instruct, Devstral Small 2, Qwen2.5-Coder, Codestral 22B, gpt-oss-20b
- Qwen: Qwen3-Coder repository (fill-in-the-middle support), Qwen3-Coder-Next technical report (SWE-bench Verified, SWE-Agent harness)
- Mistral AI: Mistral AI Non-Production License
- Ollama library: qwen3-coder-next, qwen3-coder, devstral-small-2, qwen2.5-coder
- Continue: Autocomplete setup
Updated 17 September 2026. Sizes, contexts and scores are as published by each vendor; BFWR does not run its own benchmarks.
Work out what your hardware can actually run
Free calculators and directories, sized from real model weights — before you download gigabytes or order a card:

