Smart Model Switch for Openclaw

An intelligent model selection engine that automatically routes prompts to the optimal LLM based on task complexity and file types.

zhaog100
v1.3.0
Mar 5, 2026
0
245
4

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install smart-model-switch

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install smart-model-switch using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Smart Model Switch?

Smart Model Switch is a specialized utility designed for the Openclaw Skills ecosystem that automates the selection of Large Language Models. It eliminates the need for manual model switching by analyzing the complexity of incoming messages, detecting file types, and identifying specific task requirements such as coding or visual analysis. This skill ensures that users always receive the highest quality response while optimizing for speed and token cost.

By implementing a multi-dimensional evaluation system, the skill categorizes tasks into specialized tiers including Flash for simple queries, Coding for development, Vision for media, and Complex for deep architectural analysis. It seamlessly integrates into the AI workflow, providing a zero-friction experience for developers and power users.

Smart Model Switch Use Cases

  • Automatically switching to a Vision model when uploading .mp4 or .png files for analysis.
  • Routing high-complexity architectural queries to specialized reasoning models based on a 0-10 complexity score.
  • Optimizing token expenditure by using Flash-tier models for simple greetings and basic Q&A.
  • Managing long-context conversations by automatically pivoting to 256k window models when context usage exceeds 85%.

How Smart Model Switch Works

  1. The system performs a multi-dimensional assessment of the input, weighing length (30%), keywords (40%), code features (20%), and visual elements (10%).
  2. It identifies the file type and extension (e.g., .js, .pdf, .jpg) of any attachments to determine the primary task category.
  3. A complexity score from 0 to 10 is generated to differentiate between simple tasks and deep analysis requirements.
  4. The skill applies a priority hierarchy: File Type > Message Features > Complexity Score > Default Model.
  5. The selected model is triggered via an enhanced switching script before the AI generates its response.

Smart Model Switch Setup

To install the skill, use the following commands in your terminal:

# Navigate to the skills directory
cd ~/.openclaw/workspace/skills/smart-model-switch

# Run the installation script
bash install.sh

# Alternatively, install via ClawHub
clawhub install smart-model-switch

To enable proactive AI behavior, integrate the check script into your rules:

~/.openclaw/workspace/skills/smart-model-switch/scripts/integrate-check.sh

Smart Model Switch Data Schema & Taxonomy

The skill organizes its logic and tracking through the following data structures:

Component Path Description
Model Rules config/model-rules.json Contains the mapping of complexity scores and file types to specific models.
State Tracker data/context-state.json Tracks context usage percentages and current model history.
Logic Scripts scripts/ Contains the JavaScript and Bash engines for complexity and file analysis.

Smart Model Switch Advanced Features

  • Context Monitoring: Real-time tracking of context window usage with automatic alerts and switching at 85% capacity.
  • Intelligent Cooldown: Prevents redundant switching by enforcing a 10-minute cooldown period after a model change.
  • Enhanced File Mapping: Pre-configured support for vision, code, document, and text extensions including .tsx, .mp4, and .docx.
  • Proactive Integration: Automatically checks for the best model before every AI response generation to ensure continuous optimization within Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*