Best Local LLM for Coding by VRAM: 8, 12, 16, 24 and 32 GB

A desktop PC with a clear side panel showing a graphics card, next to a dark monitor, a keyboard, a mouse and a mug of coffee on a wooden desk.

By Annie Vane · Models · Local · Docs-only · Checked November 24, 2026

What is the best local LLM for coding on your graphics card?

Pick by your card's memory (VRAM). With 8 to 16GB, run MiMo V2.6 9B or Gemma 4 12B for code questions and short scripts; with 24GB, Qwen 3.8 27B is the step up for coding agents; with 32GB, Qwen 3.6 35B A3B or Devstral Small 2 leave room for the long context agents need. These are our picks from the makers' documentation and Ollama's listed sizes: a documentation review, not a benchmark.

Field card: best local LLM for coding, by VRAM. 8 to 12GB: MiMo V2.6 9B; 12 to 16GB: Gemma 4 12B; 24GB: Qwen 3.8 27B for agents; 32GB: Qwen 3.6 35B A3B or Devstral Small 2; coding tools want a context of 64K tokens or more.

This guide follows one reader: a developer with a desktop PC and a graphics card, who wants a private coding helper that never sends their code to a cloud service, and wants to know which model their card can actually hold.

Picks by VRAM at a glance

Your VRAMOur pickOllama tag and downloadGood for
8GBMiMo V2.6 9B, at a small contextmimo-v2.6:9b-q4_K_M, 6.6GBCode questions and short snippets; tight
12GBMiMo V2.6 9B or Gemma 4 12B6.6GB; gemma4:12b, 7.7 to 8.0GBCode questions and short scripts
16GBGemma 4 12B or MiMo V2.6 9B, with more context7.7 to 8.0GB; 6.6GBLonger files in view; gpt-oss-20b (14GB) is the tight ceiling
24GBQwen 3.8 27Bqwen3.8:27b, 18GBCoding agents that read and edit a project
32GBQwen 3.6 35B A3B or Devstral Small 2qwen3.6:35b, 23GB; devstral-small-2, 15GBCoding agents with long context
Download sizes from each model's Ollama tags page, opened November 24, 2026. Picks follow our best Ollama models guide and our model guides.

Why coding needs more memory than chat

A coding tool fills the model's context with your files and its own tool output. Ollama's documentation says tasks such as agents and coding tools should be set to at least 64000 tokens, but Ollama's default below 24 GiB of VRAM is 4k. That context needs memory on top of the model file.

How much depends on the model's design. In the worked example in our memory guide, an 8B model's conversation memory is about 4GB at 32,768 tokens, so by our estimate from that example, a 64,000-token context can need more memory than the model file itself. That is why we suggest coding agents from 24GB up, and plain code questions below that.

8GB and 12GB: code questions and short scripts

MiMo V2.6 9B is Xiaomi's 9B model for code and agent work, MIT licensed. Its 4-bit tag is a 6.6GB download, which our guide lists as a fit for a GPU with 8GB of VRAM at a small context, so on an 8GB card keep the context short. With 12GB it has room to breathe.

Gemma 4 12B is our everyday pick, and our best models guide uses it for code questions and short scripts too. Its 7.7 to 8.0GB download fits on a 12GB card at an 8k context, according to the worked examples in our memory guide, while on an 8GB card part of it spills into system RAM and slows down.

16GB: the same models, with longer files in view

On 16GB, stay with Gemma 4 12B or MiMo V2.6 9B and spend the spare memory on context, so the model can see more of your code at once. gpt-oss-20b, a 14GB download, is the tight ceiling here; our best models guide lists it for reasoning and tool use, at 16GB tight or 24GB.

24GB: Qwen 3.8 27B for coding agents

Coding agents, tools that read and edit a whole project, are where 24GB pays off. Our best models guide picks Qwen 3.8 27B for coding and agents at 24GB: an 18GB download under Apache 2.0. Meta's Muse Glimmer 30B, also 18GB on Ollama, is built for local agents and listed for 24 to 32GB.

32GB: room for long context

With 32GB, the main table in our best models guide lists two models for coding agents at that size. Qwen 3.6 35B A3B is a mixture-of-experts model, a 23GB download that answers at closer to small-model speed but still needs all of its memory. Mistral's Devstral Small 2 is a 15GB download with a 384K context window on Ollama, which leaves room for the long context agents use.

How to set it up

Install Ollama, pull the model for your card, then raise the context before you connect a coding tool. Our Ollama install guide covers the first step; Ollama's docs show the context setting:

ollama pull qwen3.8:27b
OLLAMA_CONTEXT_LENGTH=64000 ollama serve

On Windows, set OLLAMA_CONTEXT_LENGTH as a user environment variable and restart Ollama instead. Then run ollama ps: if the PROCESSOR column shows a CPU/GPU split rather than 100% GPU, the model and context no longer fit your card, so step down a size. Our guide to Ollama not using the GPU explains that column.

Common questions

What is the best local LLM for coding with 32GB of VRAM?

Qwen 3.6 35B A3B (23GB) or Devstral Small 2 (15GB), both listed for coding agents at 32GB in our best models guide's main table. Devstral's smaller file leaves more of the card for context.

Can I run a coding agent on an 8GB or 12GB card?

Only in a limited way. Ollama suggests at least 64,000 tokens of context for coding tools, and that context needs memory beyond the model file. On 8 to 12GB, use a 9B to 12B model for questions and short scripts instead.

Are these models free to use?

They are free to download. Licenses differ: MiMo V2.6 is MIT, and Gemma 4 and Qwen 3.8 are Apache 2.0. Our guide to using local AI models commercially explains what to check.

Verdict for the developer with a graphics card

Find your VRAM, pull the pick in that row, and raise the context before you judge it. On 8 to 16GB, use it for questions and short scripts; save coding agents for 24GB and up. Our advice: if a model spills onto the CPU, step down a size rather than shrinking the context.

Sources

Next steps: Choose a GPU for local AI · Set up a local LLM on Windows

Spotted a mistake? Tell us

Annie Vane, author of Local AI Scout

ABOUT THE AUTHOR

Annie Vane

Annie edits Local AI Scout and tests the models she covers on her own 24 GB M5 MacBook Air. She has worked in search, affiliate marketing and digital publishing for national newspapers and magazine groups.

More about Annie and how we test

Keep exploring: Apps · Models · All guides

Good finds.
Less noise.

The Scout Letter: new guides, app reviews and "Can I run it?" checks on new models, in one short email every two weeks. No spam.

Free to join. Unsubscribe with one click.