Model Switchboard
by @frank-bot07
Safely configure OpenClaw AI models by validating roles, autoloading backups, blocking unsafe changes, and managing via CLI or Canvas UI.
clawhub install model-switchboardπ About This Skill
Model Switchboard v3.0 β Safe AI Model Configuration for OpenClaw
> β HARD RULE: NEVER edit openclaw.json model fields directly.
> Always use this skill's commands. No exceptions. Ever.
Why This Exists
Editing openclaw.json directly for model changes is the #1 cause of OpenClaw gateway crashes. Wrong model type in wrong slot = instant death. No backup = hours rebuilding. This skill eliminates that entirely.
How It Works
1. Validates model format and role compatibility before any change
2. Auto-backs up config before every modification (30 rolling backups)
3. Uses OpenClaw CLI (openclaw models set) β never raw JSON
4. Blocks unsafe assignments (image-gen model as primary LLM = blocked)
5. Instant rollback if anything goes wrong
6. Canvas UI for visual model management
Quick Reference
SWITCHBOARD="$SKILL_DIR/scripts/switchboard.sh"View current setup
$SWITCHBOARD statusChange models
$SWITCHBOARD set-primary "anthropic/claude-opus-4-6"
$SWITCHBOARD set-image "google/gemini-3-pro-preview"
$SWITCHBOARD add-fallback "openai/gpt-5.2"
$SWITCHBOARD remove-fallback "openai/gpt-5.2"
$SWITCHBOARD add-image-fallback "openai/gpt-5.1"Preview before applying
$SWITCHBOARD dry-run set-primary "openai/gpt-5.2"Discovery & recommendations
$SWITCHBOARD discover # List all available models
$SWITCHBOARD recommend # Get optimal suggestionsRedundancy (3-deep failover)
$SWITCHBOARD redundancy # Assess current redundancy
$SWITCHBOARD redundancy-deploy # Preview optimal config
$SWITCHBOARD redundancy-apply # Apply optimal config
$SWITCHBOARD redundancy-apply 4 # Custom depthBackup & restore
$SWITCHBOARD backup # Manual backup
$SWITCHBOARD list-backups # Show all backups
$SWITCHBOARD restore latest # Undo last changeImport/Export (portable model configs)
$SWITCHBOARD export config.json
$SWITCHBOARD import config.jsonCron model validation
$SWITCHBOARD validate-cron-models # Check cron jobs use valid modelsDiagnostics
$SWITCHBOARD health # Gateway + provider status
$SWITCHBOARD validate # Test compatibility
Model Roles
| Role | Purpose | Config Key |
|------|---------|-----------|
| Primary | Main LLM for all conversations | agents.defaults.model.primary |
| Fallback | Ordered backup LLMs | agents.defaults.model.fallbacks |
| Image | Vision/image processing | agents.defaults.imageModel.primary |
| Image Fallback | Backup vision models | agents.defaults.imageModel.fallbacks |
| Heartbeat | Low-cost polling model | agents.defaults.heartbeat.model |
| Coding | Sub-agent code generation | Spawn-time model param |
Validation Rules
The validation engine (scripts/validate.py) enforces:
provider/model-name (e.g., anthropic/claude-opus-4-6)llm + tools capabilitiesvision capabilityKnown Providers
anthropic β Claude family (Opus, Sonnet, Haiku)openai β GPT familyopenai-codex β Codex OAuth modelsgoogle β Gemini familyopencode β Zen proxy (routes to various models)zai β GLM familyxai β Grok familyopenrouter β Multi-provider gatewaygroq, cerebras β Fast inferenceCanvas UI
To show the visual dashboard:
# Get UI data
DATA=$($SWITCHBOARD ui)Present via canvas
The UI reads window.__switchboardData JSON
The Canvas UI at ui/index.html shows:
For Agents: Operating Protocol
When a user asks to change model assignments:
1. Read this SKILL.md first
2. Show current status: $SWITCHBOARD status
3. Preview the change: $SWITCHBOARD dry-run
4. Confirm with user before applying
5. Apply: $SWITCHBOARD
6. Verify: Check gateway health after change
NEVER:
openclaw.json directly for model fieldsTroubleshooting
Gateway won't start:
$SWITCHBOARD restore latest
openclaw gateway restart
Or: openclaw doctor --fix
"Model is not allowed" error: Model isn't in the allowlist. Add it or clear the list:
openclaw config set 'agents.defaults.models."provider/model"' '{"alias":"Name"}'
Or clear: openclaw config unset agents.defaults.models
Unknown model warning:
The model isn't in model-registry.json. Add it for future validation:
# Edit model-registry.json to add the model entry
File Structure
model-switchboard/
βββ SKILL.md # This file β agent instructions
βββ README.md # ClawHub publishing readme
βββ model-registry.json # Known model capabilities database
βββ scripts/
β βββ switchboard.sh # Main CLI tool (bash)
β βββ validate.py # Validation engine (python3, no deps)
βββ ui/
βββ index.html # Canvas dashboard (single-file, no deps)
π Tips & Best Practices
Gateway won't start:
$SWITCHBOARD restore latest
openclaw gateway restart
Or: openclaw doctor --fix
"Model is not allowed" error: Model isn't in the allowlist. Add it or clear the list:
openclaw config set 'agents.defaults.models."provider/model"' '{"alias":"Name"}'
Or clear: openclaw config unset agents.defaults.models
Unknown model warning:
The model isn't in model-registry.json. Add it for future validation:
# Edit model-registry.json to add the model entry