Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

openclaw-model-switch

БесплатноЗапускает вложенные скриптыНе проверен

Switches or repairs an OpenClaw instance's model config: changes the default model, adds model definitions, and fixes 401 "Invalid token", "No available…

daymadeот daymade★ 1 556 звёзд на GitHub

Об этом скилле

OpenClaw Model Switch

Switch or repair the model used by the running OpenClaw instance. Prefer its validated native configuration commands; retain the bundled file tools for offline and older-version work.

Diagnose before you edit. Model failures on OpenClaw are usually NOT the model id — they are key routing (env hijack), provider-plugin restrictions, or endpoint/model mismatch. Changing the model id without checking these first is how a 5-minute fix becomes a 2-hour debugging session. The full trap catalog with discovery commands lives in references/troubleshooting-model-config.md — read it the moment anything errors.

Step 1 — Find the real config file(s)

Do NOT assume a hardcoded path. Candidate locations (check all, edit all that exist):

  1. ~/.openclaw/openclaw.json — the gateway's live config on most installs
  2. ~/.kimi/kimi-claw/openclaw.json — Kimi Claw mirror, kept in sync on some installs
  3. ~/.kimi_openclaw/openclaw.json — legacy desktop path

Confirm which one the gateway actually reads with openclaw gateway status (or its JSON config paths). Select that installation's profile/config context before issuing commands. If several files exist, verify which are maintained mirrors and keep those in sync; existence alone does not prove they belong to the same instance. Reconcile an Ansible or other deployment source too when it owns the default, so the next deployment preserves it.

Step 2 — Probe the endpoint + model BEFORE touching config

Never trust a relay's model listing (GET /v1/models on new-api style relays is frequently incomplete — a model can be absent from the list yet serve fine). The only authority is a real completion probe from the host that will run the bot:

Match the Gateway's effective credential and proxy route. An SSH login shell can inherit a dead proxy that the Gateway does not use; record that difference before interpreting a failed probe. Do not print keys or dump the process's full environment. Use the exact model variant requested by the user and verify its input modes, context/output limits and supported thinking settings from the provider's current documentation; do not infer them from the family name.

curl -sS -o /tmp/probe.json -w "HTTP %{http_code}\n" \
  -X POST "<baseUrl>/v1/messages" \
  -H "Authorization: Bearer <apiKey>" \
  -H "Content-Type: application/json" \
  -H "anthropic-version: 2023-06-01" \
  -d '{"model":"<model-id>","max_tokens":16,"messages":[{"role":"user","content":"hi"}]}'

Expected: HTTP 200 and a content array in the body. 401 Invalid token with a token you just verified works elsewhere → the wire key is being hijacked (see trap #1 in the troubleshooting reference). 503 No available channel → the model is not served for this token/group from this network (trap #3) — pick a served model or fix the relay, don't blind-switch.

Step 3 — Switch the model

Read openclaw config set --help on the selected installation. On versions supporting batch writes, prepare a private JSON batch containing the model definition and default assignment:

[
  {"path":"models.providers.example.models","value":[{"id":"target-model","name":"Target model"}]},
  {"path":"agents.defaults.model.primary","value":"example/target-model"}
]

Replace example with the existing provider id and target-model with the verified served model. Fill the definition's reasoning, input and token limits from the verified model spec; include agents.defaults.thinkingDefault only when the target requires a compatible change. Preserve credentials, headers, plugins and unrelated model entries. Back up the active config privately before applying the batch; do not commit either credentials or the live config.

openclaw config set --batch-file ./model-batch.json --merge --dry-run
openclaw config set --batch-file ./model-batch.json --merge

Use --merge to retain existing model definitions; use replacement only for an explicitly authorized removal. Follow the CLI's application hint: hot reload, no change, or required restart. The hint describes expected application, so complete Step 4 even after a hot-reload hint. Restart only when required, after checking service ownership, in-flight work and recovery. See native configuration commands.

Offline tools and older versions

Retain these helpers for exported/stopped configurations or a verified older CLI without the native write interface. Back up the selected files and preserve maintained mirrors. A live older-version repair must respect the same service and in-flight-work checks; --restart is an explicit option, not the default completion step. This helper has no dry-run mode; inspect a private exported copy first when the proposed file edits need a preview. The legacy helper only supplies definitions for its known-model table and rewrites same-provider entries in `agents.def

Полный SKILL.md на GitHub

Установить openclaw-model-switch в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/kimi-models.mdreferences/troubleshooting-model-config.mdscripts/switch-model.py

FAQ

Что делает скилл openclaw-model-switch?

Switches or repairs an OpenClaw instance's model config: changes the default model, adds model definitions, and fixes 401 "Invalid token", "No available channel / model not found", "Thinking level X is not supported", or a config edit that doesn't take effect. Use for 切换模型/换模型/升级模型 or 模型配的错了. Not for plain config audits (use openclaw).

Как установить скилл openclaw-model-switch?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл openclaw-model-switch запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить openclaw-model-switch с