Docs · Provider

Ollama in Claude Code, Codex, Gemini CLI and OpenCode

Ollama serves the models you pull on two APIs, OpenAI Chat Completions and Anthropic Messages, at http://localhost:11434. Ollama Cloud serves its models the same way at ollama.com, with an API key. Add either to packinggoods once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use them through packinggoods’s local gateway at 127.0.0.1:3425, each agent with a model of its own.

Add Ollama

  1. Pull a modelPull a model in Ollama, such as qwen3, and leave the server running.
  2. Add the providerIn packinggoods’s Providers tab, press + Add provider and pick Ollama under On this machine. No key is needed. packinggoods asks the server which models it has, and they show as ollama/….
  3. Pick it for an agentIn the Agents tab, click the model on the agent’s row and choose an Ollama model.
Terminal
ollama pull qwen3
packinggoods provider add ollama
packinggoods provider test ollama

Model ids in packinggoods are provider/model, so a model you pulled as qwen3 reads ollama/qwen3. A tag stays in the id, as in ollama/qwen3:8b. In the terminal UI, packinggoods asks for the server’s address when you add it. LM Studio, oMLX, vLLM and llama.cpp’s server are in Local models.

Another port or another computer

If Ollama listens on another port, or runs on another computer such as a GPU box or a NAS, change Server address in the provider’s editor. Only the scheme, host and port change; each API keeps its path. The scheme can be left out, and http is taken; a path pasted with the address, such as /v1, is dropped.

Terminal
packinggoods provider set ollama address=192.168.1.20:11434
packinggoods provider set ollama address=     # back to the default

Ollama Cloud

  1. Get a keyMake one at ollama.com/settings/keys.
  2. Add the providerIn the Providers tab, press + Add provider, pick Ollama Cloud, paste the key and save. packinggoods asks Ollama Cloud which models the key can use.
  3. Pick it for an agentChoose an Ollama Cloud model, such as deepseek-v4-pro, on the agent’s row.
Terminal
packinggoods provider add ollama-cloud <key>
packinggoods claude ollama-cloud/deepseek-v4-pro

Names, reasoning levels and prices come from models.dev’s ollama-cloud catalog. The key is kept in packinggoods’s settings.

Endpoints

ProviderChat CompletionsAnthropic Messages
Ollamahttp://localhost:11434/v1http://localhost:11434
Ollama Cloudhttps://ollama.com/v1https://ollama.com

An agent whose API Ollama serves is passed on to that API. packinggoods uses no Responses endpoint for either, so when it has to translate, it uses Chat Completions: it keeps Responses first only for OpenAI’s own models, and Messages first only for Claude models.

Model list

packinggoods asks the server for its list at the Chat Completions base: http://localhost:11434/v1/models, or https://ollama.com/v1/models for Ollama Cloud. A model shows in packinggoods once Ollama has it. After you pull another, press Fetch models in the provider’s editor, or run packinggoods provider refresh ollama. Pick the models agents see in the provider’s model list, or from the terminal:

Terminal
packinggoods provider refresh ollama
packinggoods provider models ollama +qwen3

Ollama 0.35.0 and later (0.40.5 for its cloud models) also serves decision models, such as Nimble, Clef and Tev. packinggoods reads Ollama’s /api/tags as well, and a model marked there as a decision model becomes one of the provider’s decision models for intent routing, never an agent’s model. An older Ollama lists none.

In each agent

Terminal
packinggoods claude ollama/qwen3
packinggoods codex ollama/qwen3
packinggoods gemini model ollama/qwen3
packinggoods opencode ollama/qwen3

Inside the agent, Claude Code’s and Codex’s /model list packinggoods’s models too, so you can move between a local model and a cloud one there. To go back to the agent’s own models, run packinggoods claude default or packinggoods codex default.

Context window and num_ctx

Agents plan around how long a request the model takes. Claude Code takes a model it doesn’t know for 200K, and Codex compacts a conversation at 90% of the window it is told. packinggoods doesn’t read an Ollama chat model’s window, so tell it the real one: Context window under Advanced in the provider’s editor, for every model or one of them. packinggoods passes it on to the agents.

Terminal
packinggoods provider set ollama context=32k
packinggoods provider set ollama context.qwen3=128k

Reasoning

Terminal
packinggoods model efforts ollama/qwen3 low,medium,high
packinggoods model efforts ollama/qwen3 off

Tool calls

Claude Code’s and OpenCode’s tool calls reach Ollama as the agent wrote them. For Codex and Gemini CLI, packinggoods translates the tools, the model’s calls and their results to Chat Completions and back, in streamed replies too.

Privacy masking

packinggoods’s privacy masking replaces keys, tokens and other secrets with placeholders before a request leaves the gateway, a request to a local Ollama too. When the model runs on your own computer or network, you can turn on Send requests unmasked in its editor, or run packinggoods provider set ollama unmasked=yes.

Usage and cost

Terminal
packinggoods model price ollama/qwen3 0,0,0,0
packinggoods provider set ollama free=yes
packinggoods provider quota-rest ollama-cloud 7d
packinggoods provider fallback ollama-cloud ollama/qwen3

packinggoods as an Ollama server

Some apps take a custom model only as an Ollama server: VS Code’s Copilot Ollama provider, Visual Studio’s Copilot BYOK, Zed’s Ollama provider and the ollama CLI. Point them at packinggoods’s gateway, http://127.0.0.1:3425, and they see packinggoods’s models, from every provider, not only Ollama.

Troubleshooting

FAQ

How do I use Ollama in Claude Code?

Add Ollama in packinggoods (Providers, Add provider, Ollama under On this machine), then pick one of its models on Claude Code’s row, or run packinggoods claude ollama/qwen3. Claude Code’s requests go through packinggoods’s gateway to Ollama’s Anthropic Messages API at http://localhost:11434 as they are.

Can Codex use Ollama?

Yes. Codex speaks only the Responses API, so packinggoods turns its requests into Chat Completions for Ollama, and the replies back, tool calls included. Run packinggoods codex ollama/qwen3.

Can Gemini CLI and OpenCode use Ollama?

Yes. Gemini CLI speaks Google’s API, so packinggoods translates its requests to Ollama’s Chat Completions and the replies back. OpenCode speaks Chat Completions, so its requests go to Ollama as they are. Run packinggoods gemini model ollama/qwen3 or packinggoods opencode ollama/qwen3.

How do I run qwen3-coder from Ollama in Claude Code?

Pull it in Ollama, press Fetch models in the provider’s editor in packinggoods (or run packinggoods provider refresh ollama), and pick it on Claude Code’s row. Its id in packinggoods is ollama/ and the name Ollama lists it under, tag included. Set its Context window too: Claude Code takes a model it doesn’t know for 200K.

Can packinggoods use Ollama on another computer?

Yes. Set the provider’s Server address to that computer, such as packinggoods provider set ollama address=192.168.1.20:11434. A server on your own network is reached directly, not through a proxy set in Settings or the system.

Does packinggoods work with Ollama Cloud?

Yes. Add Ollama Cloud with a key from ollama.com/settings/keys. packinggoods lists the models the key can use, prices them from models.dev, and shows the account’s included allowance and the credits you bought.

Do I need an API key for a local Ollama?

No. The Ollama preset takes none. Ollama Cloud needs one.

Other local servers, such as LM Studio, oMLX, vLLM and llama.cpp’s server, are in Local models. To let a local model classify each request for routing, see Intent routing.

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Volcengine Ark · Tencent Cloud · Baidu Qianfan · SiliconFlow · ModelScope · Huawei Cloud MaaS · Xiaomi MiMo · StepFun · LongCat · Qwen · MiniMax · Anthropic · OpenAI · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot

Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck.