Model Routing Guide
Animus selects a (tool, model) pair for each agent phase from the resolved agent runtime config plus any workflow or pack overrides. The current planner logic lives in:
crates/workflow-runner-v2/src/phase_targets.rscrates/protocol/src/model_routing.rscrates/orchestrator-config/src/agent_runtime_config.rs.animus/workflows.yamlor.animus/workflows/*.yaml
How Primary Target Resolution Works
The phase target planner resolves the primary execution target in this order:
- Per-phase override in
phase_routing.per_phase.<PHASE_KEY> - Phase-family override for UI/UX phases via
phase_routing.ui_ux_* - Phase-family override for research phases via
phase_routing.research_* - Global override via
phase_routing.global_* - Built-in fallback:
claude-sonnet-4-6
Tool resolution follows the same precedence. If no tool is explicitly set, Animus derives it from the chosen model id.
Current Built-In Defaults
The built-in fallback compiled from crates/orchestrator-config/config/agent-runtime-config.v2.json currently leaves phase_routing unset, so there is no built-in complexity table in the live code path.
That means:
- The generic built-in primary model fallback is
claude-sonnet-4-6. - Bundled packs and project workflow overlays provide the phase-specific defaults you actually see in task, requirement, and review workflows.
- Task, requirement, and review pack overlays currently pin their runtime phases to
claude-sonnet-4-6unless you override them. - The editable project source of truth is workflow YAML, not a repo-scoped
agent-runtime-config.v2.jsonfile.
Config Cascade
The first matching source wins:
- Workflow or pack phase runtime override authored in
.animus/workflows.yamlor.animus/workflows/*.yaml - Resolved agent runtime config (
animus workflow agent-runtime get) - Built-in fallback in the phase target planner
Set the model directly on an agent or phase in workflow YAML:
agents:
my-agent:
model: claude-opus-4-6
tool: claudeOr inspect the resolved runtime:
animus workflow agent-runtime get
animus workflow agent-runtime validateIf you prefer to replace the runtime as structured JSON, animus workflow agent-runtime set accepts the compiled schema directly and writes it back into project workflow YAML:
{
"agents": {
"default": {
"model": "claude-sonnet-4-6",
"tool": "claude"
}
}
}Set these fields to null to fall back to the planner defaults:
{
"agents": {
"default": {
"model": null,
"tool": null
}
}
}Fallback Models
Fallback targets are assembled in this order:
- The primary
(tool, model)pair - Explicit
fallback_modelsfrom the active phase runtime phase_routing.per_phase.<PHASE_KEY>.fallback_modelsphase_routing.ui_ux_fallback_modelsfor UI/UX phasesphase_routing.research_fallback_modelsfor research phasesphase_routing.global_fallback_models
Every fallback model is normalized through canonical_model_id(), deduplicated, and then mapped to a tool automatically unless you provide explicit fallback_tools.
Example:
agents:
swe:
model: claude-sonnet-4-6
fallback_models:
- gpt-5.4
- gemini-2.5-proComplexity Note
Task complexity is still tracked and passed through workflow execution, but the current phase target planner does not choose different primary models based on low/medium/high complexity. Older docs that showed a compiled complexity routing table no longer reflect the live code.
Tool Assignment
Tool inference comes from tool_for_model_id() in crates/protocol/src/model_routing.rs:
| Model family | CLI tool |
|---|---|
claude-* | claude |
gpt-* | codex |
gemini-* | gemini |
zai-*, glm-*, minimax-*, openrouter/* | oai-runner |
deepseek-*, qwen-*, opencode* | opencode |
You can inspect the tool defaults directly in code:
claude->claude-sonnet-4-6codex->gpt-5.4gemini->gemini-2.5-proopencode->zai-coding-plan/glm-5oai-runner->openrouter/minimax/minimax-m2.7
Write-Capable Tools
The current tool_supports_repository_writes() implementation marks these tools as write-capable:
claudecodexgeminiopencodeoai-runner
Environment Variables
Model/tool validation is provider-specific. Check the effective environment with:
animus model status
animus model availability
animus model roster refresh
animus model roster getValidate a specific model id:
animus model validate --model claude-sonnet-4-6Agent Runtime Commands
animus workflow agent-runtime get
animus workflow agent-runtime validate
animus workflow agent-runtime set --input-json '{"agents":{"default":{"model":null,"tool":null}}}'