Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By NodeNestorv0.4.3MITIn 1 marketplace
Add custom models to Claude Code's /model picker. A local proxy routes each configured model to whatever backend you name — local vLLM, Ollama, LM Studio, OpenRouter, a second Anthropic key — while every other model passes through untouched, subscription auth included.
You run one by typing its /name in Claude Code.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Add your own models to Claude Code's /model picker.
A small local proxy sits in front of the Anthropic endpoint. Models you declare in a JSON config are routed to whatever backend you name — a local vLLM or llama.cpp server, Ollama, LM Studio, OpenRouter, a second Anthropic key — and translated into that backend's wire format. Every other model passes through byte-for-byte, Authorization header included, so your Claude subscription keeps working exactly as before.
/model
● Opus 5 (passthrough → api.anthropic.com)
Sonnet 5 (passthrough → api.anthropic.com)
Qwen3 27B Q8 (llama.cpp) From gateway (→ http://127.0.0.1:8080/v1)
gpt-oss 20B (Ollama) From gateway (→ http://127.0.0.1:11434/v1)
Kimi K2 (OpenRouter) From gateway (→ https://openrouter.ai/api/v1)
Run one session on a local model and the next on the real thing, switching with
/model like any other entry.
Stdlib Python only. No dependencies, no build step.
Claude Code builds its model picker in Hcb(), and one of the sources it
merges in is a list of gateway models. That path is gated by:
function M1s(){
if(!q.CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY) return !1;
if(Yn()!=="firstParty") return !1; // not bedrock / vertex / foundry
if(Mf()) return !1; // ANTHROPIC_BASE_URL must not be api.anthropic.com
if(!q.ANTHROPIC_BASE_URL) return !1;
return !0
}
When those hold, the picker reads ~/.claude/cache/gateway-models.json and adds
every entry to the list, labelled From gateway. The router writes that file
directly rather than waiting for Claude Code's own discovery fetch, because the
built-in fetch bails unless ANTHROPIC_AUTH_TOKEN or an API key is set — and
setting either would displace the OAuth credential a subscription depends on.
Two consequences worth knowing:
claude or anthropic. Claude Code filters the
list with /(claude|anthropic)/i. claude-local-qwen3 shows up;
qwen3-local is silently dropped. The router warns about ids it knows will
be filtered.git clone https://github.com/NodeNestor/claude-model-router
cd claude-model-router
# Windows
powershell -ExecutionPolicy Bypass -File install.ps1
# Linux / macOS
./install.sh
The installer links the repo into ~/.claude/plugins/model-router so the
SessionStart hook keeps the proxy alive, sets ANTHROPIC_BASE_URL and
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY in ~/.claude/settings.json,
creates ~/.claude/model-router.json, and starts the router.
If ANTHROPIC_BASE_URL was already pointing at something the router does not
recognise — a corporate gateway, say — that value is preserved as the router's
upstream, so the router slots in front and the existing chain keeps working.
Those two plugins claim ANTHROPIC_BASE_URL with the same rule this one does:
if it is not me, take it over and chain to whatever was there. Two proxies
following that rule point at each other and loop forever.
So the router never fights for the base URL. When it finds a sibling proxy already holding it, it walks to the end of that chain and splices itself in as the innermost hop:
Claude Code -> rolling-context -> pii-proxy -> model-router -> api.anthropic.com
-> your local backend
Innermost is also the only correct position: the router is the only hop that knows a request is bound for a local backend rather than Anthropic. If it sat on the outside, local models would bypass every other proxy — and history compression would silently stop applying to exactly the models with the least context to spare.
Two consequences handled automatically: proxies that end up pointing at each
other are relinked in visit order rather than cut, so none is silently dropped
from the chain; and the /model picker cache advertises the outermost base
URL, because that is the one Claude Code compares against — a cache written
with the router's own URL would be discarded whenever another proxy sits in
front.
Order between the plugins' SessionStart hooks does not matter; the arrangement converges to the same chain either way and re-asserts itself every session.
Everything lives in ~/.claude/model-router.json. See
config.example.json for a filled-in version.
{
"port": 5577,
"upstream": "https://api.anthropic.com", // where passthrough traffic goes
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
model-router@nestor-plugins is listed by nodenestor/nestor-plugins — review the source before installing
npx claudepluginhub nodenestor/nestor-plugins --plugin model-routerPlugins from other owners that cover similar ground