model-router

model-router is a skill for Claude Code from oyi77/1ai-skills. It costs 39 tokens per session (3,882 once invoked), scanned A, original, MIT.

A model router that chooses among several AI providers based on the task, cost, speed, capabilities, and provider availability.

In plain words
What is it for?
It helps route coding, vision, and other requests to suitable models and create fallback paths for more reliable AI services.
Why use it?
It avoids tying an application to one model provider and can provide alternatives when a provider is too expensive, slow, unsuitable, or unavailable.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Part of the 1ai-skills plugin — 209 skills, 4 commands shipped together

Good fit It helps route coding, vision, and other requests to suitable models and create fallback paths for more reliable AI services.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/oyi77/1ai-skills/model-router
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 oyi77/1ai-skills --skill model-router
Clone the repo
git clone --depth 1 https://github.com/oyi77/1ai-skills

Made for: Claude Code.

Or install 1ai-skills, the plugin that ships this one along with the rest of its 209 skills, 4 commands.

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 model-router

README.md
[![agentmods](https://agentmods.dev/badge/skills/oyi77/1ai-skills/model-router/github.svg)](https://agentmods.dev/skills/oyi77/1ai-skills/model-router)
Your own site
<a href="https://agentmods.dev/skills/oyi77/1ai-skills/model-router"><img src="https://agentmods.dev/badge/skills/oyi77/1ai-skills/model-router/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 model-router

Your own site · 80×15
<a href="https://agentmods.dev/skills/oyi77/1ai-skills/model-router"><img src="https://agentmods.dev/badge/skills/oyi77/1ai-skills/model-router.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,882 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found 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.00039 $0.03882
Opus 5 $0.00019 $0.01941
Sonnet 5 $0.00008 $0.00776
Haiku 4.5 $0.00004 $0.00388

Measured 7d ago against content hash 20aac3de7497, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

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 7d ago.

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.

core/model-router/SKILL.md · 301 lines

How it starts

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

Model Router

When to Use

Trigger phrases:

  • "model router"

  • "When managing multiple LLM providers (OpenAI, Anthropic, Google, etc"

  • "When optimizing for cost vs quality tradeoffs"

  • "When implementing fallback chains for reliability"

  • When managing multiple LLM providers (OpenAI, Anthropic, Google, etc.)

  • When optimizing for cost vs quality tradeoffs

  • When implementing fallback chains for reliability

  • When routing by task type (code to Claude, vision to Gemini, etc.)

When NOT to Use

  • For single-provider setups (just use that provider SDK)
  • For local-only inference (use Ollama skills)

Overview

Model routing is the intelligence layer between your application and the diverse landscape of large language model providers. Rather than hardcoding a single provider, a model router evaluates each request against dynamic criteria — task type, required capability, latency budget, cost ceiling, and current provider health — to select the optimal model at runtime. This transforms LLM integration from brittle point-to-point connections into a resilient, cost-aware system.

The core problem routing solves is that no single model dominates every dimension. Claude excels at code generation and structured reasoning, GPT-4o handles creative writing and multimodal tasks, Gemini-2.5-flash delivers the lowest latency for high-throughput workloads, and open-source models offer cost advantages for batch processing. Without routing, teams either overspend on premium models for trivial tasks or degrade quality by using cheap models everywhere. A router captures these trade-offs as programmable rules.

Production-grade routers implement three layers: static routing (model-per-task mapping), dynamic routing (cost/latency-aware selection with real-time metrics), and fallback chains (primary → secondary → tertiary on failure). Each layer adds resilience. When OpenAI experiences an outage, traffic shifts to Anthropic. When latency spikes on Claude, the router demotes it in favor of Gemini without any developer intervention.

Read the full file on GitHub · 301 lines

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. 7d ago First seen · 301 lines · 39 tokens per session scan A 20aac3de7497

Subscribe to this mod's changes

model-router is a skill published in the GitHub repository oyi77/1ai-skills (12 stars, last pushed today), licensed MIT. It adds 39 tokens to every session and 3,882 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

model-strategy

Multi-model orchestration and model-switching strategy. Score-based model selection, reasoning-effort routing, cross-agent delegation (Gemini, Codex, Ollama), advisor pairing, escalation triggers, permission matrix, and cost-efficiency optimization.

ellmos-ai/skills · 52 tokens

lynkr

Universal LLM gateway with intelligent routing, Graphify code intelligence, Distill compression, routing telemetry, Code Mode, and 12+ provider support. 60-80% cost reduction for Claude Code, Cursor, and Codex.

Fast-Editor/Lynkr · 50 tokens

skypilot-multi-cloud-orchestration

Multi-cloud orchestration for ML workloads with automatic cost optimization. Use when you need to run training or batch jobs across multiple clouds, leverage spot instances with auto-recovery, or optimize GPU costs across providers.

synthetic-sciences/openscience · 51 tokens

data-leakage-detection

Detect sensitive information disclosure via escalating dialogue probes. Covers system prompt extraction, credential/API key leakage, PII, and internal configuration exposure.

Tencent/AI-Infra-Guard · 34 tokens

human-agent-trust-exploit-detection

Detect social engineering, deceptive responses, false assurances, or prompts that induce unsafe user actions.

Tencent/AI-Infra-Guard · 27 tokens

pyhealth

Comprehensive healthcare AI toolkit for developing, testing, and deploying machine learning models with clinical data. This skill should be used when working with electronic health records (EHR), clinical prediction tasks (mortality, readmission, drug recommendation), medical coding systems (ICD, NDC, ATC)…

synthetic-sciences/openscience · 109 tokens