GPT Image 2.5 is live — OpenAI's newest image model, targeted edits that leave the rest of the frame alone
All resources

· 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.

Local LLM for Coding: Which Models Fit 8, 16, 32 or 64 GB

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 budgetModel (Ollama tag)4-bit downloadContext windowNotes
Up to 8 GBqwen2.5-coder:7b4.7 GB32KBelow the 64K agents need
Up to 8 GBmimo-v2.6:9b-q4_K_M6.6 GB256KXiaomi; text and image input
Up to 16 GBqwen2.5-coder:14b9.0 GB32KBelow the 64K agents need
Up to 16 GBgpt-oss:20b14 GB128KOpenAI open-weight model
Up to 32 GBqwen3.6:27b-q4_K_M17 GB256KText and image input; a coding variant is 18 GB
Up to 32 GBqwen3-coder:30b19 GB256KFull tag 30b-a3b-q4_K_M
Up to 32 GBnorth-mini-code-1.019 GB488KCohere; 30B total, 3B active
Up to 32 GBqwen2.5-coder:32b20 GB32KBelow the 64K agents need
Up to 64 GBqwen3-coder-next52 GB256KQwen's agentic coding model
Over 64 GBgpt-oss:120b65 GB128K
Over 64 GBnemotron-3.5-super:120b-a12b-q4_K_M90 GB1MNVIDIA; 12B active
Over 64 GBqwen3-coder:480b290 GB256KWorkstation 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

  1. Ollama. Context length. Retrieved November 4, 2026 from docs.ollama.com/context-length
  2. Ollama. Model library search: tools capability, "coder". Retrieved November 4, 2026 from ollama.com/search?c=tools&q=coder
  3. 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
  4. Ollama. Claude Code integration. Retrieved November 4, 2026 from docs.ollama.com/integrations/claude-code
All resources