Skip to content
Yoink

Use Ollama in your coding agents

To use local Ollama models in opencode, pi, Crush, Qwen Code, Continue and five more agents, run yoink add, pick Ollama (local), choose from the models your server reports and tick the agents. yoink writes http://localhost:11434/v1 into each config. Codex, Claude Code and Claude Desktop cannot use this preset.

On this page

At a glance

Ollama (local) preset facts
FactValue
Preset idollama
openai-chat endpointhttp://localhost:11434/v1
API keys pagenone (local server)
Harnesses it reaches10 of 13
Add commandyoink add --external --name <name> --preset ollama
Harnesses the Ollama (local) preset reaches
HarnessWith this preset
Claude Codenot offered: needs anthropic-messages
piuses openai-chat
ompuses openai-chat
opencodeuses openai-chat
codexnot offered: needs openai-responses
Qwen Codeuses openai-chat
Kilo Codeuses openai-chat
Droiduses openai-chat
Crushuses openai-chat
Gooseuses openai-chat
Zeduses openai-chat
Continueuses openai-chat
Claude Desktopnot offered: needs anthropic-messages

Generated from the yoink CLI source and docs/providers.md (presets.ts).

One endpoint, on localhost

The ollama preset is the only one with a single endpoint and the only one on plain http: OpenAI Chat Completions at http://localhost:11434/v1. That one protocol decides the reach:

  • Reached (10): pi, omp, opencode, Qwen Code, Kilo Code, Droid, Crush, Goose, Zed and Continue all accept Chat Completions.
  • codex needs OpenAI Responses.
  • Claude Code and Claude Desktop need Anthropic Messages.

So the honest answer to "Claude Code with Ollama" is that this preset cannot do it. yoink connect ollama --to claude-code stops with "ollama" has no Anthropic-compatible endpoint, which Claude Code requires. A server that answers /v1/messages can still be added as a custom provider; the probe decides.

The key prompt

The preset has no key page, but yoink still asks for an API key: the interactive prompt rejects an empty value, and the scripted form fails with "No token received on stdin" without one. Ollama's own OpenAI compatibility docs say the client needs an API key value and the local server ignores it, so any non-empty string satisfies both.

Add it

Start Ollama first. In the interactive flow yoink lists models from http://localhost:11434/v1/models, and when nothing is listening it stops with Could not reach http://localhost:11434/v1/models. Check the base URL and your connection. The scripted form never contacts the server, so it works even while Ollama is stopped:

yoink add
 
echo "ollama" | yoink add --external --name ollama --preset ollama \
  --models <model> --connect opencode,pi,crush,continue --default <model> --token-stdin

The interactive flow suggests the profile id ollama-local, from the label "Ollama (local)". Zed derives its key variable from that id (OLLAMA_LOCAL_API_KEY, or OLLAMA_API_KEY for the id ollama); since Ollama ignores the key, any value there works too.

Local model limits

yoink looks every selected model up on models.dev. When a local model name has no entry there, yoink falls back to its defaults: a 128,000 token context window, 32,000 output tokens, text input, no reasoning. Those numbers reach every config that stores limits. Continue, for example, gets:

models:
  - name: <model> (ollama)
    provider: openai
    model: <model>
    apiBase: http://localhost:11434/v1/
    apiKey: ollama
    roles:
      - chat
      - edit
      - apply
    capabilities:
      - tool_use
    defaultCompletionOptions:
      contextLength: 128000
      maxTokens: 32000

These are yoink's defaults, not values read from Ollama, so they can differ from the context your model actually runs with. Droid is written differently from the other presets: with no Anthropic or Responses endpoint available, its entries use provider: "generic-chat-completion-api".

Ollama on another machine

The preset always points at localhost. For a server elsewhere on your network, add a custom provider with the address and skip the probe by naming the protocol:

echo "ollama" | yoink add --external --name gpu-box --provider "Ollama (gpu-box)" \
  --base-url http://192.168.1.20:11434/v1 --protocol openai-chat \
  --models <model> --connect crush --token-stdin

FAQ

Do I have to re-run yoink after pulling a new model?

Yes, to expose it in your agents. Run yoink models ollama to reopen the picker against the server's current list, or yoink models ollama --set <model>,<model> to name them directly. Either re-syncs every connected agent.

Does yoink start or manage the Ollama server?

No. yoink only writes agent configs that point at http://localhost:11434/v1. Starting Ollama and pulling models stay with Ollama.

  • Providers

    Add an API key once with yoink, from a preset (OpenAI, Kimi, OpenRouter, DeepSeek, z.ai, Ollama) or any compatible URL it probes, and pick its models.

  • Harnesses

    What yoink writes into pi, omp, opencode, codex, Claude Code, Qwen Code, Kilo, Droid, Crush, Continue, Goose, Zed and Claude Desktop: paths and keys.

  • Use any provider in pi

    Connect any OpenAI- or Anthropic-compatible provider to pi. yoink writes ~/.pi/agent/models.json with model limits from models.dev and sets the default.

  • Use an OpenAI API key in your coding agents

    The openai preset has a Responses endpoint, so it is the one preset that reaches Codex. yoink writes it to 11 agents; Claude Code needs Anthropic Messages.

  • Use a Kimi Code API key in your coding agents

    The kimi-code preset points Claude Code at api.kimi.com/coding and opencode, pi or Crush at api.kimi.com/coding/v1. Distinct from switching Kimi logins.

  • Use the Moonshot AI API in your coding agents

    Connect a Moonshot AI platform key to Claude Code via api.moonshot.ai/anthropic, and to opencode, pi, Qwen Code or Crush via api.moonshot.ai/v1.