Agent skill

AI Model Router

by LeoYeAI in LeoYeAI/openclaw-master-skills

Intelligent AI model router that automatically switches between two configured models (local for simple tasks, cloud for complex ones).

MITAuto-check passedAI & LLM Engineering

Install AI Model Router

skills CLI
$ npx skills add LeoYeAI/openclaw-master-skills --skill ai-model-router -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install LeoYeAI/openclaw-master-skills ai-model-router --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/ai-model-router .claude/skills/ai-model-router && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ai-model-router
GitHub stars
2.2k
Token cost
~811 tokens
SKILL.md length
156 words
Files
7
Skills in repo
1,235
Repo updated
First seen
Licence
MIT

At a glance

Intelligent AI model router that automatically switches between two configured models (local for simple tasks, cloud for complex ones).

  • Users ask to switch model
  • SKILL.md covers Quick Start, How It Works, Scoring (from… and Features, plus 6 more sections
  • Runs Python scripts from its folder; calls python3 and npx
  • Use local/cloud model

What it does

AI Model Router is an agent skill from LeoYeAI/openclaw-master-skills. Intelligent AI model router that automatically switches between two configured models (local for simple tasks, cloud for complex ones). Detects local models (Ollama, LM Studio) automatically, routes based on task complexity and privacy. Use when users ask to "switch model", "use local/cloud model", or mention API keys/passwords (triggers privacy mode). Trigger on: sensitive data detection (forces local), complex tasks like "design architecture" (uses cloud), or configuration requests.

Its SKILL.md is about 810 tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files (for example `.clawhub/origin.json`, `_meta.json` and `package.json`).

It sits in AI & LLM Engineering, covering Model routing and gateways and LLM inference and serving. It works with Ollama. The repository describes itself as: 🧠 Curated collection of 1209+ best OpenClaw skills — weekly updated by MyClaw.ai. The licence is MIT.

When your agent uses it

  • Users ask to switch model
  • Use local/cloud model
  • Mention API keys/passwords (triggers privacy mode)
  • : sensitive data detection (forces local)

Example prompts

  • “switch model”
  • “use local/cloud model”
  • “design architecture”
  • “/ai-model-router”

Requirements

  • Python 3
  • Node.js

What it can do on your machine

Read from SKILL.md and the folder at commit e5199b5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

AI Model Router loads about 811 tokens when it runs. Until then it costs about 126 tokens; SKILL.md has 156 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~126
When it runs · the whole SKILL.md, loaded when a task matches
~811

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from LeoYeAI/openclaw-master-skills at commit e5199b5, republished under its MIT licence (© LeoYeAI). 156 words, ~811 tokens.

Download SKILL.mdSave it as .claude/skills/ai-model-router/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
ai-model-router
description
Intelligent AI model router that automatically switches between two configured models (local for simple tasks, cloud for complex ones). Detects local models (Ollama, LM Studio) automatically, routes based on task complexity and privacy. Use when users ask to "switch model", "use local/cloud model", or mention API keys/passwords (triggers privacy mode). Trigger on: sensitive data detection (forces local), complex tasks like "design architecture" (uses cloud), or configuration requests.
version
1.0.0

AI Model Router

Compact, intelligent model routing that just works.

Quick Start

bash
# Install
npx clawhub@latest install ai-model-router

# First run - auto-detects your models
python3 skill/core/router.py "What is Python?"

# List available models
python3 skill/core/router.py --list

How It Works

Your Request → Analyze → Select Model
                          ↓
                    Simple? → Primary (fast/cheap)
                    Complex? → Secondary (capable)
                    Private? → Primary (forced)

Scoring (from model-router-premium)

PatternPoints
Microservices, architecture+10
Design, implement, optimize+5
Explain, analyze, compare+3
Syntax, example, "what is"-3

Threshold: 5 (simple vs complex)

Features

FeatureStatus
Auto-detect local models✓ (Ollama, LM Studio)
Cloud model registry✓ (7 built-in)
Privacy detection✓ (API keys, passwords)
Context tracking✓ (conversations)
JSON config✓ (optional)
CLI interface✓
Core code size~200 lines

CLI

bash
# Route a task
python3 skill/core/router.py "Design a system"
python3 skill/core/router.py "What is a for loop?"

# Options
--json                    # JSON output
--force primary           # Force primary model
--list                    # List all models
--status                  # Show status

Python API

python
from skill.core.router import RouterCore

router = RouterCore()
result = router.route("Design microservices")

print(result.model_name)   # "Claude Opus 4"
print(result.reason)        # "complex_task(score=15)"
print(result.confidence)    # 0.75

Configuration (Optional)

Create ~/.model-router/models.json:

json
{
  "primary_model": {"id": "ollama:llama3:8b"},
  "secondary_model": {"id": "anthropic:claude-opus-4"},
  "models": [...]
}

Without config: Auto-detects local + uses cloud registry.

Privacy Protection

Automatically forces primary (local) when sensitive data detected:

  • API keys (sk-..., api_key)
  • Passwords (password, passwd)
  • Tokens (bearer, secret)
  • Emails, SSN, credit cards

Files

  • core/router.py - Core routing engine (~200 lines)
  • modules/detector.py - Auto-detection (optional)
  • modules/context.py - Context tracking (optional)

Inspired By

  • model-router-premium: Simple scoring logic, cost-aware routing
  • Model Router v1: Full feature set, documentation

This version combines:

  • The simplicity of model-router-premium (~200 lines)
  • The features of ai-model-router (privacy, auto-detect, context)

© LeoYeAI, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files in skills/ai-model-router of LeoYeAI/openclaw-master-skills.

  • SKILL.md
  • .clawhub/origin.json
  • _meta.json
  • package.json
  • skill/context.py
  • skill/detector.py
  • skill/router.py

Open the folder on GitHubat commit e5199b5

Compare with similar skills

AI Model Router next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

AI Model Router compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
AI Model Router this skillLeoYeAI/openclaw-master-skills2.2k—~811Automated safety check: PassMIT
New Providerfinch-xu/cc-router277—~1.6kAutomated safety check: PassMIT
Configuring Visionoxbshw/watch-skill470—~509Automated safety check: NotesMIT
QuorumDetrol/quorum-cli119—~807Automated safety check: NotesCustom licence
NanoClaw Ollama Providernanocoai/nanoclaw31k—~1.5kAutomated safety check: PassMIT
Local LLM Routerhoodini/ai-agents-skills282—~20kAutomated safety check: PassNone

Similar skills

  • New Provider

    finch-xu/cc-router

    用于在 cc-router 仓库新增一个 LLM provider(即在 src-tauri/providers/ 下添加 YAML 描述符并完成配套的同步改动)。当用户说「加 provider」「接入 XX 厂商」「新增订阅源」「provider YAML」「让 cc-router 支持 OpenRouter/Together/Groq/Ollama 之类」时必须触发本…

    277 GitHub stars~1.6k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Configuring Vision

    oxbshw/watch-skill

    The user wants to connect an LLM or vision provider, already has an API key, asks "can I use OpenAI/Anthropic/Gemini/OpenRouter", wants local Ollama, or needs different cheap and strong models.

    470 GitHub stars~509 tokensUpdated 26 days ago
    AI & LLM EngineeringAuto-check: notes
  • Quorum

    Detrol/quorum-cli

    Run a structured debate between agent CLIs (claude, codex, agy, grok) and the user's configured API or local models (OpenAI, Anthropic, Google, xAI, OpenRouter, Ollama and more) through the Quorum…

    119 GitHub stars~807 tokensUpdated 14 days ago
    AI & LLM EngineeringAuto-check: notes
  • NanoClaw Ollama Provider

    nanocoai/nanoclaw

    Routes a NanoClaw agent group to a local Ollama model instead of the Anthropic API, using environment overrides and an optional block on Anthropic hosts.

    31k GitHub stars~1.5k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Local LLM Router

    hoodini/ai-agents-skills

    Route AI coding queries to local LLMs in air-gapped networks.

    282 GitHub stars~20k tokensUpdated 3 mo ago
    AI & LLM EngineeringAuto-check passed
  • Claudish Usage

    MadAppGang/claudish

    CRITICAL - Guide for using Claudish CLI ONLY through sub-agents to run Claude Code with any AI model (OpenRouter, Gemini, OpenAI, local models).

    1k GitHub stars~9k tokensUpdated 4 days ago
    Agent WorkflowsAuto-check passed

More from LeoYeAI/openclaw-master-skills

All 1,200 skills in this repo
  • DevOps Pipeline Management

    LeoYeAI/openclaw-master-skills

    Manages pipelines on a DevOps quality and efficiency platform through its OpenAPI: list workspaces and templates, create, update, run and cancel pipelines, and read run records.

    2.2k GitHub stars~4.2k tokensUpdated 2 mo ago
    Auto-check: notes
  • Feishu Document Collaboration

    LeoYeAI/openclaw-master-skills

    Patches OpenClaw's Feishu extension so an edited document triggers an isolated agent session that reads the doc and replies inline, turning it into a live chat space.

    2.2k GitHub stars~2k tokensUpdated 2 mo ago
    Auto-check passed
  • Files Memory System

    LeoYeAI/openclaw-master-skills

    Multi-context memory management system for OpenClaw agents with group-isolated storage, global shared memory, workspace organization, and group-specific skills isolation.

    2.2k GitHub stars~3.8k tokensUpdated 2 mo ago
    Auto-check passed
  • GEO-Claw AI Visibility Agent

    LeoYeAI/openclaw-master-skills

    Runs a brand's AI-search visibility work end to end: diagnosing how AI platforms represent it, repositioning it, producing AI-optimized content and monitoring ongoing mentions.

    2.2k GitHub stars~4.7k tokensUpdated 2 mo ago
    Auto-check passed
  • Google Workspace CLI

    LeoYeAI/openclaw-master-skills

    Installs and authenticates the gws CLI, then automates Gmail, Drive, Sheets, Calendar, Docs, Chat and Tasks with ready-made recipes, persona bundles and security audits.

    2.2k GitHub stars~2.6k tokensUpdated 2 mo ago
    Auto-check: notes
  • HealthFit Health Advisors

    LeoYeAI/openclaw-master-skills

    Runs four advisor roles, a fitness coach, nutritionist, data analyst and TCM practitioner, to build a health profile and track workouts, diet and wellness over time.

    2.2k GitHub stars~4.4k tokensUpdated 2 mo ago
    Auto-check passed

Works with

Questions about AI Model Router

What does AI Model Router do?

Intelligent AI model router that automatically switches between two configured models (local for simple tasks, cloud for complex ones). AI Model Router is an agent skill from LeoYeAI/openclaw-master-skills. Intelligent AI model router that automatically switches between two configured models (local for simple tasks, cloud for complex ones).

When should I use AI Model Router?

AI Model Router fits situations like: users ask to switch model; use local/cloud model; mention API keys/passwords (triggers privacy mode); : sensitive data detection (forces local).

How do I install AI Model Router in Claude Code?

Run `npx skills add LeoYeAI/openclaw-master-skills --skill ai-model-router -a claude-code`. Or copy the skill folder (skills/ai-model-router in LeoYeAI/openclaw-master-skills) into .claude/skills/ai-model-router in your project. Claude Code loads it when a task matches its description.

How do I install AI Model Router in Codex?

Run `npx skills add LeoYeAI/openclaw-master-skills --skill ai-model-router -a codex`. Or copy the skill folder (skills/ai-model-router in LeoYeAI/openclaw-master-skills) into .agents/skills/ai-model-router in your project. Codex loads it when a task matches its description.

Can I use AI Model Router in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add LeoYeAI/openclaw-master-skills --skill ai-model-router -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ai-model-router, .gemini/skills/ai-model-router, .github/skills/ai-model-router and .opencode/skills/ai-model-router in your project.

What does AI Model Router need to run?

Going by SKILL.md and its folder, AI Model Router needs Python for the scripts in its folder and the command-line tools its instructions call (python3 and npx). Our summary lists: Python 3; Node.js.

Does AI Model Router access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is AI Model Router safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does AI Model Router use?

AI Model Router is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does AI Model Router use?

About 811 tokens (SKILL.md is roughly 3.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to AI Model Router?

Skills that share tags, products or a category with AI Model Router: New Provider (finch-xu/cc-router, 277 stars), Configuring Vision (oxbshw/watch-skill, 470 stars), Quorum (Detrol/quorum-cli, 119 stars) and NanoClaw Ollama Provider (nanocoai/nanoclaw, 31k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains AI Model Router?

LeoYeAI (a GitHub user) maintains it in LeoYeAI/openclaw-master-skills, which has 2,161 GitHub stars. The repository holds 1,235 skills in this directory. The repository was last updated on July 20, 2026.

Source: LeoYeAI/openclaw-master-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.