· reAPI Team
Local LLM for Coding: Which Models Fit 8, 16, 32 or 64 GB
A local LLM for coding has to fit your memory and hold a 64K context. Tool-capable coding models in Ollama's library, sorted by download size and context.

Choosing a local LLM for coding starts with two numbers, not a leaderboard: how much memory your machine has, and how much context the model can hold. A coding agent such as Claude Code or Cline needs a model that supports tool calls, and Ollama's documentation says coding tools need a context of at least 64,000 tokens.[1] The models below are listed in Ollama's library with tool support, sorted by the download size of their 4-bit versions, as listed on November 4, 2026.[2]
We do not rank them by quality. There is no single independent benchmark that covers all of them on the same agent tasks, and the right pick depends on your repository. What we can give is which ones fit, which ones hold enough context, and which ones run fast on limited memory bandwidth.
Local LLM for coding, by memory budget
| Memory budget | Model (Ollama tag) | 4-bit download | Context window | Notes |
|---|---|---|---|---|
| Up to 8 GB | qwen2.5-coder:7b | 4.7 GB | 32K | Below the 64K agents need |
| Up to 8 GB | mimo-v2.6:9b-q4_K_M | 6.6 GB | 256K | Xiaomi; text and image input |
| Up to 16 GB | qwen2.5-coder:14b | 9.0 GB | 32K | Below the 64K agents need |
| Up to 16 GB | gpt-oss:20b | 14 GB | 128K | OpenAI open-weight model |
| Up to 32 GB | qwen3.6:27b-q4_K_M | 17 GB | 256K | Text and image input; a coding variant is 18 GB |
| Up to 32 GB | qwen3-coder:30b | 19 GB | 256K | Full tag 30b-a3b-q4_K_M |
| Up to 32 GB | north-mini-code-1.0 | 19 GB | 488K | Cohere; 30B total, 3B active |
| Up to 32 GB | qwen2.5-coder:32b | 20 GB | 32K | Below the 64K agents need |
| Up to 64 GB | qwen3-coder-next | 52 GB | 256K | Qwen's agentic coding model |
| Over 64 GB | gpt-oss:120b | 65 GB | 128K | |
| Over 64 GB | nemotron-3.5-super:120b-a12b-q4_K_M | 90 GB | 1M | NVIDIA; 12B active |
| Over 64 GB | qwen3-coder:480b | 290 GB | 256K | Workstation or server only |
Sources: Ollama model library and tag pages.[2][3]
The download size is a floor, not the full requirement. The context cache grows with the window you set, so a 19 GB model running with a 64K or larger context needs more than 19 GB free. Ollama warns that a larger context increases the memory needed to run a model.[1]
Why context length rules some models out
Ollama sets the context from your GPU memory unless you choose one: 4K tokens below 24 GiB of VRAM, 32K between 24 and 48 GiB, and 256K above that.[1] Its Claude Code guide asks for 64K or more on larger repositories.[4] On a 16 GB card, then, you have to raise the default by hand, and the model plus its cache still has to fit.
The model's own ceiling matters too. The qwen2.5-coder tags list a 32K context window, so even with memory to spare they cannot reach the 64K that Ollama recommends for coding agents.[3] They remain useful for autocomplete and short edits. For an agent that reads several files and keeps a long tool history, the 128K to 488K models in the table are the realistic options.
Mixture-of-experts models run faster on the same memory
Cohere describes North Mini Code as "a 30B Mixture-of-Experts model with 3B active parameters": about 30 billion parameters in total, about 3 billion used for each token.[2] Qwen3-Coder's 30B tag carries the same a3b suffix, and NVIDIA's Nemotron tag reads 120b-a12b.[3] All the weights still have to sit in memory, so the download size is the same as a dense model of similar total size. Generation speed is a different story. Each token reads only the active experts, and memory bandwidth, not compute, usually limits how fast a local machine generates tokens.
The effect is large. On a machine with 273 GB/s of memory bandwidth, reading 35 GB of dense 70B weights per token caps output at about 8 tokens per second, while reading about 1.5 GB of 4-bit weights for a 3B-active model allows a far higher ceiling. We work through that arithmetic in our DGX Spark specs guide. For coding agents, which generate long outputs and many tool calls, that difference shows up in every turn.
Connecting a local model to a coding agent
Ollama can start Claude Code against a local model with ollama launch claude; for scripts, ollama launch claude --model <model> --yes -- -p "..." skips the prompts.[4] Ollama lists tool calling and thinking as available "with compatible models", so check the model page for the tools tag before connecting it.[4] LM Studio works too, through its Anthropic-compatible endpoint on port 1234; our Ollama vs LM Studio comparison covers both setups.
Set the context explicitly in either tool. A model that silently runs at 4K will drop files from the conversation and look worse than it is.
FAQ
How much memory do I need for a local coding model?
For an agent with a 64K context, plan on roughly 24 GB or more: a 17 GB to 19 GB model such as qwen3.6:27b or qwen3-coder:30b plus room for the context cache. Smaller models fit in 8 GB to 16 GB, but the ones with a 32K ceiling are better suited to completion than to agents.[1][3]
What is Nemotron 3.5 Super?
Ollama lists it as "NVIDIA's vision-language model for coding, reasoning, tool use, and document understanding". The local tag is a 120B model with 12B active parameters and a 1M-token context; its 4-bit download is 90 GB.[2][3]
Can I run a local LLM for coding on a laptop?
Yes, within the memory limits above. An 8 GB to 16 GB laptop can run mimo-v2.6:9b or gpt-oss:20b, which list 256K and 128K context windows, but leave room for the context cache.[3]
When to use a hosted model instead
A local LLM for coding is worth it when your code cannot leave the machine or when you run enough turns that hardware is cheaper than tokens. If your memory tops out below what a 256K-context model needs, or you want to compare a local model with a larger hosted one on the same task, a hosted API is simpler. reAPI serves models such as Kimi K3, DeepSeek V4 and GLM-5.2 through one OpenAI-compatible key, which makes that comparison a one-line model change.
References
- Ollama. Context length. Retrieved November 4, 2026 from docs.ollama.com/context-length
- Ollama. Model library search: tools capability, "coder". Retrieved November 4, 2026 from ollama.com/search?c=tools&q=coder
- Ollama. Model tag pages: qwen3-coder, qwen3-coder-next, qwen3.6, north-mini-code-1.0, mimo-v2.6, nemotron-3.5-super, qwen2.5-coder and gpt-oss. Retrieved November 4, 2026 from ollama.com/library
- Ollama. Claude Code integration. Retrieved November 4, 2026 from docs.ollama.com/integrations/claude-code