model-switcher

Switch OpenClaw's primary AI model by mapping aliases to upstream identifiers.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/dingdyan/openclaw-workspace-v2 --skill model-switcher
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-switcher
Source: https://github.com/dingdyan/openclaw-workspace-v2/tree/main/skills/model-switcher
Command: npx skills add https://github.com/dingdyan/openclaw-workspace-v2 --skill model-switcher

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openclaw, jq.

What problem does it solve?

It solves the problem of quickly changing OpenClaw’s primary AI model without manually editing configuration files, so you can respond with the right model for the task.

Core Features & Use Cases

  • Alias-to-model switching: Accepts common aliases like gemini-3.1, flash, glm-4, and ark-code, mapping them to the correct upstream model IDs.
  • Config update for agent default model: Updates agents.defaults.model.primary via the openclaw config set command.
  • Automatic gateway restart: Restarts the gateway after a successful configuration update to ensure the new model takes effect.

Quick Start

Run the model-switcher with the alias you want, for example: tell it to switch the primary model to gemini-3.1.

Frequently Asked Questions about model-switcher

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I switch the primary AI model in OpenClaw?

To switch the primary model in OpenClaw, use a shell script that maps user-friendly aliases like flash to upstream model identifiers, updates the configuration, and triggers a gateway restart. This avoids manual config file edits.

What is the best way to change OpenClaw's default model for different tasks?

The best way to change OpenClaw's default model is using alias-to-model switching. It maps aliases like gemini-3.1 or ark-code to correct upstream IDs and updates the agent default model configuration automatically.

Do I need to manually restart the OpenClaw gateway after changing the model?

No, you do not need to manually restart the OpenClaw gateway after changing the model. The switching script triggers an automatic gateway restart upon successful configuration update to ensure the new model takes effect.

Can I use model aliases like flash and glm-4 to configure OpenClaw?

Yes, you can use model aliases like flash and glm-4 to configure OpenClaw. The system accepts common aliases and maps them directly to the correct upstream model identifiers for quick switching.

What dependencies are required to run a script that switches OpenClaw models?

To run a script that switches OpenClaw models, the required dependencies are the openclaw CLI and jq. The script validates the presence of the openclaw CLI before setting the primary model.

Why does my OpenClaw configuration not update when I change the primary model?

Your OpenClaw configuration may not update if the openclaw CLI is missing or if the gateway restart fails. The switcher script validates CLI presence, sets agents.defaults.model.primary, and triggers a gateway restart on success.