model-router

model-router is a skill for Claude Code, Codex from ahkedia/lyra-ai. It costs 0 tokens per session (597 once invoked), scanned A, original, MIT.

A set of rules for choosing a model tier based on how difficult a task is, from simple lookups and reminders to complex analysis and planning.

In plain words
What is it for?
Use it to route greetings, reminders, Notion actions, emails, searches, multi-step work, strategy tasks, analysis, and synthesis requests.
Why use it?
It helps match each request with an appropriate model instead of using the same level of processing for every task.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: built for openclaw.

Good fit Use it to route greetings, reminders, Notion actions, emails, searches, multi-step work, strategy tasks, analysis, and synthesis requests.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/ahkedia/lyra-ai/model-router/github.svg)](https://agentmods.dev/skills/ahkedia/lyra-ai/model-router)
Your own site
<a href="https://agentmods.dev/skills/ahkedia/lyra-ai/model-router"><img src="https://agentmods.dev/badge/skills/ahkedia/lyra-ai/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/ahkedia/lyra-ai/model-router"><img src="https://agentmods.dev/badge/skills/ahkedia/lyra-ai/model-router.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 597 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 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.00000 $0.00597
Opus 5 $0.00000 $0.00298
Sonnet 5 $0.00000 $0.00119
Haiku 4.5 $0.00000 $0.00060

Measured 9d ago against content hash e2f29a89977f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 9d 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.

skills/model-router/SKILL.md · 62 lines

How it starts

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

Model Router Skill

Route incoming messages to the optimal model tier based on task complexity.

When to invoke

Before processing any user message, classify it using the routing rules.

Tiers

Tier Model When
minimax MiniMax M2.7 Single-action: Notion CRUD, reminders, weather, lookups, greetings
haiku Claude Haiku 4.5 Moderate: email, web search, multi-step, data formatting
sonnet Claude Sonnet 4.6 Complex: synthesis, strategy, analysis, long-form drafting, planning

Quick decision tree

Is it a greeting or acknowledgment? → minimax
Is it a single Notion read/write? → minimax
Is it a reminder or lookup? → minimax
Does it need email, search, or 2-3 steps? → haiku
Does it need reasoning across sources? → sonnet
Does it need strategic analysis? → sonnet
Does it need pattern-finding or synthesis? → sonnet
Unsure? → haiku (safe middle ground)

Escalation

To escalate to Sonnet: openclaw cron add --at +0m --model anthropic/claude-sonnet-4-6 --session isolated --announce --delete-after-run --name "sonnet-task" --message "<full task>". Do NOT attempt in MiniMax first.

To use Haiku: process using anthropic/claude-haiku-4-5.

Fallback behavior

If MiniMax API returns error (HTTP 400/429/500/timeout):

  1. Retry once after 3 seconds
  2. If still failing, auto-escalate to Haiku
  3. If Haiku also fails: "Both models are down. Try again in a few minutes."

If Notion API fails (5xx/timeout/rate limit):

  1. Tell user: "Notion is temporarily unreachable. Here's what I would have done: [action]. I'll retry."
  2. NEVER hallucinate success. Never say "Done" if the API call failed.
  3. For task creation: save intent, retry on next message.

Key rules

  1. Never attempt Sonnet tasks in MiniMax — route correctly from the start
  2. When in doubt, escalate — haiku is cheap, Sonnet is worth it for quality
  3. Override rules are absolute — "weekly review" always goes to Sonnet
  4. Log every decision — routing logs enable tuning over time

Read the full file on GitHub · 62 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. 9d ago First seen · 62 lines · 0 tokens per session scan A e2f29a89977f

Subscribe to this mod's changes

model-router is a skill published in the GitHub repository ahkedia/lyra-ai (5 stars, last pushed 20d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 597 tokens. 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-08-31.

Related

Other skills, from other repositories

groq-inference

Ultra-fast LLM inference on custom LPU hardware. OpenAI-compatible API at api.groq.com. Lowest latency in the industry (500-1000+ tok/s). Supports chat completions, vision, audio (Whisper STT + TTS), tool calling, JSON mode, and streaming. Free tier available. Inference only — no training.

synthetic-sciences/openscience · 77 tokens

rich-post

Send a Telegram rich-media post to ANOTHER allowlisted chat via the bot (Bot API 10.1 sendRichMessage) - text, inline images, tables, headings, lists, quotes, collapsible blocks, formulas, collages/slideshows ALL in one message bubble. Use when the owner asks to post somewhere other than the current conversation (the…

smixs/iva-agent · 129 tokens

telegram-userbot

A skill for connecting to and working through the owner's personal Telegram account, rather than a Telegram bot. It can read personal chats, search messages, and send messages as the account owner after setup and consent.

smixs/iva-agent · 144 tokens

memory-processor

Iva's daily-memory processor. Reads the day's two-sided transcript (daily/YYYY-MM-DD.md), distills noteworthy entities / decisions / ideas into typed autograph cards, links them into the graph, and produces a daily-summary card (topics + MOC) that navigates down to the raw transcript and up to the week. Model-agnostic…

smixs/iva-agent · 106 tokens

agent-browser

A command-line browser for interactive websites and web apps. It can open pages, inspect clickable elements, fill forms, click buttons, take screenshots, sign in, and read pages whose content is loaded by JavaScript.

smixs/iva-agent · 114 tokens

update-recovery

A procedure for recovering custom changes after an Iva software update creates conflicts between the old and new versions.

smixs/iva-agent · 60 tokens