--router flag enables intelligent model selection, automatically choosing the best model based on task complexity.
Quick Start


Usage
Basic Router
Complex Task
Specify Provider
Combine with Other Features
How It Works
- Prompt Analysis: The router analyzes your prompt
- Complexity Assessment: Determines task complexity (simple/medium/complex)
- Model Selection: Chooses appropriate model based on complexity
- Execution: Runs the task with the selected model
Complexity Levels
Model Selection Matrix
OpenAI Models
Anthropic Models
Cost Savings Example
Without router (always using gpt-4-turbo):Use Cases
Cost Optimization
Quality Assurance
Batch Processing
Complexity Indicators
The router considers these factors:Simple Tasks
- Short prompts (< 50 words)
- Basic questions
- Simple calculations
- Factual lookups
- Yes/no questions
Complex Tasks
- Long prompts (> 200 words)
- Technical analysis
- Code generation
- Multi-step reasoning
- Creative writing
- Research tasks
Best Practices
Cost Monitoring
Use
--metrics to track savingsProvider Preference
Use
--router-provider for specific needsOverride When Needed
Use
--llm to override router selectionBatch Operations
Router is ideal for varied batch tasks

