Skip to content
Back to skills

Model Switchboard

ASecurity

"Editing openclaw.json directly for model changes is the #1 cause

  • 21 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 7, 2026
ai-agentspythongobashdatabase

Works with

  • cli

Security analysis

A100/100

Pro scans all 16 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill model-switchboard --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Model Switchboard?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Model Switchboard
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-model-switchboard/badge)](https://www.skillsdirectory.com/skills/modbender-model-switchboard)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Model Switchboard v3.0 — Safe AI Model Configuration for OpenClaw
description: "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 tha..."
---

# 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

```bash
SWITCHBOARD="$SKILL_DIR/scripts/switchboard.sh"

# View current setup
$SWITCHBOARD status

# Change 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 suggestions

# Redundancy (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 depth

# Backup & restore
$SWITCHBOARD backup            # Manual backup
$SWITCHBOARD list-backups      # Show all backups
$SWITCHBOARD restore latest    # Undo last change

# Import/Export (portable model configs)
$SWITCHBOARD export config.json
$SWITCHBOARD import config.json

# Cron model validation
$SWITCHBOARD validate-cron-models  # Check cron jobs use valid models

# Diagnostics
$SWITCHBOARD health            # Gateway + provider status
$SWITCHBOARD validate <model> <role>  # 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:

- **Format**: Must be `provider/model-name` (e.g., `anthropic/claude-opus-4-6`)
- **Capability match**: LLM roles require `llm` + `tools` capabilities
- **Image roles**: Require `vision` capability
- **Hard blocks**: Image-generation-only models (DALL-E, Stability) blocked from ALL LLM roles
- **Registry warnings**: Unknown models get a caution warning but are allowed (for OpenRouter/new models)

## Known Providers

- `anthropic` — Claude family (Opus, Sonnet, Haiku)
- `openai` — GPT family
- `openai-codex` — Codex OAuth models
- `google` — Gemini family
- `opencode` — Zen proxy (routes to various models)
- `zai` — GLM family
- `xai` — Grok family
- `openrouter` — Multi-provider gateway
- `groq`, `cerebras` — Fast inference

## Canvas UI

To show the visual dashboard:
```bash
# Get UI data
DATA=$($SWITCHBOARD ui)

# Present via canvas
# The UI reads window.__switchboardData JSON
```

The Canvas UI at `ui/index.html` shows:
- Primary LLM and Image model with color coding
- Fallback chains (ordered)
- Provider auth status (green/red indicators)
- Model allowlist
- Config issues with severity levels
- Backup count

## 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 <action> <model>`
4. **Confirm with user** before applying
5. **Apply**: `$SWITCHBOARD <action> <model>`
6. **Verify**: Check gateway health after change

**NEVER:**
- Edit `openclaw.json` directly for model fields
- Skip the dry-run for primary model changes
- Apply without user confirmation
- Ignore validation failures

## Troubleshooting

**Gateway won't start:**
```bash
$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:
```bash
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:
```bash
# 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)
```

Files in this skill

  • ARCHITECTURE.md7.1 KB
  • AUDIT-OPUS.md10.5 KB
  • CHANGELOG.md2.4 KB
  • README.md8.1 KB
  • SKILL.md5.9 KB
  • model-registry.json27.5 KB
  • scripts/redundancy.py15 KB
  • scripts/setup.sh6.5 KB
  • scripts/switchboard.sh37.2 KB
  • scripts/validate.py21.4 KB
  • task-routing.json1.3 KB
  • ui/dashboard.html39.3 KB
  • ui/index.html41.8 KB
  • ui/index_v1_backup.html42 KB
  • ui/server.py55.5 KB
  • ui/server_v1_backup.py20.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.