RunLLMLocal

Guides · Models · 8 min read

The best local LLM for coding in 2026, by GPU size

A local coding model keeps your code on your own machine, works offline and costs nothing per request. The catch is that the right model depends almost entirely on how much memory your graphics card has. This guide picks the best coding model for each common VRAM size, with realistic speeds and the exact model to pull in Ollama.

Numbers come from the same math as our checker, at 8K context with the best quantization that fits. Speeds are estimates; real results vary by about 30% with software and settings.

The short answer

Your memoryBest coding modelQuantSpeed (example card)
8 GBQwen2.5-Coder 7BQ5_K_M~33 tok/s (RTX 4060)
12 GBQwen2.5-Coder 7B or Qwen3.5 9BQ8_0 / Q6_K~29 tok/s (RTX 3060)
16 GBgpt-oss 20B or Qwen3 14BQ4_K_M / Q5_K_M~60 / ~28 tok/s (RTX 5060 Ti)
24 GBQwen3-Coder 30B-A3BQ4_K_M~120 tok/s (RTX 3090)
32 GBQwen3-Coder 30B-A3B or Qwen2.5-Coder 32BQ6_K / Q5_K_M~170 / ~50 tok/s (RTX 5090)

Two jobs, two models

Coding with a local model usually means two different tasks, and they want different models:

  • Autocomplete suggests the next few lines as you type. It has to answer in a fraction of a second, so a small, fast model wins. Qwen2.5-Coder 7B or even Qwen3 4B is ideal.
  • Chat and agents explain code, write whole functions or edit several files. Quality matters more than speed here, so use the biggest model that fits.

On 16 GB or more you can keep a small model for autocomplete and a larger one for chat. Editor extensions like Continue and Cline let you set each one separately.

8 GB: Qwen2.5-Coder 7B

On an 8 GB card such as the RTX 4060, Qwen2.5-Coder 7B at Q5_K_M needs about 6.8 GB and runs at roughly 33 tokens per second. It is still the strongest small model built only for code, with fill-in-the-middle support for autocomplete. Qwen3 8B at Q4 is a good second choice if you also want general chat. Pull it with ollama run qwen2.5-coder:7b.

Anything larger, including Qwen3 14B and the 22B to 24B coding models, spills into system RAM and drops to a few tokens per second. More on this tier in the best models for 8 GB.

12 GB: the same models at higher quality

A 12 GB card like the RTX 3060 runs Qwen2.5-Coder 7B at full Q8 quality (about 9.8 GB, ~29 tokens per second) and Qwen3.5 9B at Q6_K. Qwen3.5 9B is newer, handles longer files well because its context memory is small, and can read screenshots of errors or UI. Qwen3 14B is just over the limit at 8K context, so it only fits with a shorter context. See the best models for 12 GB for details.

16 GB: gpt-oss 20B for speed, Qwen3 14B for steady code

16 GB is where local coding gets genuinely useful. gpt-oss 20B fits at Q4_K_M and, because it is a mixture-of-experts model that only uses about 3.6 billion parameters per word, it runs at around 60 tokens per second on an RTX 5060 Ti. It reasons well about bugs and design questions. Qwen3 14B at Q5_K_M is slower, around 28 tokens per second, but very consistent at writing and editing code.

Dedicated coding models like Codestral 22B and Devstral Small 24B need 16 to 17 GB, so they do not fit fully on 16 GB. Our 16 GB guide lists everything that does.

24 GB: Qwen3-Coder 30B-A3B is the one to beat

With 24 GB, such as a used RTX 3090 or an RTX 4090, the best choice is clear. Qwen3-Coder 30B-A3B fits at Q4_K_M in about 20.6 GB and, as a mixture-of-experts model with only 3 billion active parameters, runs at roughly 120 tokens per second. It is built for agentic coding: reading a repository, planning changes and editing several files. Pull it with ollama run qwen3-coder:30b.

Other strong options at this size:

  • Devstral Small 24B at Q5_K_M (~36 tokens per second), tuned for software engineering agents.
  • Qwen3.6 27B at Q4_K_M (~37 tokens per second), a newer dense model that is good at code and also reads images.
  • Codestral 22B at Q5_K_M, Mistral's coding model with fill-in-the-middle for autocomplete.

The dense 32B coders, such as Qwen2.5-Coder 32B, sit just over the limit in our estimate: about 23 GB at Q4 with 8K context, while a 24 GB card gives a model around 21.6 GB. Part of the model spills into system RAM and speed drops sharply, so on 24 GB the MoE Qwen3-Coder is both faster and easier.

32 GB and more

An RTX 5090 runs Qwen3-Coder 30B-A3B at Q6_K, closer to full quality, at around 170 tokens per second, and finally fits Qwen2.5-Coder 32B at Q5_K_M (~50 tokens per second). Qwen3.6 35B-A3B also fits here and is one of the fastest strong models you can run on a single card.

Coding on a Mac

Macs share memory between the CPU and GPU, so the question is how much unified memory you have. A Mac with 24 GB runs Qwen3-Coder 30B-A3B only at a low Q3 quantization. With 36 to 48 GB it fits comfortably: about 60 tokens per second on an M4 Max with 36 GB at Q5, or about 26 tokens per second on an M4 Pro with 48 GB at Q6. Our Mac guide covers every chip.

Connecting it to your editor

  1. Install Ollama and pull the model for your tier.
  2. Install the Continue or Cline extension in VS Code or a JetBrains IDE.
  3. Choose Ollama as the provider and pick your model. In Continue, set a small model for autocomplete and the bigger one for chat.
  4. Keep context at 8K to 16K unless you have spare memory. Longer context costs VRAM and slows every reply.

Not sure which tier you are in? Pick your card in the checker and switch the filter to Coding to see every coding model that fits.

Copied