Best Local Coding Models by VRAM

Open-weight coding LLMs sized by VRAM: Qwen2.5-Coder, Qwen3-Coder, Devstral Small 2, KAT-Coder, GLM-4.7-Flash, and the trade-offs at each tier.

The maintained version of this guide is Best Local Coding Models by VRAM Tier. This page is kept so existing links keep working.

A coding model that lives on your card can keep proprietary code off someone else’s server and remove the per-query bill, but only if the model is bilingual in “fill in this line” and “fix this issue across four files.” Most chat models do one or the other; the open-weight coding models do both. Every figure below was pulled from the Hugging Face model card, the model’s own GitHub repo, or the live Ollama tag page on 2026-09-22, and the facts that changed were re-checked against the same sources on 2026-11-16. Benchmark scores are vendor-reported.

Quick reference

JobModelOllama tag (size)LicenceSWE-bench Verified
Smallest FIM-capable coderQwen2.5-Coder-0.5Bqwen2.5-coder:0.5b (398 MB)Apache 2.0not on card
1.5B for low-RAM laptopsQwen2.5-Coder-1.5Bqwen2.5-coder:1.5b (986 MB)Apache 2.0not on card
Phone-class chat-completionQwen2.5-Coder-3Bqwen2.5-coder:3b (1.9 GB)Qwen research licencenot on card
8 GB sweet spot, FIMQwen2.5-Coder-7Bqwen2.5-coder:7b (4.7 GB)Apache 2.0not on card
12-16 GB tier, FIMQwen2.5-Coder-14Bqwen2.5-coder:14b (9.0 GB)Apache 2.0not on card
16 GB tier, agenticDevstral Small 2devstral-small-2:24b (15 GB)Apache 2.068.0
24 GB tier, agenticQwen3.8-27Bqwen3.8:27b (18 GB)Apache 2.0not on card (SWE-bench Pro 61.7)
24 GB tier, agenticKAT-Coder-V2.5-Dev(no Ollama tag)Apache 2.069.40
24 GB tier, large denseQwen2.5-Coder-32Bqwen2.5-coder:32b (20 GB)Apache 2.0not on card
24 GB tier, MoE flagshipQwen3-Coder-30B-A3Bqwen3-coder:30b (19 GB)Apache 2.0not on card
24 GB tier, MoE agenticGLM-4.7-Flashglm-4.7-flash (19 GB)MIT59.2
64 GB+ tierQwen3-Coder-Nextqwen3-coder-next (52 GB)Apache 2.0image only on card
Frontier MoEQwen3-Coder-480B-A35Bqwen3-coder:480b (290 GB)Apache 2.0not on card
Frontier MoE, retiredGLM-4.7(Ollama tag retired)MIT73.8
Frontier MoE, retiredKimi K2-Instruct-0905(Ollama tag retired)Modified MIT69.2
Non-production FIMCodestral-22B(no Ollama tag)MNPL-0.1not on card

Two notes before the details. First, SWE-bench Verified scores are not on every card: the Qwen2.5-Coder series and the 30B-A3B / 480B Qwen3-Coder variants list Agentic Coding, Browser-Use, and Tool-Use numbers in the Qwen blog but not SWE-bench Verified on their model pages; Qwen3-Coder-Next’s card publishes its benchmarks only as images. Second, Ollama retired both glm-4.7 (July 15 2026) and kimi-k2 (June 16 2026) - the library pages still resolve but show “No models have been pushed.”, so they are listed for completeness but cannot be pulled today.

Two jobs, two architectures

Autocomplete (fill-in-the-middle, FIM). The model receives text before and after the cursor and has to produce the missing line. The classic test is HumanEval; most strong coding models now score in the 85-90% range, which makes HumanEval a poor differentiator. FIM support itself is the harder filter: a chat model can answer a coding question without ever having been trained on FIM, so it cannot do autocomplete.

Agentic coding. The model receives a real GitHub issue, navigates a repository, edits multiple files, runs tests, and revises. The test is SWE-bench Verified (and the harder SWE-bench Pro and SWE-bench Multilingual). This is where the MoE coding models - KAT-Coder, Qwen3-Coder, GLM-4.7-Flash, GLM-4.7 - separate from the dense Qwen2.5-Coder line, because the model has to keep state across many tool calls.

Some models do both. Qwen2.5-Coder ships FIM and instruction tuning at every size from 0.5B to 32B and remains the most consistent autocomplete-capable family for low-VRAM cards. Qwen3-Coder and KAT-Coder do not document FIM on their model cards and are built for agentic work; pairing one of them with a small Qwen2.5-Coder model on the same card, one for autocomplete and one for the heavier agent turns, is a common pattern.

Pick by tier

Every use case at one memory budget, in one place, for the tiers not linked below: 6 GB | 12 GB.

Under 4 GB. qwen2.5-coder:0.5b (398 MB) and qwen2.5-coder:1.5b (986 MB) are FIM-capable at sizes that fit anything, but expect limited agentic ability. qwen2.5-coder:3b (1.9 GB) is the more useful pick at this tier if you have the RAM; of the families on this page, Qwen2.5-Coder is the only one with FIM-trained models this small. The 0.5B and 1.5B are Apache 2.0, but the 3B is under Qwen’s research licence (qwen-research on Hugging Face). The no-GPU cluster entry point covers what to expect on CPU-only hardware.

4 to 6 GB. qwen2.5-coder:7b (4.7 GB) is the standout at this budget, Apache 2.0 and FIM-capable. This is also where the 8 GB VRAM tier guide and the quantisation quality page apply, because the same card will also be running a chat or RAG model.

9 to 14 GB. Two choices diverge here. qwen2.5-coder:14b (9.0 GB) is the dense FIM coder for autocomplete; it is Apache 2.0. devstral-small-2:24b (15 GB on the Ollama library page; the plain devstral:24b tag is the first-generation Devstral) is the agentic specialist from Mistral: SWE-Bench Verified 68.0, Apache 2.0, 256K context, and its model card does not document FIM. Its Q4_K_M GGUF is 14,334,446,752 bytes (13.35 GiB), which leaves 2.65 GiB of a 16 GB card for context, so it is the agentic pick that fits 16 GB. Mistral’s docs mark it deprecated as of 2026-02-27 in favour of Mistral Medium 3.5; the Apache-2.0 weights stay downloadable. The Ollama devstral and devstral-small-2 tags are both still listed (1.1M and 2.8M downloads respectively on 2026-11-16); devstral is the first-generation small-2505 model, so check which tag you mean. The 16 GB tier guide covers the broader picks for this card size.

19 to 20 GB. The dense tier. qwen2.5-coder:32b (20 GB) is the dense Apache 2.0 128K-context option for cards that do not want an MoE. qwen3-coder:30b (19 GB; the Q4_K_M GGUF is 18,556,689,568 bytes, 17.28 GiB) is the MoE flagship in this band: 30.5B total / 3.3B active, Apache 2.0, 262K native context extendable to 1M via YaRN, non-thinking mode only. The Qwen3-Coder family supports agentic tool-use, and the Qwen blog documents three integration paths (Qwen Code CLI, Claude Code proxy, Cline with the qwen3-coder-plus model name). GLM-4.7-Flash (30B/3B MoE, MIT, SWE-bench Verified 59.2) is the closest competitor at the same MoE footprint; Ollama now lists it as glm-4.7-flash (19 GB, 198K context), and the model card says vLLM and SGLang support it only on their main branches. qwen3.8:27b (18 GB) is the newer dense option in this band: Qwen3.8-27B, Apache 2.0, 262K native context, with a Qwen-reported 61.7 on SWE-bench Pro against 53.5 for Qwen3.6-27B on the same harness (no SWE-bench Verified figure on its card). The 24 GB tier guide covers the chat and RAG alternatives.

Above 24 GB. Three frontiers exist. qwen3-coder-next (52 GB Q4_K_M, Apache 2.0) is the 80B/3B MoE follow-up with a 262K native context; its model card publishes benchmarks only as images, so no score is quoted here. qwen3-coder:480b (290 GB Q4_K_M, Apache 2.0) is the 480B/35B flagship with 256K native context, extendable to 1M with extrapolation methods per the Qwen blog. GLM-4.7 (MIT, 358B, SWE-bench Verified 73.8) and Kimi K2-Instruct-0905 (Modified MIT, 1T/32B MoE, SWE-bench Verified 69.2) score higher but both have been retired from Ollama (glm-4.7 retired 2026-07-15, kimi-k2 retired 2026-06-16) and at 358B and about 1T total parameters they are multi-GPU server models, not single-card consumer hardware. The 32 GB tier guide covers the hardware ceiling.

Licences, where the traps are

The coding-model family is mostly permissive. Qwen2.5-Coder (every size except the 3B, which is under Qwen’s research licence), Qwen3.8-27B, Qwen3-Coder-30B-A3B, Qwen3-Coder-Next, Qwen3-Coder-480B-A35B, Devstral Small 2, and KAT-Coder-V2.5-Dev are all Apache 2.0. GLM-4.7 and GLM-4.7-Flash are MIT. Kimi K2-Instruct-0905 is the Modified MIT variant Moonshot uses for its larger models, with usage-count thresholds above the stock MIT terms - read the LICENSE file before deploying commercially.

The one outright non-permissive entry is Codestral-22B-v0.1, Mistral’s earlier coding specialist. It is the only model on this page that ships Mistral’s MNPL-0.1 (Mistral AI Non-Production License), which prohibits production deployment; the HF card says “does not have any moderation mechanisms” and asks the community to add guardrails. For any commercial use, replace it with devstral-small-2:24b (Apache 2.0, SWE-bench Verified 68.0) at the same parameter class. The open-model licences guide covers the broader patterns.

Autocomplete versus agentic in practice

A coding model in front of a real repository is most useful if it can both fill in the next line and execute a multi-step issue. The two jobs want different things from the same weights:

  • FIM wants a fast, dense model that loads fast and stays on the card. Qwen2.5-Coder at 7B or 14B is the strongest match on consumer hardware.
  • Agentic work wants a MoE with a long context and tool-call training. Qwen3-Coder-30B-A3B at 19 GB (262K native context, 1M via YaRN, Apache 2.0) is the smallest mainstream pick that holds up; Qwen3-Coder-Next at 52 GB is the next step up for machines with more than 52 GB of GPU or unified memory.

The common production pattern is to load both: a small Qwen2.5-Coder for the editor’s inline suggestion and a larger MoE coder for the agent turn. Ollama keeps both loaded if VRAM allows; the Ollama runners comparison covers which runners expose num_parallel and keep_alive knobs.

How to actually run one

Two flags matter most. For Qwen3-Coder, the model card recommends temperature=0.7, top_p=0.8, top_k=20, repetition_penalty=1.05, and max_new_tokens=65,536; it is non-thinking only. The GGUF, AWQ, GPTQ and MLX comparison covers which format to pull, and what quantisation costs you covers the quality loss, which on a coding model is more visible than on chat because errors compound across file edits.

For tool-use setups, the Qwen3-Coder integration guide documents three paths: the Qwen Code CLI (forked from Gemini Code), Claude Code via a proxy API or claude-code-router, and Cline with the OpenAI-compatible provider. The blog’s examples point at Alibaba Cloud’s hosted API with qwen3-coder-plus as the model name; for a local model, set the same OpenAI-compatible base URL to your Ollama or vLLM server and use its model tag instead; the household-serving guide and the team-serving guide cover the network plumbing.

The bottom line

On a 24 GB card, qwen3.8:27b (18 GB, Apache 2.0) or qwen3-coder:30b (17.28 GiB at Q4_K_M, Apache 2.0, 262K context) handles agentic turns. A FIM model can share the card only if it is small: qwen2.5-coder:7b (4.36 GiB) plus qwen3-coder:30b totals 21.64 GiB and leaves 2.36 GiB, while qwen2.5-coder:14b (8.37 GiB) plus qwen3-coder:30b (25.65 GiB together) does not fit, so swap models instead. On a 16 GB card, devstral-small-2:24b (13.35 GiB at Q4_K_M, SWE-bench Verified 68.0, Apache 2.0) is the agentic pick and runs alone, with qwen2.5-coder:14b swapped in for autocomplete; tag state changes quickly, so confirm on the Ollama library page before deployment. Above 24 GB, qwen3-coder-next (52 GB Q4_K_M, Apache 2.0) is the largest Qwen3-Coder build short of the 480B flagship. The only non-permissive licence in the family is Codestral-22B’s MNPL-0.1; everything else on the table is Apache 2.0, MIT, or Modified MIT and can be deployed commercially once the Modified-MIT usage threshold is read against the LICENSE file.

Other GPUs and tasks: Local AI by VRAM · RSS