Inter-office memo

To
Everyone who wants a coding agent on a model of their own
From
Mo, Chief Executive
Date
October 29, 2026, 11:42 AM CDT
Re
Coding agents on local models

How to run a coding agent on a local model in 2026: 7 ways compared

Keep the agent you use. Ollama’s launch command points Claude Code, Codex or OpenCode at a model on your computer, free; Cline brings local models to VS Code and a desktop app; Copilot CLI and Zed find Ollama’s models themselves; and Enjoy runs one through OpenCode beside Claude Code and Codex. Give the model at least 64k of context, and keep a cloud plan for the hardest work.

Disclosure: Enjoy is our product, and it runs OpenCode. We checked every way below against its maker’s own pages on October 29, 2026, and we say where another way is the better pick, including the free ones that don’t need Enjoy.

The ways to run a coding agent on a local model, compared

A coding agent has two halves: the program on your computer that reads your project, edits files and runs commands, and the model that decides what to do, which usually runs on a lab’s servers and draws on your plan’s limits. A local model moves the second half onto your own computer, through a runner such as Ollama, so there’s no limit to hit and no bill by the token. Most agents can make the switch, and Ollama’s integration guides set up several of them with one command, ollama launch.

Way Best for Price, checked October 29, 2026 Runs on Local models through
Claude Code, through Ollama Keeping Claude Code’s commands and settings Free; Ollama’s token stands in for a Claude login Mac, Windows, Linux Ollama
Codex, with --oss OpenAI’s open-source agent on a model of your own Free Mac, Windows, Linux Ollama, LM Studio
OpenCode An open-source agent built to take any model Free Mac, Windows, Linux Ollama, LM Studio, llama.cpp and more
Cline Local models in VS Code, or a desktop app that picks one for you Free for individuals, in VS Code and the CLI VS Code and other editors, a CLI; a desktop app for Mac, and Windows in beta Ollama, LM Studio
GitHub Copilot CLI Ollama’s models, found for you, beside GitHub’s In every Copilot plan, from Free at $0; Pro $10 a month Mac, Windows, Linux Ollama and OpenAI-compatible servers
Zed An editor whose own agent runs local models Free; Pro $10 a month Mac, Windows, Linux Ollama, LM Studio, llama.cpp
Enjoy A local model beside Claude Code and Codex, in one conversation A monthly subscription, free for 7 days, with your phone and other computers (pricing) Mac, Windows, Linux OpenCode, with Ollama or another runner

Prices are per month as each maker lists them in the US, before tax. The model itself costs nothing in any of them: Ollama’s pricing lists local use at $0 and says “Running models on your own hardware is always unlimited.”

What you need first: a runner, memory and context

  • A runner. Ollama downloads for Mac, Windows and Linux, and every way here can use it. Codex, OpenCode, Cline and Zed also take LM Studio, and OpenCode and Zed take llama.cpp.
  • Memory. Cline’s guide to local models gives a rule of thumb: 16 to 32 GB of RAM runs “Small/quantized models,” 32 to 64 GB “Mid-size coding models,” and 64 GB or more “Larger models and bigger context windows.”
  • Context. An agent’s instructions, your files and the conversation so far all have to fit in the model’s context. Ollama’s context guide says “Tasks which require large context like web search, agents, and coding tools should be set to at least 64000 tokens,” but its default depends on your graphics memory: 4k below 24 GiB, 32k up to 48 GiB, and 256k from 48 GiB. Raise it with the slider in the Ollama app’s settings, or start Ollama with OLLAMA_CONTEXT_LENGTH=64000 ollama serve. “Setting a larger context length will increase the amount of memory required to run a model.”
  • A model built for tools. An agent works through tool calls, and GitHub’s Copilot CLI guide says to “Choose a model and endpoint that support tool calling (also called function calling) and streaming.” One to try is Recursive’s Flint, “a 39.8 billion-parameter mixture-of-experts model from Recursive, built for coding agents,” free under Apache 2.0: a 23 GB download with a 256K context window, tagged for tools. Our Flint memo covers what it needs.

Ollama also has cloud models, with cloud in their names, which let you “use larger models without downloading them.” They run on Ollama’s servers, not your computer. Its pricing bills them by the token, or from $60 of monthly credits on Pro, at $20 a month, and says “Prompt or response data is never logged or trained on.”

Claude Code, through Ollama

Best for: keeping Claude Code itself, with its commands, skills and settings, on a model that costs nothing.

Claude Code works with any server that speaks an API format it supports, and Ollama on your computer is one. Run ollama launch claude and pick a model, or set it up by hand as Ollama’s Claude Code guide does: ANTHROPIC_AUTH_TOKEN=ollama, ANTHROPIC_API_KEY="" and ANTHROPIC_BASE_URL=http://localhost:11434, then claude --model and the model’s name. Claude Code’s docs say that while such a token is set, “requests carry that credential in place of a developer’s claude.ai subscription login, and the subscription’s usage limits don’t apply to them.”

Price: free. Claude Code installs with curl -fsSL https://claude.ai/install.sh | bash on Mac and Linux, or irm https://claude.ai/install.ps1 | iex in PowerShell on Windows, and Ollama’s token stands in for a Claude login.

Watch for: Anthropic “doesn’t support routing Claude Code to non-Claude models through any gateway.” Ollama asks for “a 64k+ context window.” With these settings on, Claude Code’s docs say Remote Control and voice dictation are “unavailable,” and Claude Code still sends “nonessential background traffic outside the gateway path, to Anthropic and to third-party services such as GitHub,” such as version checks and telemetry, until you set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1.

Codex, with –oss

Best for: OpenAI’s open-source agent on a model of your own, switching models as you go.

The Codex CLI is open source under Apache 2.0 on GitHub, and its docs say “Codex can run against a local ‘open source’ provider such as Ollama or LM Studio when you pass --oss.” Ollama’s Codex guide sets it up with ollama launch codex, or codex --oss -m and a model’s name, and you “Type /model inside Codex to switch between your installed, tool-capable Ollama models without restarting.” To make Ollama or LM Studio the default, set oss_provider in ~/.codex/config.toml.

Price: free. The CLI installs with curl -fsSL https://chatgpt.com/codex/install.sh | sh on Mac and Linux, from PowerShell on Windows, or with npm install -g @openai/codex.

Watch for: Ollama says “Use a context window of at least 64k tokens for Codex.” Web searches leave your computer: through Ollama’s profile they’re “executed by Ollama for both local and cloud models,” and need ollama signin. And with no local provider set, “the interactive CLI prompts you to choose; codex exec exits with an error,” which matters for scripts.

OpenCode

Best for: an open-source agent built to take any model, local runners included.

OpenCode is “The open source AI coding agent,” “Available as a terminal interface, desktop app, and IDE extension,” and its homepage lists “75+ LLM providers through Models.dev, including local models” and more than 220,000 GitHub stars. Its provider docs cover Ollama, LM Studio and llama.cpp, and say “Ollama can automatically configure itself for OpenCode”: ollama launch opencode starts it with the model you pick.

Price: “OpenCode is 100% free to use.” It installs with curl -fsSL https://opencode.ai/install | bash on Mac and Linux, or npm install -g opencode-ai on Windows, per Ollama’s OpenCode guide.

Watch for: “OpenCode requires a context length of 64k or higher,” Ollama says, and OpenCode’s docs add: “If tool calls aren’t working, try increasing num_ctx in Ollama.” ollama launch opencode passes its settings inline and “does not overwrite ~/.config/opencode/opencode.json,” so to have Ollama there whenever OpenCode starts, add it to that file as the provider docs show. OpenCode’s free hosted models are another matter: “Your data and information is only stored when you use our free models.”

Cline

Best for: local models in VS Code and other editors, or in a desktop app that picks a model for your computer.

Cline is an open-source agent, under Apache 2.0 on GitHub, that “works across all major editors: VS Code, Cursor, Windsurf, JetBrains,” with a CLI and a desktop app, per its docs. Its local models guide runs it “with local models using Ollama, LM Studio or Atomic Chat”: start the runner, choose the matching provider and a model in Cline’s settings, and turn on Use Compact Prompt. Cline Desktop, “an open-source app for open-weight models,” goes further. “Its Local Models page recommends models for your hardware, downloads them, and sets them up for you,” and its Schedule feature runs tasks “automatically at a specific time or on a recurring schedule.”

Price: “The Cline open source extension is completely free for individual developers,” says its pricing, which puts the VS Code extension and the CLI on the free plan.

Watch for: the same pricing page lists the JetBrains extension under Enterprise. Cline Desktop is “for macOS or Windows,” and “Windows support is currently in beta.” Its local guide advises you to “Keep tasks focused (smaller context = faster responses)” and “Start a new task when context gets too large.”

GitHub Copilot CLI

Best for: the models Ollama already has, found for you, beside GitHub’s own.

Copilot CLI runs on Linux, macOS and Windows, from PowerShell or WSL, and its guide to your own models says “Copilot checks for Ollama at http://127.0.0.1:11434 by default.” Models you’ve downloaded appear in its model picker under “Local and self-hosted,” marked “Discovered,” for you to add. Other servers with an OpenAI-compatible API, such as vLLM, go in a providers.json file. On a Windows PC with an NVIDIA graphics card, it can also install MAI Code 1.1 Flash, a coding model that runs locally.

Price: “All plans include Copilot CLI and the Copilot app,” says GitHub’s plans page, from Copilot Free, which costs nothing; Pro is $10 a month. And “By using a model that’s running locally, you can use Copilot offline and avoid consuming GitHub AI Credits.”

Watch for: the CLI “can default to a limit of 128,000 prompt tokens, which can exceed the model’s actual capacity,” and “Setting a higher limit does not increase the model’s context window.” MAI Code 1.1 Flash needs at least 96 GB of memory and 60 GB of free storage, and “AMD is not supported.” Credentials in providers.json “are stored as plain text.”

Zed

Best for: an editor whose own agent runs local models, free.

Zed is a code editor for Mac, Windows and Linux, per its downloads, and its pricing says “Zed is open source.” Its local model guide covers llama.cpp, LM Studio and Ollama, and “Zed automatically discovers models that Ollama has pulled.”

Price: free. Zed’s pricing has Personal at $0, with “Unlimited use with your API keys or external agents like Claude Agent, Codex CLI, and more,” and names Ollama and LM Studio among the providers you can use. Pro, at $10 a month, adds Zed’s hosted models and “Unlimited edit predictions.”

Watch for: “By default, Zed uses 4096 tokens” of context with Ollama, far below the 64k the agents above ask for, so raise context_window in its settings. And the guide covers Zed’s own agent: outside agents “may have their own local-model setup; configure those in the agent or CLI.”

Enjoy

Best for: a local model beside Claude Code, Codex and other labs’ agents, in the same conversation and on a schedule.

Enjoy is a desktop app for Mac, Windows and Linux that runs Claude Code, Codex, Grok Build, Antigravity and Muse Code on the plans you already have, and local models through OpenCode, which, in our guide’s words, “uses the models from the providers set up in it, which can include free models, models on your own computer, and providers you pay with an API key.” Enjoy installs OpenCode for you. Add Ollama to it as OpenCode’s provider docs show, and its models appear in Enjoy’s Model column. What it adds:

  • Another agent when a plan runs out. When Claude Code or Codex runs out of usage, select Stop waiting and carry on with OpenCode and a local model, or switch agents at any point: “The new agent gets the conversation so far, including replies from other agents, before it works on your message.”
  • A night shift, for free. Give a workflow a schedule and OpenCode with a local model as its agent, and routine upkeep runs overnight with no limit and no bill.
  • Every project at once. Each conversation runs its own agent, and JOY keeps an eye on all your projects: ask it what needs you, or start work in any of them.

Price: Enjoy is one monthly subscription, and the first seven days are free, with a card to start. It includes your phone and any browser and your other computers, and each teammate you invite needs a subscription of their own. See pricing.

Watch for: setting up the local model happens in OpenCode, not in Enjoy, and our guide sends you to a terminal to add providers. Enjoy shows Usage unavailable for OpenCode, and “the only effort choice is Model default.” In Enjoy, local models run through OpenCode. Scheduled workflows run only while your computer is awake with Enjoy open, and “Missed times are skipped, not made up.” Enjoy isn’t open source, and it’s a monthly subscription once the free week ends.

When to stay with a cloud model

For the hardest work, keep a lab’s frontier model. Recursive says of its own Flint, “While Flint is very capable, it may need more guidance than the larger closed-source coding models you’re used to,” and advises: “For complex tasks, break the work into smaller subtasks and provide explicit instructions.”

Local models earn their place on routine work: tests, renames and upkeep you’d rather not spend a plan’s limits on, and code you can’t send to anyone’s servers. Keep the agent’s permissions tight either way. A model on your computer can still run commands and fetch pages through the agent, and our memo on Qwen3.8 covers Qwen models that reached for Alibaba Cloud’s servers in agent tests. When a cloud plan runs out, our guides for Claude Code and Codex compare the other ways to keep going.

How we compared

We read Ollama’s integration guides, context guide, downloads and pricing, Anthropic’s Claude Code gateway docs, OpenAI’s Codex docs and repository, OpenCode’s site and provider docs, Cline’s docs, pricing and repository, GitHub’s Copilot CLI docs and plans, Zed’s downloads, pricing and docs, and Recursive’s Flint announcement on October 29, 2026, and every one is linked below. We quote each maker’s own words for its limits and leave out what it hasn’t documented. We didn’t benchmark models ourselves: which model works best depends on your computer’s memory. These tools change monthly, so we recheck this guide against its sources at least once a month, and the date at the foot of the page says when we last did.

12.Questions.

Can I use Claude Code with a local model?

Yes, through Ollama. Run ollama launch claude, or set ANTHROPIC_BASE_URL to Ollama on your computer and ANTHROPIC_AUTH_TOKEN to ollama, as Ollama’s guide shows. Anthropic says it “doesn’t support routing Claude Code to non-Claude models through any gateway,” and Remote Control is unavailable while those settings are on.

Is it free to run a coding agent on a local model?

Yes, apart from the computer. Ollama lists local use at $0 and says “Running models on your own hardware is always unlimited,” and Claude Code, Codex, OpenCode, Cline, Copilot CLI and Zed can all use it at no charge. Ollama’s cloud models run on its servers and bill by the token, and Enjoy is a monthly subscription after a free week.

How much memory do I need for a local coding model?

More than the model’s download. Cline’s rule of thumb is 16 to 32 GB of RAM for small or quantized models, 32 to 64 GB for mid-size coding models, and 64 GB or more for larger models and bigger context windows. Ollama warns that a longer context “will increase the amount of memory required to run a model.”

Why does my agent fail with a local model?

Often the context is too short. Ollama gives computers with under 24 GiB of graphics memory a 4k context by default, and says coding tools “should be set to at least 64000 tokens.” Raise it in the Ollama app’s settings or with OLLAMA_CONTEXT_LENGTH, and pick a model built for tool calls.

Which local model should I use for coding?

One that handles tool calls and fits your memory. Recursive’s Flint, free under Apache 2.0, is a 23 GB download in Ollama with a 256K context, tagged for tools; our Flint memo covers what it needs. Recursive says it “may need more guidance than the larger closed-source coding models you’re used to.”

Does a local model keep my code private?

The model does; the agent may still reach out. Prompts to a model on your computer stay there, but the agent can still run commands and fetch pages, Codex’s web searches through Ollama “are executed by Ollama,” and Claude Code sends version checks and telemetry to Anthropic unless you turn them off. Ollama’s cloud models run on its servers.

Enjoy Agentic Industries · Checked against its sources on