All posts
AI Engineering·8 min read·Updated 23 Oct 2026

Best Local LLM for Coding in 2026: What Runs on 16GB VRAM, Macs and Laptops

Quick answer
Pick a local coding model by memory. Qwen2.5-Coder 7B or 14B fits most 16GB machines; gpt-oss 20B is built for 16GB; Devstral 24B and Qwen3-Coder 30B want 24GB of VRAM or a Mac with 32GB unified memory. Run them with Ollama or llama.cpp and connect your editor with Continue.

Which open coding models run on your hardware: a memory rule of thumb, picks for 8GB, 16GB, 24GB and Apple Silicon, the tools to run them (Ollama, llama.cpp, Continue) and honest limits.

Piyush Jangir
Verified author

Founder of StackPicks. Self-taught builder shipping open-source dev tools, marketing, and curator content since 2019. Based in Mumbai, India. Available on GitHub and LinkedIn.

8 min read
Best Local LLM for Coding in 2026: What Runs on 16GB VRAM, Macs and Laptops

**Short version:** the right local model is the biggest one that fits your memory with room left for context. Below is a rule of thumb, picks for each hardware tier, and the free tools to run them. Model sizes are from the Ollama library; star counts are from GitHub on 23 October 2026.

The memory rule of thumb

At the 4-bit quantisation most local tools use by default, a model needs roughly 0.6 GB of memory per billion parameters, plus a few GB for context and the runtime. So a 14B model is about 9 GB, a 24B model about 14 GB, and a 30B model about 18 GB. Long contexts add more. Treat these as estimates, not guarantees — check actual usage after loading.

Which local coding models fit 8GB, 16GB, 24GB and Apple Silicon

Picks by hardware

Your machineComfortable picksNotes
8 GB VRAM / 16 GB MacQwen2.5-Coder 7BGood completions; weaker on big refactors
16 GB VRAMQwen2.5-Coder 14B, gpt-oss 20BOpenAI built gpt-oss 20B to run within 16 GB
24 GB VRAMDevstral 24B, Qwen2.5-Coder 32B (tight)Devstral is tuned for coding agents
Mac, 32 GB+ unifiedQwen3-Coder 30B, Devstral 24BUnified memory lets Macs punch above their GPU

Qwen2.5-Coder comes in 0.5B to 32B sizes, Qwen3-Coder in 30B and 480B, Devstral in 24B, and gpt-oss in 20B and 120B. The 480B and 120B variants are for servers, not laptops.

The tools that run them

GitHub stars of the main local LLM tools

  • **Ollama** (MIT, ~184k stars) — the easy path. ollama run qwen2.5-coder:14b downloads and starts a model, and exposes a local API.
  • **llama.cpp** (MIT, ~132k stars) — the engine underneath much of the ecosystem; more control, more flags.
  • **Continue** (Apache-2.0, ~36k stars) — an open-source coding agent for VS Code and JetBrains that can point at your local Ollama models.

For a full self-hosted chat setup with a browser UI, follow our Ollama + Open WebUI guide.

Honest limits

Local models have improved fast, but on long, multi-file agentic tasks they still trail the frontier cloud models in Claude Code or Codex. Where local shines:

  • Privacy — code never leaves your machine, useful under client NDAs.
  • Offline — flights, unreliable connections.
  • Cost at volume — completions and small edits all day, no per-token bill.

A common setup is local for autocomplete and quick questions, a cloud agent for the hard tasks. For free cloud-side options, see free Cursor alternatives and open-source alternatives to Claude Code.

Frequently asked questions

What is the best local LLM for coding on 16GB VRAM?+

On 16GB of VRAM, Qwen2.5-Coder 14B is a dependable choice for completions and edits, and OpenAI designed its open-weight gpt-oss 20B to run within 16GB of memory. Both leave some headroom for context at 4-bit quantisation. Larger models such as Devstral 24B or Qwen3-Coder 30B need around 14 to 18GB before context, so they are tight or too large for a 16GB card.

How much RAM do I need to run a coding LLM locally?+

A practical rule of thumb at 4-bit quantisation is about 0.6GB of memory per billion parameters, plus a few gigabytes for context and the runtime. That puts a 7B model near 5GB, a 14B model near 9GB, a 24B model near 14GB and a 30B model near 18GB. Long context windows increase usage further, so always leave headroom and check real usage once the model is loaded.

Can a Mac run local coding models well?+

Yes, Apple Silicon Macs are strong local LLM machines because the GPU shares unified memory with the system. A Mac with 32GB or more of unified memory can run 24B to 30B coding models such as Devstral or Qwen3-Coder that would not fit on many consumer graphics cards. Speed depends on the chip generation and memory bandwidth, and Ollama and llama.cpp both support Apple Silicon.

Is a local LLM as good as Claude Code for coding?+

Not for everything. Local open models handle autocomplete, explanations and small edits well, and they keep code on your machine. On long, multi-file agentic tasks they still trail the frontier cloud models used by Claude Code and Codex. Many developers combine both: a local model for everyday completions and private code, and a cloud agent for complex refactors and larger features.

How do I use a local LLM in VS Code?+

Install Ollama, pull a coding model such as qwen2.5-coder, and leave it running so it serves a local API. Then install Continue, an open-source coding agent for VS Code and JetBrains, and configure it to use your Ollama models for chat and autocomplete. Everything runs on your machine, so it works offline and your code is never sent to a cloud provider.

More in AI Engineering

Best Local LLM for Coding in 2026: What Runs on 16GB VRAM, Macs and Laptops — StackPicks — StackPicks