Best local LLMs for coding
Run open-source models locally on your own GPU or Mac to handle code completion, refactoring, and agent tasks. We rank them using the llmrun coding score, offering a top choice for every available VRAM capacity.
Alibaba · Q4_0 · 15.1 GB · up to 32K context · on RTX 5080
- 52.5 t/s
- B
Also worth a look
Qwen3 Coder 30B A3B Instructcode model
IQ3_M · 14.8 GB · 163.9 t/s · 32K ctx
IQ4_XS · 14.9 GB · 173.3 t/s · 32K ctx
Also worth a look
Qwen3 Coder 30B A3B Instructcode model
IQ3_M · 14.8 GB · 163.9 t/s · 32K ctx
Best coding model by memory
Highest coding score that fits each size with at least 32K context and 20 t/s, at a Q3 or better quant. Speed is decode tokens per second on that size's reference GPU. The last row has no memory limit: the best model whatever it needs, on the GPU plan shown. Full ranking
8 GB · RTX 5060
Qwen2.5 Coder 7B Instructcode model71.8 t/s · 32K ctx
Q4_K_M · 5.8 GB
12 GB · RTX 5070
GPT OSS 20B161.9 t/s · 32K ctx
Q3_K_L · 11.3 GB
Runner-up: Qwen2.5 Coder 7B Instructcode model
16 GB · RTX 5080
Qwen3.8 27B52.5 t/s · 32K ctx
Q4_0 · 15.1 GB
Runner-up: Qwen3 Coder 30B A3B Instructcode model
24 GB · RTX 4090
Qwen3.8 27B46.3 t/s · 64K ctx
Q4_K_M · 17.9 GB
Runner-up: Qwen3 Coder 30B A3B Instructcode model
32 GB · RTX 5090
Qwen3.8 27B82.3 t/s · 256K ctx
Q4_K_M · 17.9 GB
Runner-up: Qwen3 Coder 30B A3B Instructcode model
48 GB+ · no limit · about 3 nodes of 8× H100 SXM 80 GB
Kimi K3.1 Pro1M ctx
Q4_K_M · needs 1.7 TB
Runner-up: Qwen3 Coder 480B A35B Instructcode model
Coding models that run on 16 GB65
Ranked by coding score, models without one after (code specialists first, by SWE-bench Verified). Best quant that fits with a 16K context; speed is decode tokens per second on the reference GPU.
65 models · 52 run great · 1 run well
Score: llmrun Score, 100 = average model. Fit: how well it runs on this hardware, S best to F won't fit. Ordered by Score, recency and Fit. How ranking works
Showing compatibility for NVIDIA GeForce RTX 5080
| Model | Quant | VRAM | Speed | Context | Score | Fit |
|---|---|---|---|---|---|---|
Phi 3 Medium 128k InstructChatCode | Q4_K_M | 12.0 GB | 84.4 t/s | 131K | S88, Runs great | |
StarcoderChatCode | Q4_K_M | 13.6 GB | 73.6 t/s | — | A80, Runs well | |
Phi 3 Mini 128k InstructChatCode | Q4_K_M | 9.0 GB | 225.9 t/s | 131K | S100, Runs great | |
CodeLlama 7B HFChatCode < 32K context fits | Q4_K_M | 12.9 GB | 141.7 t/s | 16K | S95, Runs great | |
CodeQwen1.5 7BChatCode | Q4_K_M | 5.7 GB | 160.7 t/s | 66K | S97, Runs great | |
Codegemma 7B ITChatCode | Q4_K_M | 8.2 GB | 136.4 t/s | — | S96, Runs great | |
Deepseek Coder 7B Instruct V1.5ChatCode < 32K context fits | Q4_K_M | 6.5 GB | 140.9 t/s | 4K | S96, Runs great | |
DeepSeek Coder v2 Lite BaseChatCode | Q4_K_M | 10.2 GB | 220.2 t/s | 164K | S100, Runs great | |
Codegemma 2BChatCode | Q4_K_M | 3.5 GB | 465.5 t/s | — | S100, Runs great | |
Phi 3 Medium 4k InstructChatCode < 32K context fits | Q4_K_M | 9.5 GB | 84.4 t/s | 4K | S88, Runs great | |
Deepseek Coder 1.3B InstructChatCode < 32K context fits | Q4_K_M | 4.3 GB | 508.6 t/s | 16K | S100, Runs great | |
Deepseek Coder 6.7B InstructChatCode < 32K context fits | Q4_K_M | 12.9 GB | 141.7 t/s | 16K | S95, Runs great | |
Qwen2.5 Coder 3BChatCodeFunctions | Q4_K_M | 2.8 GB | 344.4 t/s | 33K | S100, Runs great | |
Qwen2.5 Coder 7BChatCodeFunctions | Q4_K_M | 5.8 GB | 153.9 t/s | 33K | S97, Runs great | |
Qwen2.5 Coder 1.5BChatCodeFunctions | Q4_K_M | 1.7 GB | 600.0 t/s | 33K | S100, Runs great |
Built for code
Models trained specifically for programming. Most have too few public coding benchmarks for a score yet, so they are listed by what they need and what has been measured.
Alibaba · 30.5B
- Needs
- 16 GB
- SWE-bench Verified
- 60.4%
Devstral Small 2 24B Instruct 2512
Mistral AI · 24.0B
- Needs
- 24 GB
- SWE-bench Verified
- 56.4%
Alibaba · 32.8B
- Needs
- 24 GB
- SWE-bench Verified
- 47%
Mistral AI · 23.6B
- Needs
- 24 GB
- SWE-bench Verified
- 46.8%
Mistral AI · 23.6B
- Needs
- 24 GB
- SWE-bench Verified
- 38%
Alibaba · 7.6B
- Needs
- 8 GB
- Speed
- 71.8 t/s
Alibaba · 79.7B
- Needs
- 48 GB
- Speed
- 144.0 t/s
Alibaba · 14.8B
- Needs
- 16 GB
- Speed
- 80.3 t/s
How much memory do you need for a coding model?
On 8 GB the best coding model is Qwen2.5 Coder 7B Instruct. At 12 GB it is GPT OSS 20B (score 102). From 16 to 32 GB it is Qwen3.8 27B (score 118). With no memory limit, the best is Kimi K3.1 Pro (score 135). Mixture-of-experts models store all weights in memory yet activate only a few billion parameters per token, allowing them to decode far quicker than their total size implies. For code completion inside an editor, speed matters more than reaching the final bits of a high score.
Frequently Asked Questions
What is the best local LLM for coding?
On 24 GB, Qwen3.8 27B is the top pick with a coding score of 118, running at about 46 t/s on RTX 4090. It fits up to 64K tokens of context there. On 8 GB, the best fit is Qwen2.5 Coder 7B Instruct. With no memory limit, the best is Kimi K3.1 Pro. Open a model to see which GPUs and Macs run it.
Can I run a coding model on a laptop or an 8 GB GPU?
Yes. On 8 GB the best pick is Qwen2.5 Coder 7B Instruct (Q4_K_M, 5.8 GB), which runs at about 72 t/s on RTX 5060. Laptops with 8 to 16 GB of memory can run smaller models in the same way.
Are local coding models as good as cloud models?
Top open models today manage daily coding, autocomplete, and refactoring effectively while running offline so your code stays local. Cloud giants still take the lead on complex multi-file jobs.
How do I run these coding models?
Set up Ollama or LM Studio, then pull the desired model. Every model's page provides its installation command alongside details on which GPUs and Macs support it across all quantization levels.