Quick Answer
Devstral Small 2 is the best coding model that fits in 16GB of VRAM, scoring 68.0% on SWE-bench Verified under an Apache-2.0 licence. At 8GB, Granite 4.2 8B is the realistic pick, and at 24GB, Qwen3.8-27B. Since Ollama v0.14, local models work directly with Claude Code.
Devstral Small 2 is the best coding model that fits in 16GB of VRAM, scoring 68.0% on SWE-bench Verified under an Apache-2.0 licence. At 8GB, Granite 4.2 8B is the realistic pick. At 24GB, Qwen3.8-27B. And since Ollama v0.14, local models work directly with Claude Code through an Anthropic-compatible endpoint.
Key takeaways
- Devstral Small 2 (24B, Apache-2.0) scores 68.0% on SWE-bench Verified and is the strongest model that plausibly fits 16GB.
- Its larger sibling Devstral 2 (123B) reaches 72.2%, but needs roughly 4x H100-class GPUs.
- Granite 4.2 8B (Apache-2.0) scores 47.67% and is the sensible 8GB choice.
- Ollama v0.14+ exposes an Anthropic-compatible API, so Claude Code can drive local models with no proxy.
- VRAM figures below are computed estimates, not vendor specifications. We explain the arithmetic so you can check it.
A warning about VRAM numbers
Almost every "best model for 16GB VRAM" article is unsourced, and they contradict each other. We found listicles recommending three different models as the 16GB pick, several citing models from 2025.
Rather than repeat those, the tiers below are calculated using Epoch AI's published heuristic: roughly 0.54 bytes per parameter at 4-bit quantisation, plus KV cache for your context length, plus about 2GB of overhead.
So a 24B model at 4-bit is roughly 24 × 0.54 ≈ 13GB of weights, leaving headroom in 16GB for context and system use. That is arithmetic you can verify, not a number copied from a blog.
Actual memory use varies with quantisation method, context length and inference engine. Treat these as starting points and expect to adjust.
The tiers
8GB VRAM
Granite 4.2 8B (IBM, Apache-2.0): SWE-bench Verified 47.67%. The 8B size fits comfortably at 4-bit with room for context, and Apache-2.0 means no commercial restrictions.
Granite 4.2 3B if 8B is tight alongside other applications.
Gemma 4 E4B or 12B at aggressive quantisation are alternatives, though 12B will be a squeeze.
Honest expectation: 8GB models handle autocomplete, small functions, boilerplate and explaining code. They are not going to resolve complex multi-file issues reliably.
16GB VRAM: the sweet spot
Devstral Small 2 (Mistral, 24B, Apache-2.0) is the standout. SWE-bench Verified 68.0%, a 256K context window, and Mistral designs it to run on a single GPU. At 4-bit it computes to roughly 13GB of weights.
This is remarkable positioning: 68% on SWE-bench Verified is close to the 72.2% of its 123B sibling, which needs datacenter hardware.
Qwen3.8-27B (Apache-2.0) is possible at 16GB with aggressive quantisation and short context, but 24GB is more comfortable.
24GB VRAM
Qwen3.8-27B (Apache-2.0): SWE-bench Pro 61.7, Terminal-Bench 2.1 73.0, LiveCodeBench v6 90.3, GPQA Diamond 89.2. At 4-bit its weights compute to roughly 17.8GB, leaving room for a useful context window.
Granite 4.2 30B (Apache-2.0): SWE-bench Verified 57.0.
Muse Glimmer (Meta, 30B, Apache-2.0): tuned for tool use, long tasks and failure recovery, which suits agentic coding workflows.
32GB and above
Qwen3.8-27B at its full 256K context needs roughly 48GB. Nemotron 3.5 Lightning (30B MoE, 3B active) is efficient here. Above this you are into models that need multiple GPUs.
What you cannot run locally
Worth being clear, because several models topping the open-weight leaderboards are not local options at all:
| Model | Size | Reality |
|---|---|---|
| Kimi K3 | 1.56TB weights | Datacenter only |
| GLM-5.3 | 756GB FP8, ~8 GPUs | Datacenter only |
| DeepSeek V4 Pro | 893GB | Datacenter only |
| Devstral 2 | 123B | ~4x H100-class |
You can download these. You cannot run them on a workstation. If you want their capability, use an API. Our guide to open source LLM API pricing covers what each costs.
Benchmark reference
| Model | Params | Licence | Key score |
|---|---|---|---|
| Devstral 2 | 123B | Modified MIT | SWE-bench Verified 72.2% |
| Devstral Small 2 | 24B | Apache-2.0 | SWE-bench Verified 68.0% |
| GLM-5.3 | 753B | Custom | Terminal-Bench 2.1 88.2 |
| GLM-5.3-Flash | 320B/18B | MIT | Terminal-Bench 2.1 84.3 |
| DeepSeek V4 Pro | 1.6T | MIT | Terminal-Bench 2.1 87.9 |
| Qwen3.8-27B | 27B | Apache-2.0 | SWE-bench Pro 61.7 |
| Granite 4.2 30B | 30B | Apache-2.0 | SWE-bench Verified 57.0 |
| Granite 4.2 8B | 8B | Apache-2.0 | SWE-bench Verified 47.67 |
One note on benchmarks: the Aider polyglot leaderboard is not current: its top entries are from the GPT-5 and DeepSeek-V3.2 era. Articles citing it as a 2026 ranking are using stale data.
How to actually use these
Install Ollama, then pull a model: ollama pull qwen3-coder or the equivalent for your choice. Our guide to running AI locally with Ollama covers setup and hardware in detail.
Connect it to Claude Code. Since Ollama v0.14.0 (January 2026), Ollama exposes an Anthropic Messages API-compatible endpoint, so Claude Code talks to local models with no proxy:
ANTHROPIC_AUTH_TOKEN=ollama
ANTHROPIC_BASE_URL=http://localhost:11434
Ollama recommends at least a 32K context window for coding work, which matters when sizing your VRAM budget.
Mistral's Vibe CLI is an Apache-2.0 open-source coding agent built around Devstral, if you prefer a purpose-built tool.
Cursor and Continue.dev also support local models, though we have not verified their current configuration paths.
Licences: check before you build
For coding models this matters more than usual, because output may end up in commercial products.
Cleanly permissive: Devstral Small 2, Qwen3.8-27B, Granite 4.2, Muse Glimmer and Gemma 4 are all Apache-2.0. DeepSeek V4 Pro and GLM-5.3-Flash are MIT.
Needs attention: GLM-5.3 carries a custom licence, not MIT, despite frequent reports otherwise. Kimi K3 requires a separate agreement if you run a Model-as-a-Service business over $20 million in revenue. Devstral 2 uses a modified MIT licence.
For local coding on a single GPU, everything we recommend above is Apache-2.0, so the question does not arise.
Which should you choose?
8GB: Granite 4.2 8B. Modest but genuinely useful for autocomplete and small tasks.
16GB: Devstral Small 2. Best capability that fits, Apache-2.0, and 68% SWE-bench Verified is close to models needing 5x the hardware.
24GB: Qwen3.8-27B for general strength, or Muse Glimmer for agentic workflows.
No suitable GPU: use an API. GLM-5.3-Flash at $0.10 per million tokens costs less than electricity would.
The verdict
Local coding models became genuinely useful in 2026. Devstral Small 2 hitting 68% on SWE-bench Verified in 16GB of VRAM is the headline: that is a real assistant, not a toy, running entirely on your own machine with no subscription and no code leaving your network.
Set expectations by tier. An 8GB model helps with small tasks. A 16GB model handles real work. And the models topping the leaderboards need a datacenter, so use an API for those rather than budgeting for hardware you cannot justify.
Related reading: how to run AI locally with Ollama and open source LLM API pricing.
Pricing verified against each vendor's own pricing page in September 2026. Plans change often, so check the vendor's page before you buy.
Frequently Asked Questions
What is the best coding model for 16GB VRAM?
Devstral Small 2, a 24B Apache-2.0 model from Mistral scoring 68.0% on SWE-bench Verified with a 256K context window. At 4-bit quantisation its weights compute to roughly 13GB, leaving headroom for context in 16GB.
What coding model runs on 8GB VRAM?
Granite 4.2 8B from IBM, Apache-2.0 licensed, scoring 47.67% on SWE-bench Verified. Expect it to handle autocomplete, small functions and code explanation rather than complex multi-file work.
Can you use local models with Claude Code?
Yes. Since Ollama v0.14.0 in January 2026, Ollama exposes an Anthropic Messages API-compatible endpoint, so Claude Code connects with no proxy. Set ANTHROPIC_AUTH_TOKEN=ollama and ANTHROPIC_BASE_URL=http://localhost:11434. Ollama recommends at least a 32K context window.
Can you run GLM-5.3 or Kimi K3 locally?
No. Kimi K3 is about 1.56TB of weights, GLM-5.3 needs roughly 8 GPUs at 756GB in FP8, and DeepSeek V4 Pro is 893GB. These are datacenter models. Use an API if you want their capability.
How do you calculate VRAM needs for a model?
Use roughly 0.54 bytes per parameter at 4-bit quantisation, plus KV cache for your context length, plus about 2GB overhead. A 24B model works out near 13GB of weights. Actual use varies with quantisation method and inference engine, so treat it as a starting point.


