What changed — and why it matters now
For a couple of years, "run your agent locally" was a hobbyist's promise that fell apart the moment you tried to do real work. The model would load, the chat would answer, and then your actual tools — Claude Code, your editor harness, your in-house agent runner — would refuse to talk to it because they spoke a different API dialect. That gap has quietly closed. This is not a single launch from this week; it is the mid-2026 maturation of a stack that became usable over the first half of the year. Two changes did most of the work.
- Ollama learned Anthropic's language. As announced on 16 January 2026, Ollama v0.14.0 and later added Anthropic Messages API compatibility. The local server listens on
localhost:11434and accepts requests at/v1/messagesin Anthropic's exact format, translating internally to whatever open-weight model you have loaded (per the Ollama blog and docs.ollama.com). - LM Studio learned to use tools. Per LM Studio's release notes, version 0.4.0 added built-in MCP server support with permission-based access control, so a local model can call external tools over the Model Context Protocol — the same protocol the cloud agents use.
- Quantisation caught up. As a general community finding, GGUF 4-bit quantised models now retain roughly 92% of full-precision quality for coding, so a model that once demanded around 64GB of RAM fits in about 16GB.
- Tool calls run in-process. Because the model and the agent share a machine, there is no network round-trip between them — latency on each tool step is whatever your disk and CPU can manage, not whatever the public internet hands you that afternoon.
The single most important number for a local coding agent is not parameter count — it is context window. Claude Code recommends at least a 64k-token context window for the local model to behave well (per Ollama docs). A small, fast model with a generous window will out-agent a larger model that runs out of room halfway through reading your repository.
What Ollama's Anthropic API unlocks
The clever part of Ollama v0.14's change is that it does not ask your tools to learn anything new. Claude Code already knows how to speak Anthropic's Messages API — that is its native tongue. By exposing the very same /v1/messages endpoint on localhost:11434 and translating each request to the loaded open-weight model, Ollama lets Claude Code believe it is still talking to Anthropic's servers. From the tool's point of view nothing has changed; from your point of view, the inference is now happening entirely on your own hardware.
This is a different and more useful trick than the OpenAI-compatible endpoints local runtimes have offered for years. The agent harness — the part that plans, calls tools, reads files and decides what to do next — is the hard, opinionated bit. Reusing Claude Code's harness against a local model means you inherit its file editing, its permission prompts and its tool loop for free, while swapping out only the brain underneath. For a builder, that is the whole game: keep the workflow you already trust, change where the tokens are computed.
It matters geographically too. An indie hacker in Chennai or Pune on a metered or flaky connection no longer pays per token or waits on a trans-oceanic hop for every keystroke of an agent loop. A team in Manchester or Edinburgh with data-residency obligations can keep client code on a workstation that never sends a byte to a third-party model provider. Same harness, two very different problems solved.
Setting Claude Code against a local model
The configuration is deliberately small. You point Claude Code's two environment variables at the local Ollama server and give it a throwaway token — Ollama does not check it, but Claude Code expects one to be present.
# 1. Run a recommended open-weight coding model (Ollama v0.14.0+)
ollama run qwen3-coder
# 2. In the shell where you launch Claude Code, redirect it locally
export ANTHROPIC_BASE_URL=http://localhost:11434
export ANTHROPIC_AUTH_TOKEN=ollama
# 3. Start Claude Code as normal — it now runs against the local model
claude
That is the entire setup. Claude Code's planning, file edits and permission prompts all still work; the only difference is that the tokens are computed by qwen3-coder on your machine rather than by a hosted model. Swap the model name for glm-4.7 or minimax-m2.1 — both also recommended by Ollama for local coding — and the workflow is unchanged. Per Ollama's model hub, qwen3-coder alone has been pulled roughly 3.4 million times, which is a reasonable proxy for "this is the default a lot of people land on".
A local model is not a drop-in replacement for a frontier hosted model on hard reasoning. Expect more tool-loop retries, weaker multi-file planning and the occasional confidently wrong edit. Keep Claude Code's permission prompts on, review diffs before accepting them, and treat the local setup as excellent for routine, private or offline work — not as a like-for-like swap for your hardest tasks.
LM Studio + MCP: tools without the cloud
If Ollama's change is about which brain drives your existing agent, LM Studio's is about giving a local model hands. Per LM Studio's release notes, version 0.4.0 added built-in MCP server support with permission-based access control. In plain terms: a model running inside LM Studio can now call external tools — a file system server, a database server, a web-fetch server — over the same Model Context Protocol that the cloud agents speak. The permission layer means each tool the model wants to use is gated, so a local agent cannot quietly read your whole disk because a prompt told it to.
The structural advantage here is latency and privacy in one move. Because the tool calls run in-process, there is no network round-trip between the model and the agent — the request to list a directory or run a query does not leave the machine. For anyone learning to build agents, that is also a gentler on-ramp: you can wire up a real MCP tool, watch the permission prompt fire, and iterate without burning API credits. If you have not built an MCP server before, our walkthrough on building your first MCP server with FastMCP in 12 steps pairs naturally with a local LM Studio host, and the patterns in designing tools for AI agents — schemas, errors and retries apply identically whether the model is local or hosted.
When local wins — and when it doesn't
The honest answer is that local agentic development is now genuinely practical for a real slice of work, and still the wrong choice for another slice. The decision is not ideological; it is a function of privacy, cost, latency and the difficulty of the task. Here is how the two approaches actually compare for day-to-day agent work.
| Dimension | Local agent (Ollama / LM Studio) | Cloud agent (hosted frontier model) |
|---|---|---|
| Per-token cost | Zero after hardware — runs on your machine | Metered per input/output token |
| Privacy / data residency | Code never leaves the device | Sent to a third-party provider |
| Tool-call latency | In-process — no network round-trip | Network hop per tool step |
| Context window | Capped by RAM; aim for 64k+ tokens | Very large windows available |
| Hard multi-file reasoning | More retries; weaker planning | Strongest available |
| Works offline | Yes | No |
Read down that table and the use cases sort themselves. An indie hacker in Chennai prototyping on a 16GB laptop, on a patchy connection, doing mostly routine edits and refactors, is squarely in local territory — zero marginal cost and no waiting on the network is exactly what an iteration-heavy day needs. A UK consultancy in London bound by a client contract that forbids sending source to external model providers is in local territory for a different reason entirely: data residency, not cost. Both keep the same Claude Code workflow; they just keep the tokens at home.
Conversely, when the task is a genuinely hard, repository-spanning change with subtle cross-file dependencies, the frontier hosted model still earns its keep, and the pragmatic answer for most teams is a split: route the routine, the private and the offline work to a local model, and reserve the cloud for the genuinely hard problems. If you want to go deeper on the open-weight models themselves, our roundup of Chinese open-weight coding models covers the families now powering most local setups, and our piece on the Claude Agent SDK — budgets, tools and the harness is the right read once you decide to put a local-plus-cloud split into production.
Every article here is written by a Verified Builder. Want your name on the next one?
AI Tech Connect lists AI engineers, founders and researchers across India and the UK — and the people hiring browse it to find them. Adding your profile is free.
Become a Verified Builder →What builders should actually do this week
If you have never run a coding agent locally, the cheapest experiment in software right now is to install Ollama v0.14.0 or later, pull qwen3-coder, export the two environment variables above, and watch Claude Code drive a model on your own machine. It will take ten minutes, cost nothing and tell you more about where local fits in your workflow than any blog post can. Start with a small, contained task — a rename, a test stub, a one-file refactor — so you can feel the difference in latency and quality directly.
From there, three habits make the difference between a toy and a tool. First, size for context, not parameters: pick the model whose window comfortably clears 64k tokens for the repositories you actually touch. Second, keep permission prompts on in both Claude Code and LM Studio — a local agent with unfettered tool access is a foot-gun, not a feature. Third, decide your split deliberately: which work stays local for privacy or cost, and which goes to the cloud for raw capability. Get those three right and local agentic development stops being a demo and starts being part of how you ship. For the primary sources, see the Ollama announcement on Claude compatibility and the reference at docs.ollama.com.