Key takeaways
- Qwen3-Coder, Devstral, gpt-oss and Qwen2.5-Coder lead local coding, but rankings change fast.
- Match model size to memory: 7B for 8 GB, 14B for 12 GB, 20B to 24B for 16 GB, 30B-class for 24 GB.
- Agentic coding needs tool-trained models, long context and concise tool outputs.
- Use Aider, LiveCodeBench and SWE-bench as a shortlist, then test on your own code.
- Stalled local agents usually need more context, correct templates and clear completion criteria.
The best local LLMs for coding in 2026 come from open-weight families such as Qwen Coder, Devstral, gpt-oss and GLM, and the right pick depends mostly on your VRAM. Local models keep code private and work offline, but they trail frontier models on hard agentic tasks. I fine-tune open models with QLoRA in FineTune Studio, so this page covers the best local coding models now, agentic coding, picks for 8 to 24 GB of VRAM and 16 GB of RAM, leaderboards and stalled agents.
What is the best local LLM for coding right now?
Strong local coding models in 2026 include Qwen3-Coder, especially the 30B mixture-of-experts version with about 3 billion active parameters, Devstral Small from Mistral, OpenAI's gpt-oss-20b and Qwen2.5-Coder at 14B and 32B. Rankings shift with every release.
The best choice balances quality, speed and your hardware. Mixture-of-experts models run faster than their total size suggests, because only part of the network activates per token. Dense 32B models give strong quality but need about 20 GB of memory at 4-bit quantization. Check recent leaderboards and community tests, then try two or three candidates on your own codebase, judging correctness, instruction following and speed. Quantization at Q4_K_M or above usually preserves coding quality well.
What local LLMs are good for coding?
Good local coding models include Qwen2.5-Coder and Qwen3-Coder, Devstral, Codestral, gpt-oss, DeepSeek-Coder-V2-Lite, GLM-4.5-Air for larger machines, and small models such as Qwen2.5-Coder 1.5B for fast autocomplete.
Different tasks suit different sizes. Tab autocompletion needs speed, so 1.5B to 7B models work well. Chat-based coding help and explanations benefit from 14B to 32B models. Agentic coding, where the model edits files and runs commands, needs strong tool calling and long context, favouring models trained for agents, such as Devstral and Qwen3-Coder. Run them through Ollama, LM Studio or llama.cpp, and connect editors with extensions such as Continue or Cline.
What is the best local LLM for agentic coding?
For agentic coding, choose models trained for tool use and multi-step software tasks, such as Qwen3-Coder, Devstral and gpt-oss. They follow tool-calling formats more reliably and handle long contexts better than general chat models of similar size.
Agentic tools such as Cline, OpenHands, Aider and Continue's agent mode need models that plan, edit files, read errors and iterate. Local models still trail frontier cloud models on long, complex tasks, so scope work into smaller steps. Give the model enough context length, often 32k tokens or more, and keep tool outputs concise. Larger machines can run GLM-4.5-Air or bigger Qwen3-Coder variants with higher quality. Test on real issues from your own repository.
What is the best local LLM for coding with 8 GB of VRAM?
With 8 GB of VRAM, run 7B to 8B coding models at 4-bit quantization, such as Qwen2.5-Coder 7B or Qwen3 8B, which fit fully on the GPU with room for moderate context.
Also asked as: best local llm for coding 8gb vram · best local llm for coding 12gb vram · best local llm for coding 16gb vram · best local llm for coding 24gb vram
For autocomplete, smaller models such as Qwen2.5-Coder 1.5B or 3B respond almost instantly. Mixture-of-experts models such as Qwen3-Coder 30B can run with most layers offloaded to system RAM, trading speed for quality, if you have 32 GB of RAM. Keep context moderate, since the key-value cache also uses VRAM. Close other GPU-heavy apps, and use llama.cpp or Ollama with flash attention enabled where supported to stretch memory further.
What is the best local LLM for coding with 12 GB of VRAM?
With 12 GB of VRAM, 14B coding models at 4-bit quantization, such as Qwen2.5-Coder 14B, are the sweet spot, giving noticeably better reasoning than 7B models while fitting fully on the GPU.
You can also try gpt-oss-20b, which needs about 16 GB of memory, with partial offloading, or run Qwen3-Coder 30B with expert layers offloaded to system RAM. For longer contexts, drop to slightly smaller quantization or reduce context length to keep everything on the GPU, since offloading slows generation significantly. Pair a 14B chat model with a small autocomplete model for a responsive editor setup. Measure tokens per second to confirm the setup feels usable.
What is the best local LLM for coding with 16 GB of VRAM?
With 16 GB of VRAM, strong choices include gpt-oss-20b, Devstral Small at 4-bit quantization, Qwen2.5-Coder 14B at higher precision, and Qwen3-Coder 30B with light offloading.
This tier handles real agentic coding with modest context. gpt-oss-20b offers adjustable reasoning effort and good tool calling. Devstral Small, at about 24 billion parameters, was built for software engineering agents and fits at 4-bit with limited context. Running Qwen2.5-Coder 14B at 6-bit or 8-bit quantization improves accuracy over 4-bit. Balance context length against model size, since agent workflows consume many tokens. Test each on a few representative tasks before settling on one.
What is the best local LLM for coding with 24 GB of VRAM?
With 24 GB of VRAM, run Qwen3-Coder 30B fully on the GPU at 4-bit or 5-bit quantization, Qwen2.5-Coder 32B at 4-bit, or Devstral Small at higher precision with long context.
This is the most popular tier for serious local coding, with quality that handles many everyday coding tasks well. The mixture-of-experts Qwen3-Coder runs very fast, making agentic loops practical. Dense 32B models are slower but strong at reasoning through complex code. With two 24 GB GPUs or a high-memory Mac, larger models such as GLM-4.5-Air or gpt-oss-120b become possible. Keep context at 32k tokens or more for agent use.
What is the best local LLM for coding with 16 GB of RAM?
With 16 GB of system RAM and no capable GPU, run small models: 3B to 8B coding models at 4-bit quantization, such as Qwen2.5-Coder 7B, which run on the CPU at modest speeds.
Also asked as: best local llm for coding 16gb ram
CPU inference is slower than GPU inference, so expect a few tokens per second for 7B models on typical laptops, fine for questions but slow for agents. Apple silicon Macs with 16 GB of unified memory do better, running 7B to 14B models on the GPU with Metal acceleration. Leave memory for your editor and browser, since swapping slows everything. For heavier coding tasks on such machines, a hosted model may serve better than a struggling local one.
What is the best local LLM coding leaderboard?
Useful coding leaderboards include Aider's polyglot benchmark, LiveCodeBench, SWE-bench Verified, EvalPlus and BigCodeBench. Aider's leaderboard is especially practical, since it tests models editing real code across several languages.
Also asked as: best local llm for coding leaderboard
Each measures something different: EvalPlus covers function-level correctness, LiveCodeBench uses fresh competitive programming problems to limit contamination, and SWE-bench Verified measures fixing real GitHub issues, which is closest to agentic work. Many leaderboards focus on cloud models, so check that results include the open-weight models and quantization you plan to run. Community benchmarks on forums add hardware-specific speed data. Treat leaderboards as a shortlist, then test on your own repository.
Why can a local coding agent act but not finish tasks?
Local coding agents often start well but stall because of short context windows, long tool outputs that crowd out instructions, unreliable tool-call formatting, weak multi-step planning in smaller models, or quantization that degrades reasoning.
Also asked as: why my local coding agent could act but couldn't finish
A common culprit is default context length: some local runtimes start with only a few thousand tokens, silently truncating the conversation, so the agent forgets its goal. Increase context, trim tool outputs, and use the model's correct chat template. Give explicit completion criteria, such as tests passing, and set step limits. Break large tasks into smaller issues. Models trained for agents, such as Devstral and Qwen3-Coder, finish more reliably than general chat models of similar size.





