Smart Router for Openclaw

An automated model selection engine that routes AI requests based on complexity analysis and budget constraints to maximize cost efficiency.

atlaspa
v1.0.0
Feb 13, 2026
0
1.9k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install openclaw-smart-router

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 openclaw-smart-router 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 powerful addition to the ecosystem of Openclaw Skills, designed to eliminate wasteful spending on high-end LLMs for trivial tasks. By acting as an intelligent middleware, it intercepts every request and performs a real-time complexity analysis, scoring tasks from 0.0 to 1.0. This allows the system to intelligently route simple requests to lightweight models like Haiku or GPT-3.5, while reserving premium models like Opus or GPT-4 for expert-level reasoning and complex debugging.

Beyond simple routing, this skill incorporates a sophisticated pattern learning engine that adapts to your specific development style. It tracks which models successfully resolve specific types of tasks—such as refactoring or unit testing—and refines its selection logic over time. For developers looking to scale their AI-driven workflows, the Smart Router provides a transparent way to manage budgets, track ROI, and ensure peak performance without manual intervention.

Smart Router Use Cases

  • Automatically reduce LLM API expenditures by 30-50% without sacrificing quality.
  • Implement autonomous budget-aware routing to prevent unexpected overages during heavy development.
  • Transition from manual model selection to an automated, data-driven workflow.
  • Optimize agent performance by leveraging pattern learning to match tasks with the most successful models.
  • Monitor real-time cost savings and model distribution via a local web dashboard.

How Smart Router Works

  1. Intercepts the request by hooking into the OpenClaw API lifecycle before the call is sent to a provider.
  2. Performs a complexity analysis by evaluating context length, code presence, and task specificity.
  3. Checks the user-defined budget and daily spending limits to ensure the request is within financial bounds.
  4. Selects the optimal model based on the complexity score (e.g., Simple tasks go to Haiku, Expert tasks go to Opus).
  5. Routes the request to the selected provider (Anthropic, OpenAI, Google, etc.) and executes the task.
  6. Learns from the output by tracking success rates and updating internal routing patterns for future requests.

Smart Router Setup

To install the Smart Router and start optimizing your Openclaw Skills workflow, use the following command:

claw skill install openclaw-smart-router

You can then view your routing statistics or open the local management dashboard:

# View current routing and savings stats
claw router stats

# Open the analytics dashboard
claw router dashboard

Smart Router Data Schema & Taxonomy

The skill maintains a local-first data architecture to protect privacy and minimize latency. All data is stored in the ~/.openclaw/openclaw-smart-router/ directory.

Component Data Type Purpose
history.json Log Stores every routing decision, complexity score, and associated cost.
patterns.db Database Contains learned associations between task types and model success rates.
config.json Settings Defines budget limits, preferred providers, and scoring thresholds.
stats/ Analytics Pre-computed ROI and model distribution metrics for the dashboard.

Smart Router Advanced Features

  • Autonomous x402 Payments: Enables agents to self-fund a Pro subscription if the projected savings exceed the 0.5 USDT/month cost.
  • Multi-Provider Load Balancing: Seamlessly switches between Anthropic, OpenAI, and Google Gemini based on real-time availability and cost.
  • Deep Pattern Learning: Identifies specific task signatures, such as 'Python debugging', to prioritize models that have historically performed best.
  • Efficiency Suite Integration: Combines with the Context Optimizer and Memory System to achieve a total cost reduction of up to 80%.
  • Local Web Dashboard: Provides a comprehensive UI at http://localhost:9093 for tracking complexity distribution and model performance.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Requires
Bins node
Github Stars: 0
forks: 0

Featured*