How it works
Five-tier priority system, evaluated in order:- Task-type override — if you’ve pinned a specific model to a task type, that wins
- Self-learning — if a model has a strong success record for this task type (min 20 samples), use it
- Budget fallback — if monthly spend exceeds your threshold, downgrade non-critical tasks to Haiku
- Ollama — if Ollama is running locally and the task is eligible (summary, chat), route there
- Task-type defaults — built-in sensible defaults per task type
Default routing
| Task type | Default model |
|---|---|
code | Claude Sonnet 4.6 |
research | Claude Sonnet 4.6 |
creative | Claude Opus 4.6 |
summary | Claude Haiku 4.5 |
chat | Claude Haiku 4.5 |
Configuration
Configure in Settings → Model Router in the dashboard, or directly in~/.openclaw/openclaw.json:
Options
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable or disable the router |
primaryModel | string | anthropic/claude-sonnet-4-6 | Default model for most tasks |
fallbackModel | string | anthropic/claude-haiku-4-5 | Used when over budget |
budgetThreshold | number | 80 | % of monthly budget that triggers fallback |
selfLearning | boolean | true | Learn from task outcomes |
selfLearningSampleThreshold | number | 20 | Minimum samples before self-learning overrides defaults |
taskTypeOverrides | object | {} | Pin specific models to task types |
lockedTaskTypes | array | [] | Prevent self-learning from changing these task types |
ollamaEnabled | boolean | false | Route eligible tasks to local Ollama |