ai-model-router

ai-model-router is a skill for Claude Code, Codex from LeoYeAI/openclaw-master-skills. It costs 0 tokens per session (794 once invoked), scanned A, a copy of ai-model-router, MIT.

A skill for automatically selecting between configured local and cloud AI models according to task complexity and privacy. It detects local models such as Ollama and LM Studio and provides a command-line interface.

In plain words
What is it for?
Use it to route AI requests, inspect available models, and configure model selection for simple, complex, or sensitive tasks.
Why use it?
It removes repeated model-selection decisions and can keep requests containing private information on a local model.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to route AI requests, inspect available models, and configure model selection for simple, complex, or sensitive tasks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/leoyeai/openclaw-master-skills/skill
About the project

OpenClaw Master Skills is a curated, regularly updated collection of skills that extends an AI personal assistant platform with capabilities such as research, browser automation, presentation creation, and prompt work. It is intended for people using OpenClaw or MyClaw.ai to give their agents additional tasks and workflows. The catalogue contains many skills and agents from this collection.

LeoYeAI/openclaw-master-skills · 2,168 stars · on GitHub · myclaw.ai

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add LeoYeAI/openclaw-master-skills --skill skill
Clone the repo
git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-model-router

README.md
[![agentmods](https://agentmods.dev/badge/skills/leoyeai/openclaw-master-skills/skill/github.svg)](https://agentmods.dev/skills/leoyeai/openclaw-master-skills/skill)
Your own site
<a href="https://agentmods.dev/skills/leoyeai/openclaw-master-skills/skill"><img src="https://agentmods.dev/badge/skills/leoyeai/openclaw-master-skills/skill/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ai-model-router

Your own site · 80×15
<a href="https://agentmods.dev/skills/leoyeai/openclaw-master-skills/skill"><img src="https://agentmods.dev/badge/skills/leoyeai/openclaw-master-skills/skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 794 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00794
Opus 5.5 $0.00000 $0.00318
Sonnet 5.5 $0.00000 $0.00159
Haiku 4.5 $0.00000 $0.00079

Measured 2mo ago against content hash 1c03995ca5ae, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ai-model-router scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

The scan reads SKILL.md. This mod also ships 3 executable files (core/router.py, modules/context.py, modules/detector.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to ai-model-router — 2 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/ai-model-router-v2/skill/SKILL.md · 120 lines

How it starts

The opening of the file, as written. The whole thing — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

Read the full file on GitHub · 120 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 120 lines · 0 tokens per session scan A 1c03995ca5ae

Subscribe to this mod's changes

ai-model-router is a skill published in the GitHub repository LeoYeAI/openclaw-master-skills (2,168 stars, last pushed 6d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 794 tokens. A static security scan graded it A with 0 findings. It is 100% identical to ai-model-router, differing in 2 lines, and is treated as a copy.

Related

ai-model-router compared with skills from other repositories

ai-model-router next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ai-model-routerLeoYeAI/openclaw-master-skillsSkill2.2k6d agoMITA0Claude Code, Codex
pentest-api-deepjd-opensource/JoySafeterSkill31517d agoApache-2.0A43Claude Code, Codex
agent-forgeAlekseiUL/agentforge-openclawSkill448d agoMITA111Claude Code, Codex
investlongsizhuo/openInvestSkill139yesterdayMITB280Claude Code
aeonagent-skills-hub/agent-skills-hubSkill1281mo agoMITA74Claude Code, Codex
halo-cli-shophalo-dev/cliSkill303d agoMITA78Claude Code, Codex
halo-cli-moderation-notificationshalo-dev/cliSkill303d agoMITA57Claude Code, Codex