Smart Router for Openclaw

An intelligent multi-model router that automatically selects the optimal AI model for any task using @alias shortcuts or auto-classification.

samstone908
v1.0.0
Feb 25, 2026
0
1.2k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install smart-models

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-models 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 Router?

The Smart Router is a sophisticated orchestration tool designed to enhance Openclaw Skills by providing a unified interface for over 35+ AI models across 7 distinct categories. Instead of being locked into a single provider or model, this skill intelligently evaluates incoming requests—whether they involve complex reasoning, image generation, or code debugging—and routes them to the most capable endpoint.

By leveraging any OpenAI-compatible API, the Smart Router ensures high availability and cost-efficiency. It acts as a middleware layer for your AI agent, allowing it to switch seamlessly between specialized models like GPT-4o for vision, Sora for video, or DeepSeek for reasoning without requiring manual configuration for every prompt.

Smart Router Use Cases

  • Analyzing and describing images or performing OCR via vision-capable models.
  • Generating high-fidelity images, videos, or audio assets based on text prompts.
  • Solving complex mathematical proofs or logic puzzles requiring deep reasoning chains.
  • Developing and debugging code using specialized programming LLMs.
  • Streamlining daily productivity tasks with general-purpose chat models within Openclaw Skills.

How Smart Router Works

  1. The skill receives a prompt and checks for a specific @alias prefix, such as @o3 for reasoning or @flux for image generation.
  2. If no alias is present, the system applies auto-classification rules to detect the task type based on the content of the message.
  3. The router consults the models.json configuration to identify the default model for the detected category.
  4. It executes a bash script to call the selected model via a configured OpenAI-compatible API endpoint.
  5. In the event of a model call failure, the system automatically falls back to the next available model in the same category to ensure continuity.

Smart Router Setup

To integrate this into your Openclaw Skills environment, you must configure your API credentials and provider details.

Set the following environment variables in your terminal or configuration file:

export SMART_ROUTER_BASE_URL="https://api.openai.com/v1"
export SMART_ROUTER_API_KEY="your_api_key_here"

You can customize your model selection by editing the models.json file. To discover new models provided by your API, run the sync script:

scripts/sync-models.sh

Smart Router Data Schema & Taxonomy

The Smart Router manages its logic through a structured configuration file and environment variables.

Data Component Description
models.json The primary configuration file defining categories, model IDs, and default flags.
@alias Table A mapping of short commands to specific model IDs for instant manual routing.
API Meta Uses OpenAI-compatible endpoints to standardize requests across different providers.
Task Types Categorizes requests into chat, image, async, or tts for specific handling.

Smart Router Advanced Features

  • Intelligent auto-classification that detects intent for vision, coding, reasoning, and media tasks.
  • Extensive @alias library supporting over 35+ specialized models for power-user control.
  • Robust fallback logic that automatically retries failed requests using alternative models in the same category.
  • Support for asynchronous workflows, enabling long-running video and audio generation tasks without blocking Openclaw Skills.
  • Fully customizable model taxonomy via models.json, allowing for the addition of new providers and experimental LLMs.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*