SkillAgentSearch skills...

ai-model-router

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

Install / Use

npx skills add LeoYeAI/openclaw-master-skills --skill ai-model-router-v2

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

85/100

Category

Automation

Supported Platforms

Universal

Our assessment of ai-model-router

ai-model-router scores 85/100 on our quality scale, 1937th of 2,790 Automation skills we index.

Its SKILL.md is 3.2 KB long, well organised into 16 sections with 5 code examples: a solid amount of guidance for an agent.

With 2,149 GitHub stars, it is one of the more widely adopted skills in the catalogue.

Substance
26/30
Structure
20/20
Description
15/15
Adoption
14/20
Freshness
11/15

Maintenance, license and trust

  • The repository was last updated about 4 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
  • Our last check on 2026-11-04 found the source still online.
  • It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 98/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

Safety scan

No issues found

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.

AI review by kimi-k2.7-code on 2026-09-30. Automated pattern scan on 2026-09-30. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.

ai-model-router compared with similar skills

All 4 of these similar skills score higher than ai-model-router; compare them before choosing.

SkillScoreStarsUpdatedFormat
ai-model-router (this skill)by LeoYeAI852.1k4mo agoSKILL.md
taste-skillby Leonxlnx100116.8k8d agoCLAUDE.md
Agent-Reachby Panniantong100112.3k8d agoCLAUDE.md
rufloby ruvnet10081.9ktodayCLAUDE.md
headroomby headroomlabs-ai10079.8ktodayCLAUDE.md

Frequently asked questions

How do I install ai-model-router?
Run npx skills add LeoYeAI/openclaw-master-skills --skill ai-model-router. The install tabs above show the steps for each supported agent.
Which AI agents does ai-model-router work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is ai-model-router safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 98/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is ai-model-router still maintained?
The repository was last updated about 4 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.

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

# 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)

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

Threshold: 5 (simple vs complex)

Features

| Feature | Status | |---------|--------| | 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

# 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

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:

{
  "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)

Related Skills

View on GitHub
GitHub Stars2.1k
CategoryAutomation
Updated3mo ago
Forks325

Languages

Python

Trust signals

98/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

1 info
ai-model-router — Universal Skill: Install & Safety Check | SkillAgent