hydra
hydra is a protocol bridge. It runs on each model backend host and translates between the Anthropic Messages API and Ollama’s native API, so agents written against the Anthropic SDK can use local models without code changes.
hydra is stateless and transparent. It holds no routing logic and makes no policy decisions. It converts requests and maps responses — nothing more.
What hydra translates
Section titled “What hydra translates”| Anthropic | Ollama |
|---|---|
POST /v1/messages |
POST /api/chat |
model: "claude-sonnet-*" |
resolved model name (e.g. qwen2.5:72b) |
messages[].content blocks |
Ollama message format |
| Streaming SSE | Ollama streaming chunks |
| Tool use blocks | Ollama tool call format |
stop_reason: "end_turn" |
mapped from done_reason |
Model name resolution uses a config table on the hydra host. You map Anthropic model identifiers to the local Ollama model that should serve them.
Install
Section titled “Install”hydra is installed when you select the model backend role:
curl --proto '=https' --tlsv1.2 -fsSL https://pantheon.lhocke.dev/installs/install.sh | sh# Select: model backendThe installer configures hydra to point at the local Ollama instance (:11434) and starts hydra on :8080.
Configuration
Section titled “Configuration”[hydra]listen = "0.0.0.0:8080"ollama = "http://127.0.0.1:11434"log_level = "info"
[model_map]"claude-opus-*" = "qwen2.5:72b""claude-sonnet-*" = "qwen2.5:32b""claude-haiku-*" = "llama3.1:8b"Requests for unmapped models return a 400 with a clear error message listing available mappings.
pantheon hydra status # show Ollama connectivity + loaded modelspantheon hydra log # tail translation log (live)pantheon hydra models # list model map and Ollama availability for eachpantheon hydra restartKnown limitations
Section titled “Known limitations”- Vision — image blocks in
contentarrays are passed through if the underlying Ollama model supports vision; otherwise rejected with a400. - Extended thinking — Anthropic’s extended thinking (
thinkingcontent blocks) has no Ollama equivalent and is stripped with a warning. - Token counts —
usagefields in responses use Ollama’s reported token counts, which may differ from Anthropic’s tokenizer.