Overview
Steering commands manage runtime routing rules that automatically adjust model selection based on intent, user, time of day, and other conditions. Steering rules complement the Cortex Router by providing static, deterministic routing policies.Commands
list
Display all active steering rules.Steering rules are loaded from
~/.switchailocal/steering/*.yaml files.test
Test a steering rule against specific conditions.Path to specific rule file to test
Intent to test against (e.g.,
coding, reasoning, fast)User API key hash to test against
Hour of day to test (0-23, default: current hour)
Output format:
table or json (default: table)validate
Validate steering rule syntax and conditions.reload
Reload all steering rules from disk without restarting the server.Steering Rule Format
Steering rules are defined in YAML files:~/.switchailocal/steering/custom-routing.yaml
Rule Fields
Unique identifier for the rule
Target intent (
coding, reasoning, fast, secure, or * for all)Model to route to (supports provider prefixes)
Priority (0-1000, higher = preferred)
List of conditions that must all be true for the rule to apply
Supported Conditions
provider: <name>+status: <healthy|unhealthy|degraded>user_pattern: <glob>- Match user API key hashhour_range: <start-end>- Match hour of day (24h format)pii_detected: <true|false>- Match PII detection resultquota_remaining: <percentage>- Match quota threshold
Use Cases
Automatic Failover to Local Models
Automatic Failover to Local Models
Route to local models when cloud providers are unhealthy:
Sensitive Data Routing
Sensitive Data Routing
Force local models for requests containing PII:
Off-Hours Cost Optimization
Off-Hours Cost Optimization
Use faster, cheaper models during off-peak hours:
Enterprise User Isolation
Enterprise User Isolation
Route enterprise users to dedicated models:
Integration with Cortex Router
Steering rules and Cortex Router work together:- Cortex Router classifies the request intent
- Steering rules are evaluated against the classified intent
- If a steering rule matches, its model overrides the Cortex selection
- If no steering rule matches, Cortex selection is used
Troubleshooting
Rules not applying
Rules not applying
- Verify rule files are in
~/.switchailocal/steering/ - Check file permissions (must be readable)
- Run
steering validateto check syntax - Ensure server was started with
--enable-steering
Multiple rules matching
Multiple rules matching
- Higher priority rules take precedence
- If priorities are equal, first defined rule wins
- Use
steering testto debug rule evaluation
Condition not recognized
Condition not recognized
- Check condition syntax against supported conditions
- Ensure provider names match configured providers
- Verify hour ranges are in 24h format (0-23)
See Also
- Cortex Router - Intelligent routing system
- Heartbeat Commands - Monitor provider health
- Hooks Commands - Set up event triggers