Requirements
- Target platform
- OpenClaw
- Install method
- Manual import
- Extraction
- Extract archive
- Prerequisites
- OpenClaw
- Primary doc
- SKILL.md
Multi-model automatic fallback system. Monitors model availability and automatically falls back to backup models when the primary model fails. Supports MiniM...
Multi-model automatic fallback system. Monitors model availability and automatically falls back to backup models when the primary model fails. Supports MiniM...
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
Multi-model automatic fallback system for AI agents
This skill provides automatic model fallback functionality for OpenClaw agents. When the primary model fails (unavailable, slow, or rate-limited), it automatically switches to backup models in a predefined priority order.
Automatic Fallback: Seamlessly switch to backup models on failure Configurable Priority: Define your own model fallback order Health Monitoring: Track model availability and response times Cost Optimization: Use cheaper models for simple tasks Logging: Full audit trail of fallback events
ProviderModelContextUse CaseMiniMaxM2.5200KPrimary (reasoning)MiniMaxM2.1200KBackupKimiK2.5256KLong documentsKimiK2128KStandardZhipuGLM-4-Air128KLow costZhipuGLM-4-Flash1MHigh volume
{ "fallback_chain": [ { "provider": "minimax-portal", "model": "MiniMax-M2.5", "priority": 1, "timeout": 30, "max_retries": 3 }, { "provider": "moonshot", "model": "kimi-k2.5", "priority": 2, "timeout": 30, "max_retries": 2 }, { "provider": "zhipu", "model": "glm-4-air", "priority": 3, "timeout": 20, "max_retries": 2 } ] }
VariableRequiredDescriptionMODEL_FALLBACK_ENABLEDNoEnable/disable fallback (default: true)MODEL_FALLBACK_LOG_LEVELNoLog level: debug, info, warn, error
The skill automatically handles model failures. No explicit calls needed. # Trigger a model call (fallback happens automatically on failure)
# Force fallback to next model /scripts/model-fallback.sh --force-next # Check current model status /scripts/model-fallback.sh --status # Reset to primary model /scripts/model-fallback.sh --reset
Edit config.json to customize the fallback chain: { "fallback_chain": [ {"provider": "...", "model": "...", "priority": 1} ], "health_check": { "enabled": true, "interval_seconds": 300 } }
1. User makes request with primary model 2. Model call fails (error, timeout, rate limit) 3. Skill detects failure 4. Wait 3 seconds (debounce) 5. Switch to next model in chain 6. Retry request with new model 7. If successful, return result 8. If failed, repeat steps 4-7 9. If all models fail, return error with details
TriggerConditionActionAPI UnavailableConnection timeoutFallbackRate Limit429 responseFallback + waitSlow Response> timeout secondsFallbackInvalid ResponseParse errorFallbackAuth Error401/403 responseLog + stop
Logs are written to: ~/.openclaw/logs/model-fallback.log
[2026-02-27 14:00:00] [INFO] Primary model MiniMax-M2.5 called [2026-02-27 14:00:05] [WARN] Model failed: rate limit exceeded [2026-02-27 14:00:05] [INFO] Falling back to Kimi K2.5 [2026-02-27 14:00:10] [INFO] Fallback successful
Use cheaper models for simple tasks: { "task_routing": { "simple_query": ["glm-4-air", "glm-4-flash"], "complex_reasoning": ["MiniMax-M2.5", "kimi-k2.5"], "long_context": ["kimi-k2.5", "MiniMax-M2.1"] } }
Add to openclaw.json: { "models": { "mode": "merge", "fallback": { "enabled": true, "config": "~/.openclaw/skills/model-fallback/config.json" } } }
Integrate with system health monitoring: # Check model health curl http://localhost:18789/api/models/health
Check if fallback is enabled: echo $MODEL_FALLBACK_ENABLED Verify config exists: ls ~/.openclaw/skills/model-fallback/config.json Check logs: tail -f ~/.openclaw/logs/model-fallback.log
Check API keys are valid Verify network connectivity Check rate limits on provider dashboard
User: "Hello" System: Using MiniMax-M2.5... System: Rate limited, switching to Kimi K2.5... System: Response from Kimi K2.5: "Hello! How can I help?"
User: "What is 2+2?" System: Routing to glm-4-air (low cost)... System: Response: "2+2=4"
User: "Summarize this 100-page PDF" System: Detected long context requirement System: Routing to Kimi K2.5 (256K context)... System: Processing...
MIT
CC (AI Assistant)
1.0.0
Agent frameworks, memory systems, reasoning layers, and model-native orchestration.
Largest current source with strong distribution and engagement signals.