Summary & Motivation
Different coding tasks require different levels of model capability. Running high-end frontier models (Claude 3.5 Sonnet / GPT-4o) on simple boilerplate tasks wastes budget, while running lightweight models on complex architectural tasks leads to repeated failed attempts.
We want to expand orchestrator/provider_scheduler.py into a Cost- & Risk-Tiered Dynamic Provider Router.
Proposed Routing Logic
- Risk-Tiered Model Selection:
- Tier 1 (Trivial / Boilerplate / Format): Gemini 2.5 Flash Lite / Qwen 2.5 Coder (Fast, sub-cent cost).
- Tier 2 (Standard Task Implementation / Unit Tests): Gemini 2.5 Flash / Claude 3.5 Haiku / GPT-4o-mini.
- Tier 3 (Crucible / Architecture / High-Risk Refactor / 3-Strike Repair): Claude 3.5 Sonnet / GPT-4o / DeepSeek R1.
- Dynamic Fallback Escalation:
- If a contract fails Attempt 1 with a Tier 2 model, Attempt 2 automatically escalates to a Tier 3 frontier model with the failed attempt evidence.
- Cost Ceiling Enforcement:
- Respects max cost limits configured in
BudgetGuard.
Acceptance Criteria
Summary & Motivation
Different coding tasks require different levels of model capability. Running high-end frontier models (Claude 3.5 Sonnet / GPT-4o) on simple boilerplate tasks wastes budget, while running lightweight models on complex architectural tasks leads to repeated failed attempts.
We want to expand
orchestrator/provider_scheduler.pyinto a Cost- & Risk-Tiered Dynamic Provider Router.Proposed Routing Logic
BudgetGuard.Acceptance Criteria
risk_tieror failure history.tests/test_provider_scheduler.py.