Skip to main content

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.
Output:
Steering rules are loaded from ~/.switchailocal/steering/*.yaml files.

test

Test a steering rule against specific conditions.
string
Path to specific rule file to test
string
Intent to test against (e.g., coding, reasoning, fast)
string
User API key hash to test against
integer
Hour of day to test (0-23, default: current hour)
string
Output format: table or json (default: table)
Example:
Output:

validate

Validate steering rule syntax and conditions.
Example:
Output:

reload

Reload all steering rules from disk without restarting the server.
Output:
Hot reload is only available when the server is running with --enable-steering.

Steering Rule Format

Steering rules are defined in YAML files:
~/.switchailocal/steering/custom-routing.yaml

Rule Fields

string
required
Unique identifier for the rule
string
required
Target intent (coding, reasoning, fast, secure, or * for all)
string
required
Model to route to (supports provider prefixes)
integer
required
Priority (0-1000, higher = preferred)
array
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 hash
  • hour_range: <start-end> - Match hour of day (24h format)
  • pii_detected: <true|false> - Match PII detection result
  • quota_remaining: <percentage> - Match quota threshold

Use Cases

Route to local models when cloud providers are unhealthy:
Force local models for requests containing PII:
Use faster, cheaper models during off-peak hours:
Route enterprise users to dedicated models:

Integration with Cortex Router

Steering rules and Cortex Router work together:
  1. Cortex Router classifies the request intent
  2. Steering rules are evaluated against the classified intent
  3. If a steering rule matches, its model overrides the Cortex selection
  4. If no steering rule matches, Cortex selection is used
Use steering for deterministic, policy-based routing and Cortex for intelligent, adaptive routing.

Troubleshooting

  • Verify rule files are in ~/.switchailocal/steering/
  • Check file permissions (must be readable)
  • Run steering validate to check syntax
  • Ensure server was started with --enable-steering
  • Higher priority rules take precedence
  • If priorities are equal, first defined rule wins
  • Use steering test to debug rule evaluation
  • Check condition syntax against supported conditions
  • Ensure provider names match configured providers
  • Verify hour ranges are in 24h format (0-23)

See Also