ai-agencee logoai-agencee
branching

orchestration

Model Routing & Cost

How ai-agencee selects the right model tier for each task and enforces per-run budgets.

Overview

The model router inspects the `taskType` field on each check and maps it to a model family (haiku/sonnet/opus). It then picks the cheapest provider that satisfies the tier and has remaining budget.

Tier Table

Task typeFamilyAnthropic modelOpenAI modelCost / 1 M tokens
`file-analysis`haikuclaude-haiku-4-5gpt-4o-mini$0.80
`code-generation`sonnetclaude-sonnet-4-5gpt-4o$3.00
`code-review`sonnetclaude-sonnet-4-5gpt-4o$3.00
`architecture-decision`opusclaude-opus-4-5gpt-4o$15.00
`security-review`opusclaude-opus-4-5gpt-4o$15.00

Budget Enforcement

Set `budgetUsd` in your DAG or pass `--budget 1.00` to the CLI. When the remaining budget falls below the cost of the next check, the router falls back to a cheaper model tier. If no tier fits, the lane is suspended and a `budget-exceeded` event fires.

Supported Providers

- Anthropic — Claude 3 / 4 family via SSE - OpenAI — GPT-4o family via SSE + stream_options - VS Code Sampling — Copilot routing for in-editor workflows - Mock — Built-in deterministic, zero-cost, zero-key provider - Ollama — Local models (Enterprise) - Bedrock — AWS-hosted Claude (Enterprise) - Gemini — Google AI (Enterprise)