Expand description
Agent router — selects the best agent and model for each task.
The router uses LLM-based classification to route tasks to the best agent (claude, codex, opencode, kimi, or minimax) based on task content, labels, and configured routing rules. It also generates a specialized agent profile.
Routing logic (in priority order):
- Check for
agent:*label on task — use that agent directly - If weighted_round_robin enabled, select by capacity-weighted probability
- If round_robin mode, cycle through agents (stateful, skips last-used)
- Call LLM classifier for intelligent routing
- After N LLM failures, fall back to round-robin
- Track last routed agent to distribute load across agents
Re-exports§
pub use config::parse_pool_entry;pub use config::RouterConfig;pub use weights::AgentWeights;
Modules§
- config
- Router configuration — loading, defaults, and model map.
- weights
- Per-agent routing weights and rate-limit recovery.
Structs§
- Agent
Profile - Specialized agent profile for a task.
- LlmRouter
Handle - An opaque, cheaply-cloneable handle to the LLM routing subsystem.
- Route
Result - Result of routing a task to an agent.
- Router
- The agent router.
Enums§
- AllAgents
Cooled Error - Error returned when all agents/models are in cooldown and routing is temporarily unavailable.
- Route
Result Error - Typed error returned by
get_route_result.
Functions§
- get_
route_ result - Retrieve routing result from the task store.