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
- Pull a modelPull a model in Ollama, such as
qwen3, and leave the server running. - 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/…. - Pick it for an agentIn the Agents tab, click the model on the agent’s row and choose an Ollama model.
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.
packinggoods provider set ollama address=192.168.1.20:11434 packinggoods provider set ollama address= # back to the default
- Proxies. A server on your own network is reached directly, whatever proxy Settings or the system name. A proxy you set on the provider itself is still used.
- HTTPS. An Ollama behind HTTPS with a self-signed certificate can be reached with Don't check its certificate in the editor. It applies to that provider’s own hosts only.
Ollama Cloud
- Get a keyMake one at ollama.com/settings/keys.
- 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.
- Pick it for an agentChoose an Ollama Cloud model, such as
deepseek-v4-pro, on the agent’s row.
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
| Provider | Chat Completions | Anthropic Messages |
|---|---|---|
| Ollama | http://localhost:11434/v1 | http://localhost:11434 |
| Ollama Cloud | https://ollama.com/v1 | https://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:
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
packinggoods claude ollama/qwen3 packinggoods codex ollama/qwen3 packinggoods gemini model ollama/qwen3 packinggoods opencode ollama/qwen3
- Claude Code speaks Anthropic Messages, and so does Ollama at
http://localhost:11434, so its requests go there as they are. Models in Claude Code. - Codex speaks OpenAI Responses, which packinggoods doesn’t send to Ollama. packinggoods turns each request into Chat Completions and the reply back, streaming and tool calls included. Models in Codex.
- Gemini CLI speaks Google’s Gemini API. packinggoods translates each request to Chat Completions and the reply back. Models in Gemini CLI.
- OpenCode speaks Chat Completions, so its requests go to Ollama’s
/v1as they are. Models in OpenCode.
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.
packinggoods provider set ollama context=32k packinggoods provider set ollama context.qwen3=128k
num_ctx. Some clients send Ollama’s per-request options, such as{"num_ctx": …}, beside the Chat Completions fields. packinggoods leaves them out of every request it sends on: no Chat Completions API reads them, Ollama’s own/v1included. The window the model runs with is Ollama’s to set; give packinggoods the same number.- Too long. When a conversation outgrows the window, Ollama answers “exceeded max context length”. packinggoods tells the agent so the way it understands,
context_length_exceededor Anthropic’s “prompt is too long”, so the agent compacts and tries again.
Reasoning
- Effort. The effort an agent asks for is fitted to the nearest level the model has, as the catalog lists them. A model whose levels packinggoods doesn’t know is asked as the agent asked.
- Reasoning off. When an agent whose requests packinggoods translates, such as Codex or Gemini CLI, turns reasoning off and the model lists
noneamong its levels, packinggoods asks for none. - Your own levels.
packinggoods model effortsoffers only the levels you name, or sends a model no reasoning field at all.
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.
- Cloud models. Ollama’s cloud models pass a request on to a vendor whatever the address, so it is your call. The editor warns you while it is on for a provider that isn’t local, such as Ollama Cloud.
- Tool arguments. In a request in Ollama’s own format, a tool call’s arguments are masked as tool arguments, as in every other API.
- Anonymous stats. packinggoods’s daily stats name an Ollama model only when models.dev knows it; any other counts as “other”. See Privacy.
Usage and cost
- Usage. The Usage tab counts the tokens of every Ollama call. A model is priced at the price packinggoods finds for its id, which for a local model can be its maker’s list price. To count a local model at nothing, give it your own price.
- Free first.
free=yescounts every model of the provider as free, so a Free first routing spends it before paid ones. Prices and Usage’s costs stay as listed. - Ollama Cloud’s allowance. packinggoods reads the account’s balance from Ollama Cloud. The included allowance shows as a plan, in dollars used, with when it resets; an older plan shows its session and weekly limits instead. Credits you bought show as a balance. Past the allowance Ollama Cloud draws on those credits, so a spent allowance with credits left doesn’t stop the key.
- Peak hours. On Ollama Cloud,
deepseek-v4.1-flashanddeepseek-v4-pro(with their tags) cost double from 12:00 to 18:00 UTC, Monday to Friday. models.dev lists the off-peak price; the Usage tab doubles it in those hours, and a Cheapest first routing counts it. - Out of allowance. When Ollama Cloud says a key is out without saying when it comes back, as its weekly limit does, packinggoods rests the key for 15 minutes.
quota-restsets how long, up to 8 days. With several keys (Add another key) the next one takes over; when every key is out, the gateway answers at once with Retry-After.
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.
- Routes. packinggoods answers
/api/version,/api/tags,/api/show,/api/chatand/api/generate. - The same path. A chat there is served as
/v1/chat/completionsis, so key limits, routing, fallbacks and usage are the same. A gateway key held to some models lists only those. - What it tells.
/api/tagsand/api/showmark tools, vision when the model reads images, and thinking when it reasons./api/showalso gives the model’s window, or 32768 for one packinggoods doesn’t know. TheollamaCLI’sname:latestfinds a model calledname.
Troubleshooting
- A model you pulled isn’t listed. The list comes from the server. Press Fetch models, or run
packinggoods provider refresh ollama, and pick it in the provider’s model list. Use the name Ollama lists, tag included. - Ollama isn’t running.
packinggoods provider test ollamasends a tiny request through each endpoint, or to each model you name; add--as codexor--as claude-codeto send it the way that agent would. Start Ollama, or check Server address.fallbacknames where requests go while it is down. - “exceeded max context length”. The conversation is longer than the model was loaded for. Set the real Context window on the provider, and the agents compact before they reach it.
- Another computer can’t be reached. Check the address and port in Server address; for HTTPS with a self-signed certificate, turn on Don't check its certificate.
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.