Best local LLM for coding, by how much memory you have
Short answer: on a 24 GB card, Qwen3.8 27B at Q5; on 16 GB, gpt-oss-20b; on 12 GB, Ministral 3 14B at Q4; on a 128 GB Mac, Qwen3.5 122B-A10B. Full table below.
| Your hardware | Our pick for coding | Format | Memory |
|---|---|---|---|
| Laptop or PC with 16 GB RAM | Ministral 3 14B | Q4_K_M | ≈10 GB |
| RTX 4060 (8 GB VRAM) | Qwen3.5 9B | Q4_K_M | ≈6.9 GB |
| RTX 3060 12 GB | Ministral 3 14B | Q4_K_M | ≈10 GB |
| RTX 4060 Ti 16 GB | gpt-oss-20b | Q4_K_M | ≈15 GB |
| RTX 4090 (24 GB VRAM) | Qwen3.8 27B | Q5_K_M | ≈23 GB |
| RTX 5090 (32 GB VRAM) | Qwen3.8 27B | Q6_K | ≈26 GB |
| 2x RTX 3090 (48 GB) | Qwen3.8 27B | Q8_0 | ≈33 GB |
| Mac with 64 GB unified memory | Qwen3.8 27B | Q8_0 | ≈33 GB |
| Mac with 128 GB unified memory | Qwen3.5 122B-A10B | Q4_K_M | ≈85 GB |
| Mac Studio with 512 GB unified memory | DeepSeek V4.1 Flash | Q4_K_M | ≈372 GB |
Picks are our editorial choice based on what each maker says the model is built for (coding, agentic coding) and its size; they are not benchmark results.
For coding assistants inside your editor, pair the model with a local server (Ollama or LM Studio) and an extension that supports local OpenAI-compatible endpoints.
Questions
What is the best local coding model for 24 GB VRAM?
Our pick is Qwen3.8 27B at Q5_K_M (about 23 GB by our estimate); Qwen describes it as built for coding and agent tasks.
Can I run a coding model on a laptop?
Yes, small models such as Qwen3.5 9B or Qwen3 4B run on 16 GB RAM laptops, slowly without a GPU.
Memory figures are our estimates (parameters × bits ÷ 8, plus overhead and an 8K-token cache; method). Facts about apps come from their official documentation, checked November 30, 2026.
More local-AI guides
- Q4_K_M vs Q5_K_M vs Q8: which quantization should you use?
- Ollama vs LM Studio vs llama.cpp
- How much VRAM do I need to run an LLM?
- How to run local LLMs on an AMD GPU (Windows and Linux)
- How to run an LLM on a laptop without a graphics card
- Mac or NVIDIA graphics card for local AI?
Which LLM runs on my GPU, Mac or laptop? · All open-source models