Never crash your OpenClaw gateway again.
Safe, redundant AI model configuration with automatic fallback chains, validation, and one-command recovery. Built for every OpenClaw user — from first install to production deployment.
Editing openclaw.json directly for model changes is the #1 cause of OpenClaw gateway crashes:
- Put an image model as primary LLM → gateway dead
- Typo in model reference → gateway dead
- Provider goes down, no fallback → gateway dead
- No config backup → hours rebuilding from scratch
Model Switchboard gives you:
- 3-deep fallback chains — if Model A fails, B catches it, then C
- Provider diversity — never stack the same provider in a chain
- Pre-flight validation — blocks unsafe assignments before they touch config
- Auto-backup — snapshots config before every change (30 rolling)
- One-command recovery —
restore latest= 2 seconds, not 5 hours - Per-task routing — right model for the right job (conversation, coding, images, heartbeat)
- Visual dashboard — see your entire model tree at a glance
- Setup wizard — guided first-time configuration
# First time? Run the setup wizard:
./scripts/switchboard.sh setup
# See current model assignments:
./scripts/switchboard.sh status
# Auto-generate 3-deep redundant config:
./scripts/switchboard.sh redundancy-apply
# Change a model (validates + backs up first):
./scripts/switchboard.sh set-primary anthropic/claude-opus-4-6
# Something broke? Instant recovery:
./scripts/switchboard.sh restore latestGetting Started
setup/init— First-time setup wizard with provider detection
Model Assignment
status— Show current model tree + healthset-primary <model>— Set primary LLMset-image <model>— Set image/vision modeladd-fallback <model>— Add LLM fallbackremove-fallback <model>— Remove LLM fallbackadd-image-fallback <model>— Add image fallbackremove-image-fallback <model>— Remove image fallback
Redundancy
redundancy [depth]— Assess current redundancy (default: 3-deep)redundancy-deploy [depth]— Preview optimal redundant configredundancy-apply [depth]— Apply redundant config to live gateway
Discovery & Planning
discover— List all available modelsrecommend— Suggest optimal assignments per roledry-run <action> <model>— Preview changes without applyingvalidate <model> <role>— Test model-role compatibility
Backup & Restore
backup— Manual config backuplist-backups— Show available backups (30 rolling)restore <file|latest>— Instant restore from any backup
Import / Export
export [file]— Export model config as portable JSONimport <file>— Import config (validates all models before applying)
Diagnostics
health— Gateway + provider auth statusui— Generate Canvas dashboard data
Model Switchboard builds fallback chains with three rules:
- Minimum 3 models deep per critical role
- Provider diversity — never use the same provider twice in a chain
- Cost-appropriate — expensive models for conversation, cheap ones for heartbeat
Primary LLM: anthropic/claude-opus → openai/gpt-5.2 → google/gemini-3-pro
Image: anthropic/claude-opus → google/gemini-3-pro → openai/gpt-5.1
Heartbeat: google/gemini-flash → minimax/m1 → groq/llama-4
Coding: anthropic/claude-opus → openai/gpt-5.2 → google/gemini-3-pro
If Anthropic goes down → OpenAI catches it. If OpenAI goes down → Google catches it. Your agent never dies.
Different tasks need different models. The dashboard shows two types of roles:
These map directly to openclaw.json and work immediately:
- Primary LLM — Your main conversational model
- LLM Fallbacks — Ordered backup chain for primary
- Image Model — Vision/image processing
- Image Fallbacks — Backup chain for vision
These show as "(not set)" by default. They're a visual planner for assigning models to task types. Click any role to assign a model — the assignment is saved to task-routing.json and can be referenced when configuring cron jobs and sub-agent spawns.
- Research — Deep analysis, web search (e.g., Grok for native search)
- Coding Pass 1/2/3 — Multi-pass code generation with provider diversity enforcement
- Social Media — Creative content generation
- Web Ops — Search/scrape capable models
- Heartbeat — Cheapest model for periodic polling (e.g., Haiku, Flash)
Extended roles don't auto-wire into OpenClaw's routing yet — they're a reference for how you want to assign models across your automation. Use them to plan your cron job model assignments and sub-agent configurations, then set the actual model param on each job accordingly.
Example workflow:
- Set Research role →
xai/grok-4-fastin the dashboard - When creating research cron jobs, use
model: "xai/grok-4-fast"in the job config - The
validate-cron-modelscommand checks that all your cron jobs use valid, allowed models
Works with every OpenClaw-compatible provider:
- Anthropic — Claude Opus, Sonnet, Haiku
- OpenAI — GPT-5.x family, Codex
- Google — Gemini 3 Pro, 2.5 Flash, Vertex AI
- OpenCode Zen — Multi-model proxy
- Z.AI — GLM family
- xAI — Grok (search-enabled)
- OpenRouter — 300+ models from all providers
- Groq — Ultra-fast inference
- Cerebras — Fast inference
- MiniMax — Cost-effective LLM
- Vercel AI Gateway — Enterprise proxy
- Fail-closed — if validation can't run, changes are blocked (not allowed through)
- Type enforcement — image-gen models (DALL-E) can never be set as primary LLM
- Atomic writes — config written to temp file, validated, then renamed (no corruption)
- Operation-specific rollback — each change tracks its own backup (not just "latest")
- XSS-safe dashboard — all data rendered via textContent/createElement, never raw innerHTML
- Opus-audited — full security audit by Claude Opus, all findings fixed
- OpenClaw — any recent version
- Python 3.8+ — pre-installed on macOS and most Linux
- Bash 3.2+ — pre-installed on macOS, Linux, WSL
- No external dependencies — no npm, no pip, no network required
model-switchboard/
├── SKILL.md — Agent instructions (read by OpenClaw agents)
├── README.md — This file
├── ARCHITECTURE.md — Vision and design docs
├── model-registry.json — Known model capabilities (22 models, 14 providers)
├── scripts/
│ ├── switchboard.sh — Main CLI (21 commands)
│ ├── validate.py — Fail-closed validation engine
│ ├── redundancy.py — Auto-generates optimal fallback chains
│ └── setup.sh — First-time setup wizard
└── ui/
└── index.html — Canvas dashboard (XSS-safe)
If you're an AI agent reading this: NEVER edit openclaw.json model fields directly. Always use this skill's commands. Read SKILL.md for complete operating instructions.
- Add models: Edit
model-registry.jsonwith new model capabilities - Add providers: Add to the providers section with auth env vars
- Report bugs: Open an issue with your OS, Python version, and error output
- Share configs: Use
exportto share your optimal model setup
MIT — Free and open source for every OpenClaw user.
Built with love for the OpenClaw community. No agent should ever go dark because of a config mistake.