llmrun

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.

Qwen2.5 Coder 7B Instruct

Alibaba · Q4_K_M · 5.8 GB · up to 32K context · on RTX 5060

71.8 t/s
S

All 15 coding models for 8 GB ↓

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

Coding models that run on 8 GB15

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.

15 models · 9 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 5060

LLM models compatible with NVIDIA GeForce RTX 5060 — ranked by Score, recency and Fit
ModelVRAMScoreFit
Llama 3.1 8B Instruct
< 32K context fits
Q4_K_M·67.6 t/s
7.9 GBC44, Usable
ALoDLM 8B
< 32K context fits
Q4_K_M·64.9 t/s
7.6 GBB62, Decent
Q4_K_M·149.9 t/s
7.8 GBB62, Decent
Granite Docling 258M
< 32K context fits
Q4_K_M·716.8 t/s
0.6 GBS100, Runs great
Phi 4 Mini Reasoning
Q4_K_M·124.9 t/s
4.8 GBS95, Runs great
Phi 4 Mini Instruct
Q4_K_M·124.9 t/s
4.8 GBS95, Runs great
Qwen2.5 Coder 7B Instruct
Q4_K_M·71.8 t/s
5.8 GBS86, Runs great
Yi Coder 9B Chat
Q4_K_M·61.8 t/s
7.2 GBA70, Runs well
Starcoder2 3B
< 32K context fits
Q4_K_M·164.4 t/s
2.6 GBS97, Runs great
Phi 2
< 32K context fits
Q4_K_M·135.8 t/s
2.6 GBS96, Runs great
Phi 3 Mini 4k Instruct
< 32K context fits
Q4_K_M·105.4 t/s
4.2 GBS92, Runs great
Mellum2 12B A2.5B Instruct
Q4_K_M·149.9 t/s
7.8 GBB62, Decent
Mellum2 12B A2.5B Thinking
Q4_K_M·149.9 t/s
7.8 GBB62, Decent
CodeQwen1.5 7B
Q4_K_M·75.0 t/s
5.7 GBS86, Runs great
Qwen2.5 Coder 3B
Q4_K_M·160.7 t/s
2.8 GBS97, 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.

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.