Best local LLMs for coding

Three open coding models stand out for running at home: Qwen3-Coder 30B-A3B for agentic coding with a very long context, Devstral Small 2 for software-engineering agents on a single 24 GB card, and the Qwen2.5-Coder family for a size to fit almost any GPU.

By Anjam JavedUpdated How we choose

How we chose

These are open coding models with official model cards, clear licenses and published architecture. We have not run our own coding tests. Where a maker publishes a benchmark result, we quote it as the maker’s claim. Weight sizes are our estimates at Q4_K_M (4.89 bits per weight, from llama.cpp’s measurements), before the memory for the context.

At a glance

Model Parameters Weights at Q4_K_M Context License
Qwen3-Coder 30B-A3B 30.5B total, 3.3B active about 18.7 GB 262,144 tokens Apache 2.0
Devstral Small 2 24B about 14.7 GB 256K tokens Apache 2.0
Qwen2.5-Coder 32B 32.5B about 19.9 GB 131,072 tokens Apache 2.0

Qwen3-Coder 30B-A3B

A mixture-of-experts model: 30.5B parameters in total, of which 3.3B are active for each token. All 30.5B still need to be in memory, so plan for about 18.7 GB of weights at Q4_K_M. Its card describes “significant performance among open models” on agentic coding and browser use, and lists a native context of 262,144 tokens, extendable to 1M with YaRN.

Devstral Small 2 (24B)

Mistral AI describes Devstral as “an agentic LLM for software engineering tasks”, built to work through code bases with tools. Its card says it is light enough to run on a single RTX 4090 or a Mac with 32 GB of RAM, and reports 68.0% on SWE-bench Verified. At about 14.7 GB for the weights at Q4_K_M, it leaves room for context on a 24 GB card.

Qwen2.5-Coder (0.5B to 32B)

The Qwen2.5-Coder family comes in six sizes: 0.5B, 1.5B, 3B, 7B, 14B and 32B. That makes it the easiest to fit to your hardware, from a laptop to a 24 GB card. Qwen describes the 32B version’s coding abilities as matching GPT-4o.

Which should you choose?

  • 24 GB card, agent-style coding with tools: Devstral Small 2.
  • 24 GB card, very long code bases: Qwen3-Coder 30B-A3B, for its 262K context.
  • 8 to 16 GB card: Qwen2.5-Coder 7B or 14B.

To connect a local model to your editor, run it in Ollama or LM Studio. Both serve models through an OpenAI-style API on your own computer.

Sources

Questions

Can a local LLM replace a cloud coding assistant?

For many everyday tasks it can help a lot, and your code never leaves your machine. The largest cloud models are still much bigger than anything that fits on one home GPU, so expect some gap on hard problems.

How much VRAM do I need for a coding model?

For the 24B to 32B models here, about 15 to 20 GB for the weights at Q4_K_M, plus memory for the context. A 24 GB card is the comfortable size. Smaller Qwen2.5-Coder models (7B, 14B) fit 8 to 12 GB cards.

How do I use a local model in my editor?

Run it in Ollama or LM Studio, which both serve models through an OpenAI-style API on your own computer. Many editor extensions can connect to that local address instead of a cloud service.

Anjam JavedAnjam Javed has used PCs for 20 years, upgrades his own laptops and runs AI tools on local hardware. He holds master's degrees in IT and Marketing Management.More from the author