Picks a model for each subagent, judged by Jev on TypeSafe or OpenRouter. For Claude Code and Oh My Pi.
| Claude Code | Oh My Pi | |
|---|---|---|
| Routes | Under core, Agent tool calls to the four built-in agents. Under extended, every Agent call that passes no model and no name, except a fork (details) |
Under core, task batch items. Under extended, every batch item whose agent's model you did not set, except seance and the item reasons |
| Sets | model and effort |
the smol or slow role |
| Asks Jev | two questions | one question |
| Needs | Claude Code v2.1.308 or later | Oh My Pi v18.12.6 or later |
| Keys live in | the system's secure storage, or TYPESAFE_API_KEY and OPENROUTER_API_KEY |
omp's TypeSafe and OpenRouter credentials, or TYPESAFE_API_KEY and OPENROUTER_API_KEY |
| Provider is set in | the install dialog, /config, /model-router:provider or the config tool |
/settings → Plugins, /model-router:provider or the model_router_config tool |
| Scope | core (default) or extended. Set in the install dialog, /config or /model-router:scope |
core (default) or extended. Set in /settings → Plugins or /model-router:scope. A project may set it |
| Reference | plugin README | plugin README |
Install · Verify · Update · Turn off and uninstall · What leaves the machine
How it works
Claude Code. On each Agent tool call it routes, the plugin asks
Jev two questions: how much judgment and how much
work the task needs. Jev reads the task and the agent's description. Then the
plugin sets the call's model and effort. The model is haiku for lookup or
transcription, sonnet for bounded judgment and opus for open judgment.
Effort shows the effort ladder.
model-choice.md says why the
tiers and the ladder are what they are, with Anthropic's sources.
The scope option picks the calls. Which calls are routed
holds the rules.
Oh My Pi. The plugin scores each batch item with Jev, which answers one
question: how much judgment the task needs. Jev reads the task and the agent's
description. For lookup work the plugin gives the spawn the smol role. For
open judgment it gives the slow role. For bounded judgment it changes
nothing. It sets no effort and never changes the tool input. The roles run on
the models you point smol and slow at.
The scope setting picks the agents. Scope
holds the rules.
Install
You need:
- Claude Code v2.1.308 or later, or Oh My Pi v18.12.6 or later.
- A TypeSafe API key from https://console.typesafe.ai/keys, an OpenRouter API key from https://openrouter.ai/settings/keys, or both.
- For Claude Code, the
claudecommand-line tool. Everyclaude pluginline on this page runs in a shell, whichever app you use.
The provider option picks who scores each task: typesafe (the default),
openrouter, auto (TypeSafe, then OpenRouter) or openrouter-first
(OpenRouter, then TypeSafe). With one key, auto and openrouter-first use
that key's provider alone. The Claude Code
and Oh My Pi READMEs say when the second
provider takes over. The scope option picks the agents the plugin routes:
core (the default) or extended.
Claude Code
Terminal
-
Run this line in a Claude Code session:
/plugin install model-router --marketplace Akurganow/model-router -
Answer
yto add the marketplace. -
Pick the user scope.
-
Pick a
providerand ascopein the dialog. -
Paste your TypeSafe key, your OpenRouter key or both into the dialog.
-
Run
/reload-plugins, or start a new session. -
Ask Claude to run the
model-router-setupskill. It asks the provider and the scope with buttons, writes your choices itself and checks the keys.
To reopen the dialog later, run
/plugin configure model-router@model-router. /config also changes the
options. /model-router:provider and /model-router:scope change one each.
Claude Code keeps the keys in the system's secure storage.
Install from a shell. This line installs the plugin, sets provider to
auto and saves the keys. It shows TypeSafe key:, then OpenRouter key:.
It reads each key you paste without showing it. Press Enter at a prompt to
skip a key you do not have. Only the line goes to the shell history, never a
key. The line is for zsh, the default shell on macOS.
claude plugin install model-router --marketplace Akurganow/model-router && read -rs 'TS_KEY?TypeSafe key: ' && echo && read -rs 'OR_KEY?OpenRouter key: ' && echo && printf '{"provider":"auto","api_key":"%s","openrouter_api_key":"%s"}' "$TS_KEY" "$OR_KEY" | claude plugin configure model-router@model-router --values-stdin
To pick another provider, replace auto in the line. In bash, replace
read -rs 'TS_KEY?TypeSafe key: ' with read -rsp 'TypeSafe key: ' TS_KEY.
Replace read -rs 'OR_KEY?OpenRouter key: ' with
read -rsp 'OpenRouter key: ' OR_KEY. Look for these two lines in the output:
Successfully installed plugin
Configuration saved. Restart Claude Code to apply it.
Then run /reload-plugins in each open session, or start a new one. The
plugin reads the key when it loads.
Other shells, PowerShell included
Run this line in place of the one above:
claude plugin install model-router --marketplace Akurganow/model-router --config provider=auto --config api_key=YOUR_KEY --config openrouter_api_key=YOUR_OPENROUTER_KEY
YOUR_KEY stands for your TypeSafe key and YOUR_OPENROUTER_KEY for your
OpenRouter key. Drop the --config pair of a key you do not have. The line
leaves the keys in your shell history and shows them in the process list
while it runs.
VS Code
- Run
/pluginsto open Manage plugins. - Add
Akurganow/model-routeron the Marketplaces tab. - Install
model-routeron the Plugins tab. - Pick a
providerand ascopein the form that opens. - Enter your TypeSafe key, your OpenRouter key or both.
- Start a new session.
The gear icon on the plugin's row opens the form again. If the form does not open, set the key as Desktop app describes.
Desktop app
- Open a local session.
- Choose +, then Add plugins.
- Add the marketplace
Akurganow/model-router. - Install
model-router.
Warning
The desktop app cannot set a plugin's key yet. Keys in the desktop app says how to set it in the settings file.
Oh My Pi
-
Install Oh My Pi v18.12.6 or later.
-
Add the marketplace:
omp plugin marketplace add Akurganow/model-router -
Install the plugin:
omp plugin install model-router@model-router -
Restart omp, because omp loads extension modules at startup.
-
Run
/login typesafe,/login openrouteror both in omp to store your keys. -
Ask omp to run the
model-router-setupskill. It asks the provider, the keys and the scope with buttons and writes your choices itself.
Instead of /login, you can run omp login typesafe or
omp login openrouter outside a session. You can also set TYPESAFE_API_KEY
or OPENROUTER_API_KEY. To change the provider or the scope later, open
/settings → Plugins, or run /model-router:provider or
/model-router:scope.
Set up says what the skill checks.
Verify
Claude Code. Send this prompt in a new session:
Use the Agent tool with the general-purpose agent, and no model or name, to list the files in this folder.
The plugin then logs one line for the routed call, like this example:
model-router L0 haiku · medium · p=0.91/0.62 · jev jev-1.14.0 · 812/9 tok
This README has not checked where VS Code or the desktop app shows the line.
If the line says skipped, <cause>, or no line appears, see
Troubleshooting.
Oh My Pi. Give omp any job that makes it spawn a task subagent. The
plugin prints one line per batch, like this example:
model-router task 1: L0 @smol · p=0.91 | task 2: L1 no change · p=0.62 | task 3: skipped, timeout
Gate reasons and
Item reasons explain each
skipped entry. No line prints when task.batch is off or the batch has no
eligible item.
Update
Claude Code. Claude Code turns auto-update off by default for a
third-party marketplace like this one. To turn it on, choose
Enable auto-update for the marketplace on the Marketplaces tab of
/plugin. To update by hand, run these lines in a shell:
claude plugin marketplace update model-router
claude plugin update model-router@model-router
Then run /reload-plugins in each open session, or start a new one.
Oh My Pi. Run these lines in a shell:
omp plugin marketplace update
omp plugin upgrade model-router@model-router
Then restart omp.
Turn off and uninstall
Claude Code. To turn routing off, disable the plugin in /plugin. The
plugin sends nothing while it is disabled. To remove it, run this line in a
shell:
claude plugin uninstall model-router@model-router
If you added TYPESAFE_API_KEY or OPENROUTER_API_KEY to the env block of
~/.claude/settings.json, delete those lines too.
Oh My Pi. To turn routing off, run this line in a shell:
omp plugin disable model-router@model-router
Then restart omp. The plugin sends nothing while it is disabled. To remove it, run this line:
omp plugin uninstall model-router@model-router
What leaves the machine
Important
Each call or batch item the plugin scores sends the condensed, redacted task text to the host that
providerpicks, with that host's key:
https://api.typesafe.ai/v1/systemonegets your TypeSafe key undertypesafe, and first underauto.https://openrouter.ai/api/v1/systemonegets your OpenRouter key underopenrouter, and first underopenrouter-first.With both keys,
autoandopenrouter-firstsend the same text to the second host when the first fails. The default,typesafe, never contacts OpenRouter.Each request also carries the agent's description. Under
extended, the descriptions and task text of your other agents leave the machine too.
Each plugin README lists the full request, and each privacy policy states the same in policy form:
- Claude Code: What leaves the machine, PRIVACY.md
- Oh My Pi: What leaves the machine, PRIVACY.md, The extended scope
Turn off and uninstall says how to stop the requests.
Documentation
- Claude Code plugin README: what the plugin can reach, routing, the effort ladder and troubleshooting.
- Oh My Pi plugin README: the key, the setup skill, routing and the skip reasons.
- model-choice.md: why the model tiers and the effort ladder are what they are.
- Claude Code privacy policy
- Oh My Pi privacy policy
Contributing
CONTRIBUTING.md covers the repository layout, the build,
the checks, the commit rules and calibration against either provider, with
node scripts/calibrate.ts <typesafe|openrouter> [model].
Support
Questions and bug reports go to https://github.com/Akurganow/model-router/issues.
License
MIT, as LICENSE states.
