Ollama
A local runtime you install and run on your own hardware. This page lists the addresses it answers, the facts its documentation states, and the setup of each harness.
Addresses and facts
- OpenAI Chat Completions:
http://localhost:11434/v1provider documentation, read - OpenAI Responses:
http://localhost:11434/v1provider documentation, read - Anthropic Messages:
http://localhost:11434provider documentation, read
Start it
ollama run hf.co/{repository}:{quantization}Harness setup
Replace <model> with the model you want.
OpenCode
Put this in opencode.json in your project folder:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ollama",
"options": {
"baseURL": "http://localhost:11434/v1"
},
"models": {
"<model>": {
"name": "<model>"
}
}
}
}
}- OpenCode reads any OpenAI-compatible address through the @ai-sdk/openai-compatible package, and an address that speaks the Responses API through @ai-sdk/openai.
From OpenCode documentation, read .
Pi
Put this in ~/.pi/agent/models.json:
{
"providers": {
"ollama": {
"baseUrl": "http://localhost:11434/v1",
"api": "openai-completions",
"apiKey": "ollama",
"models": [
{
"id": "<model>"
}
]
}
}
}- The apiKey field can name an environment variable as $NAME.
From Pi documentation, read .
Codex
Put this in a terminal:
codex --oss --local-provider ollama -m <model>- Codex speaks the Responses API only: responses is the one supported wire API of a custom provider. Ollama and LM Studio are built in and start with --oss.
From Codex documentation, read .
Claude Code
Put this in ~/.claude/settings.json, or variables in your shell:
export ANTHROPIC_BASE_URL="http://localhost:11434"
export ANTHROPIC_AUTH_TOKEN="ollama"
export ANTHROPIC_MODEL="<model>"
claude- Claude Code sends Anthropic Messages requests to ANTHROPIC_BASE_URL. Anthropic says it does not support routing Claude Code to models other than Claude through any gateway, so some features may not work with another model.
From Claude Code documentation, read .
Sources of this page
Paid links
No link in this directory is a paid link or an ad, and no listing is paid for. The order and the contents of every list come from the sources named on this page.