一个基于 WebUI 的 OpenClaw 模型切换工具,支持快速切换 AI 模型提供商。
当用户提到以下内容时激活此技能:
用户说「打开模型切换」后:
用户说「切换到 deepseek 模型」后,直接调用 OpenClaw 配置接口修改 openclaw.json。
text
后端:Python FastAPI (端口 9131)
前端:Vue 3 + Element Plus (已构建为静态文件)
配置:~/.openclaw/openclaw.json
接口方法说明GET /api/configGET获取当前配置和模型列表POST /api/savePOST保存模型到通讯录(不重启)POST /api/switchPOST切换模型并重启服务POST /api/gateway/controlPOST控制 Gateway(stop/start/restart)POST /api/deletePOST删除模型或提供商GET /api/providersGET获取所有提供商
~/.openclaw/agents/main/agent/auth-profiles.json 供 OpenClaw 使用text
openclaw-model-switcher/
├── SKILL.md
├── scripts/
│ ├── start.ps1 # Windows 启动脚本
│ └── switch_model.py # 命令行快速切换
└── assets/
└── frontend/ # 已构建的前端静态文件
├── index.html
└── assets/
无需启动 WebUI,直接用 Python 脚本切换模型:
bash
# 切换模型
python switch_model.py --provider deepseek --model deepseek-chat
# 查看当前模型
python switch_model.py --status
# 重启 Gateway
python switch_model.py --restart