Skip to content

feat(router): triage + cascade hybrid routing with fallback on misclassification #2145

@bug-ops

Description

@bug-ops

Parent epic: #2141

Phase 4: Triage + Cascade hybrid

Tasks

  • Composite routing: triage picks initial tier, cascade catches misclassifications
  • Config: fallback_strategy = "cascade" in [llm.complexity_routing]
  • If triage routes to cheap model and cascade detects degenerate output → escalate as normal
  • Triage verdict stored in turn metadata for cascade to reference (avoid re-triage on escalation)
  • Consider LlmRoutingStrategy::TriageCascade composite variant vs runtime composition

Key files

  • crates/zeph-llm/src/router/triage.rs
  • crates/zeph-llm/src/router/cascade.rs
  • crates/zeph-llm/src/router/mod.rs

Acceptance criteria

  • Misclassified complex task (triage says Simple, output is degenerate) → cascade escalates
  • Correctly classified simple task → no escalation, cheap model response returned
  • Composite routing config validates that cascade providers match triage tier providers

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions