agentleFS
armenrarmenr/modelmux/.claude/skills/switch-models/SKILL.md

switch-models

Skill2 starsChanged 4 months agoMITView on GitHub

Use when someone wants to change which OpenRouter (or Claude) models the proxy routes to — swapping a model behind an alias, retargeting an agent, overriding at runtime, or checking that slugs are still live.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add an alias under [models] in routes.toml (myalias = "openrouter:vendor/slug").

    line 48

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Switching models

The model menu lives in routes.toml under [models]: friendly aliases → "<upstream>:<slug>". Everything below is a way to change that mapping or which alias an agent uses. The proxy hot-reloads routes.toml on save (and keeps the previous config if an edit is invalid), so most changes need no restart.

The mux CLI

bin/mux models                              # list aliases → upstream:slug
bin/mux set flagship openrouter:z-ai/glm-6  # point an alias at a new model
bin/mux use glm-researcher reasoner         # retarget an agent's <<route:>> tag
bin/mux check-latest                        # verify configured slugs exist on OpenRouter
  • set <alias> <upstream:slug> rewrites just that alias's value in routes.toml, validating the spec first (anthropic: or openrouter:).
  • use <agent> <alias> rewrites the <<route:alias>> tag inside .claude/agents/<agent>.md, so that agent now routes to a different alias.

Runtime override (no file edit)

Override any alias for a single proxy run with an env var named MUX_MODEL_<ALIAS> (uppercase; hyphens become underscores):

MUX_MODEL_FLAGSHIP=openrouter:qwen/qwen3.7-max bun run proxy
MUX_MODEL_CLAUDE_REVIEW=anthropic:claude-opus-4-8 bun run proxy

Handy for trying a model without touching tracked files.

How an agent chooses its model

An agent's model comes from the <<route:alias>> tag on the first content line of its .claude/agents/<name>.md. The tag → alias → upstream:slug. To change it, either edit the tag, bin/mux use, or repoint the alias with bin/mux set.

Adding a new model or route

  1. Add an alias under [models] in routes.toml (myalias = "openrouter:vendor/slug").
  2. Optionally add a routes entry (e.g. { when = { tag = "myalias" }, use = "myalias" }) — remember it's first-match, most-specific-first.
  3. bin/mux models to confirm it loaded; the loader fails loud if an alias is unknown.

After changing anything

Give it a quick real check:

bin/mux check-latest          # slugs still exist?
bun run test:live                # real end-to-end call (needs OPENROUTER_API_KEY)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.