Local models as sources: Ollama, LM Studio
Run local models with Claude Code and Codex: add Ollama, LM Studio or any compatible address as a source. Use it when you like.

Contents
To run local models with coding agents, Shuriken takes a model server as a source. Add Ollama (http://localhost:11434), LM Studio (http://localhost:1234/v1) or any Anthropic- or OpenAI-compatible address, and Claude Code or Codex runs on it. There's no bill per token on your own hardware, only electricity and a warm laptop. You choose when to use it, and it never pushes your subscriptions aside.
Why we added it#
Two requests kept coming up:
- keep small jobs moving when every plan is out for the afternoon;
- run code that shouldn't go to any provider on the GPU idle under the desk.
Ollama and LM Studio both speak Anthropic's API as well as OpenAI's now, so Claude Code can talk to them directly (Ollama docs, LM Studio docs, read 22 October 2026). By hand, that means ANTHROPIC_BASE_URL, a placeholder key and model names in environment variables, per agent and per project. We wanted it to take two minutes instead of an afternoon. The by-hand steps are in Claude Code with Ollama and Codex CLI with local models.
Add one in three steps#
- Start the model server. Load a model in Ollama, or load one in LM Studio and start its local server.
- In Shuriken, open Sources › Add source, pick Claude Code or Codex, then Custom endpoint. Under "On this computer", pick Ollama or LM Studio and the address fills itself in. Each chip says what Shuriken found there, like "Ollama · 3 models" or "LM Studio · Not running"; Look again checks once more.
- Press Test. "Reached · 3 models" (or however many it serves) means you're set. Add only saves an endpoint that answered.
The key field reads "Not needed for a model on this computer or your network". Claude Code and Codex still expect a key, so Shuriken hands them the word local as a stand-in and the server ignores it. If you turned on authentication on the server, type its token; a key you type always wins.
A model on another machine, such as a desktop with a big GPU across the room, needs its address typed, like http://gpu-box:11434, and its model server must accept connections from your network. Plain http:// works on your own computer and local network: localhost, a bare machine name, .local names, 192.168.x and the other private ranges. Public addresses need https://.
The same form takes any Anthropic- or OpenAI-compatible address, not only these two, so a model server you run yourself fits as well. For Claude Code, once the test lists the server's models, Model names sets which one answers when Claude asks for Opus, Sonnet or Haiku. Shuriken passes them to each chat as ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL.
How it behaves once it's added#
A local source sits in Sources next to your subscriptions and API keys, marked Local.
- Use on it sends new chats for that agent there.
- Otherwise your subscriptions come first. A local model is an endpoint, not a subscription, so source switching never moves a chat onto it while one of your subscriptions has room.
- Once every Claude sign-in and key (or every ChatGPT one, for Codex) is out, a chat can carry on there between turns, if the model can read the chat's history. The chat keeps its branch, its history and its queue.
- Live cost writes its turns as "42k / local" instead of pricing them like a cloud model. It doesn't call them free, because a local address can also forward to a paid service.
- All your linked devices share the source; the model stays where it runs. A
localhostmodel on your desktop shows on your laptop as "Runs on" and the desktop's name, and the laptop reaches it through the desktop while the desktop is on. - Activity, the queue, your MCP servers and Finish work as before.
Which agents#
Today, the Custom endpoint option is for the two agents that let us swap the address cleanly:
| Agent | Talks to | Works with |
|---|---|---|
| Claude Code | Anthropic-compatible addresses | Ollama, LM Studio, your own server |
| Codex | OpenAI-compatible addresses | Ollama, LM Studio, your own server |
OpenCode has its own way: its config can point it at Ollama or LM Studio (OpenCode docs, read 22 October 2026), and Shuriken runs OpenCode like any other agent. Running the two together is covered in our OpenCode comparison.
Good to know: the model matters#
Read this before you download 40 GB of weights.
- Context: coding agents send a lot of it. LM Studio's own Claude Code guide suggests a model and settings with more than about 25,000 tokens of context.
- Tool calls: agents depend on the model calling them reliably. Some open models do this well; some don't.
- Speed: your hardware sets it. A model that barely fits in memory is slow, and a slow model makes a slow agent. On battery, it won't stay on battery long.
Long refactors and gnarly debugging are where frontier models still earn their price; a small local model can lose the thread halfway through one.
After the test passes, Send test message sends one short message to the model you choose and says "answered" or "did not answer". Then try a small task before a long one.
Local models do best at small, repetitive work (renames, docstrings, test scaffolds), at code that shouldn't leave the building, and at trying open models on your own code.
Local models are on every plan. Download Shuriken and give your GPU something to do.
Sources
- Ollama docs: Anthropic compatibility (accessed 22 October 2026)
- LM Studio docs: Claude Code (accessed 22 October 2026)
- OpenCode docs: Providers (accessed 22 October 2026)
Frequently asked questions
Which agents can use a local model in Shuriken?
Claude Code, through an Anthropic-compatible address, and Codex, through an OpenAI-compatible one. Some other agents, like OpenCode, can be pointed at a local server in their own settings.
Does it work offline?
The model's requests stay on your computer or network. Other parts may still go online: MCP servers, package installs, and your other devices following the chat through Shuriken.
How do I switch between a local model and my Claude account?
Choose Use on the local source, and new chats for that agent run on it. It never goes ahead of a subscription on its own; it can catch a chat once your accounts for that agent are out. Your chats, branches and queue stay as they are.
Do I need an API key for Ollama or LM Studio?
No, not for a model on this computer or your local network. If you turned on authentication on the server, type its token.
Is it on the Free plan?
Yes. Local models as sources are part of every plan, Free included.
Try Shuriken on your own computerYou're signed in
Add your Claude, Codex and Gemini accounts once. Shuriken switches between them so your agents keep working.Settings › Sources shows each of your accounts, what it has left and when it resets.
