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.
Moonshot AI · Q4_K_M · needs 1.7 TB · up to 1M context · runs on about 3 nodes of 8× H100 SXM 80 GB · from $64.56/hr in the cloud
No memory limit: the best model, whatever memory it needs.
Also worth a look
Qwen3 Coder 480B A35B Instructcode model
Q4_K_M · needs 291 GB · about 5× H100 SXM 80 GB · 256K ctx
Q4_K_M · needs 458 GB · about 7× H100 SXM 80 GB · 1M ctx
Also worth a look
Qwen3 Coder 480B A35B Instructcode model
Q4_K_M · needs 291 GB · about 5× H100 SXM 80 GB · 256K 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, no memory limit88
Ranked by coding score, models without one after (code specialists first, by SWE-bench Verified). Memory is what the listed quant needs; speed is shown only for models that fit one 48 GB GPU.
88 models
Score: llmrun Score, 100 = average model. Ordered by Score. How ranking works
| Model | Quant | VRAM | Speed | Context | Score |
|---|---|---|---|---|---|
MiniMax M2.7ChatFunctions | Q4_K_M | 139.6 GB | — | 205K | |
Qwen3.6 27BVisionFunctions | Q4_K_M | 17.9 GB | 44.1 t/s | 262K | |
Qwen3 235B A22B Thinking 2507ChatFunctions | Q4_K_M | 142.9 GB | — | 262K | |
Mistral Medium 3.5 128BChatFunctions | Q4_K_M | 82.8 GB | — | 262K | |
GPT OSS 120BChatFunctions | Q4_K_M | 70.8 GB | — | 131K | |
GPT OSS 20BChatFunctions | Q4_K_M | 13.1 GB | 184.7 t/s | 131K | |
Qwen3 Coder 480B A35B InstructChatCodeFunctions | Q4_K_M | 290.5 GB | — | 262K | |
DeepSeek V3.2 ExpChatFunctions | Q4_K_M | 412.7 GB | — | 164K | |
GLM 4.5ChatFunctions | Q4_K_M | 217.9 GB | — | 131K | |
Qwen3.5 27BVisionFunctions | Q4_K_M | 17.9 GB | 44.1 t/s | 262K | |
DeepSeek R1ChatReasoningFunctions | Q4_K_M | 412.1 GB | — | 164K | |
DeepSeek v3 0324ChatFunctions | Q4_K_M | 412.1 GB | — | 164K | |
GLM 4.6ChatFunctions | Q4_K_M | 216.9 GB | — | 203K | |
NVIDIA Nemotron 3 Super 120B A12B BF16ChatFunctions | Q4_K_M | 74.7 GB | — | 262K | |
Kimi K2 Instruct 0905ChatFunctions | Q4_K_M | 617.3 GB | — | 262K |
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.