Goal. Run a colony's main agent on one model (e.g. Claude Opus on the subscription) and its subagents on another provider, e.g. DeepSeek V4.1 Flash (deepseek-flash) via DeepSeek's Anthropic-compatible API or a locally served model.
Design (docs/protocol.md §6.1, §6.3)
- Model strings are
<provider>/<model-id>; unprefixed models go to Anthropic.
- The Claude Code runner starts a local router on
127.0.0.1 and points ANTHROPIC_BASE_URL at it. Routed requests get the provider's base URL and credential; Anthropic requests pass through unchanged, so the subscription login keeps working for the orchestrator.
CLAUDE_CODE_SUBAGENT_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL come from the agent module's subagent_model and background_model settings.
- Providers live on the mothership (
/api/providers), keys stored 0600 and injected as microsandbox secrets for the provider host only. Loopback base URLs are rewritten to host.microsandbox.internal.
Caveats. Anthropic does not support routing Claude Code to non-Claude models; features that depend on Claude-only API behaviour may degrade for subagents on other providers.
Done when
Goal. Run a colony's main agent on one model (e.g. Claude Opus on the subscription) and its subagents on another provider, e.g. DeepSeek V4.1 Flash (
deepseek-flash) via DeepSeek's Anthropic-compatible API or a locally served model.Design (docs/protocol.md §6.1, §6.3)
<provider>/<model-id>; unprefixed models go to Anthropic.127.0.0.1and pointsANTHROPIC_BASE_URLat it. Routed requests get the provider's base URL and credential; Anthropic requests pass through unchanged, so the subscription login keeps working for the orchestrator.CLAUDE_CODE_SUBAGENT_MODELandANTHROPIC_DEFAULT_HAIKU_MODELcome from the agent module'ssubagent_modelandbackground_modelsettings./api/providers), keys stored 0600 and injected as microsandbox secrets for the provider host only. Loopback base URLs are rewritten tohost.microsandbox.internal.Caveats. Anthropic does not support routing Claude Code to non-Claude models; features that depend on Claude-only API behaviour may degrade for subagents on other providers.
Done when
model=opusandsubagent_model=deepseek/deepseek-flashcompletes a task that uses a subagent, and the subagent requests reach DeepSeek.