Intelligent model routing for sub-agent task delegation. Choose the optimal model based on task complexity, cost, and capability requirements. Reduces costs by routing simple tasks to cheaper models while preserving quality for complex work.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
Intelligent model routing for sub-agent task delegation. Choose the optimal model based on task complexity, cost, and capability requirements. Reduces costs by routing simple tasks to cheaper models while preserving quality for complex work.
version
3.2.0
core
true
Intelligent Router — Core Skill
CORE SKILL: This skill is infrastructure, not guidance. Installation = enforcement.
Run bash skills/intelligent-router/install.sh to activate.
What It Does
Automatically classifies any task into a tier (SIMPLE/MEDIUM/COMPLEX/REASONING/CRITICAL)
and recommends the cheapest model that can handle it well.
The problem it solves: Without routing, every cron job and sub-agent defaults to Sonnet
(expensive). With routing, monitoring tasks use free local models, saving 80-95% on cost.
⚠️ ollama-gpu-server is BLOCKED for cron/spawn use. Ollama binds to 127.0.0.1 by default — unreachable over LAN from the OpenClaw host. The router_policy.py enforcer will reject any payload referencing it.
Models defined in config.json. Add new models there, router picks them up automatically.
Local Ollama models have zero cost — always prefer them for SIMPLE tasks.
Auto-Discovery (Self-Healing)
The intelligent-router can automatically discover working models from all configured providers via real live inference tests (not config-existence checks).
How It Works
Provider Scanning: Reads ~/.openclaw/openclaw.json → finds all models
Live Inference Test: Sends "hi" to each model, checks it actually responds (catches auth failures, quota exhaustion, 404s, timeouts)
OAuth Bypass: Providers with sk-ant-oat01-* tokens (Anthropic OAuth) are skipped in raw HTTP — OpenClaw refreshes these transparently, so they're always marked available
Thinking Model Support: Models that return content=None + reasoning_content (GLM-4.7, Kimi-K2, Qwen3-thinking) are correctly detected as available
Auto-Classification: Tiers assigned via tier_classifier.py using 4 capability signals
Config Update: Removes unavailable models, rebuilds tier primaries from working set
Cron: Hourly refresh (cron id: a8992c1f) keeps model list current, alerts if availability changes by >2
Usage
# One-time discovery
python3 skills/intelligent-router/scripts/discover_models.py
# Auto-update config with working models only
python3 skills/intelligent-router/scripts/discover_models.py --auto-update
# Set up hourly refresh cron
openclaw cron add --job '{
"name": "Model Discovery Refresh",
"schedule": {"kind": "every", "everyMs": 3600000},
"payload": {
"kind": "systemEvent",
"text": "Run: bash skills/intelligent-router/scripts/auto_refresh_models.sh",
"model": "ollama/glm-4.7-flash"
}
}'
Benefits
✅ Self-healing: Automatically removes broken models (e.g., expired OAuth)
✅ Zero maintenance: No manual model list updates
✅ New models: Auto-adds newly released models
✅ Cost optimization: Always uses cheapest working model per tier
Discovery Output
Results saved to skills/intelligent-router/discovered-models.json: