Skip to content
Code Recycle

Component · for humans & their agents

Model Router

verified · first-partyactively maintained$0 during beta (was $39)

A wrong model pick looks exactly like a right one — the reply still arrives. Nobody notices the legal summary went to the cheap model, or that the prompt with a diagnosis in it left the building.

by ledgerline · Code Recycle moderator

Get it free — beta

Every claim on this page is refundable if it is untrue — refund policy.

Verified: 22 tests · 10/10 mutations caught

Model routing is usually a chain of `if`s that grew one incident at a time, and its worst property is that a wrong pick is invisible: the reply still arrives, it still reads fine, and the only trace is on the bill or in a privacy review months later.

The failure it catches

Model routing is usually a chain of `if`s that grew one incident at a time, and its worst property is that a wrong pick is invisible: the reply still arrives, it still reads fine, and the only trace is on the bill or in a privacy review months later.

This is that decision as one pure function — classify the prompt, score the models you actually have, pick one, and say WHY, so the choice is auditable after the fact instead of inferred.

Modes

| mode | picks | |---|---| | `auto` | quality-first, light nudge from speed and cost, strong pull to local when the prompt looks private | | `quality` | strongest available for the task | | `price` | cheapest that still clears the quality floor | | `fast` | lowest latency that clears the floor | | `coding` | weighted on coding ability, not overall strength | | `research` | long context plus reasoning | | `privacy` | local only — a hard block, not a preference |

The three rules that matter

Privacy Mode refuses rather than degrades. No local model available returns `{ ok: false, error: "no_local_model" }`. It does not quietly use the cloud. A mode whose whole promise is "nothing leaves your machine" cannot have a fallback.

Sensitivity is inferred, and grounding counts. A prompt mentioning a diagnosis, an SSN, a bank account or a password is private — and so is any prompt grounded in your own documents, because that prompt now carries the corpus inside it.

A quality floor is what makes "cheapest" an answer. Without it, price mode is sorting by price and hands a contract summary to the weakest model on the list. When nothing clears the floor it still returns a decision rather than throwing out of the routing call.

Your catalog, your scores

The candidate list is passed on every call and per-model scores are overridable key by key. That is the only design that survives contact with reality: names, prices and tiers change every few weeks, and a router shipping a hardcoded table would be wrong within a month of purchase and wrong SILENTLY — still returning a confident pick for a model you no longer run. `DEFAULT_SCORES` is exported so you can read it, override it, or ignore it; an unknown model takes its tier's defaults rather than falling to zero.

What it does not do

It does not call any model — it returns a decision. It does not benchmark; the scores are a table you maintain. And it does not classify with an LLM, because a router that needs a model call to decide which model to call has a cost and latency problem in the one place you cannot afford one.

Verified

22 tests, 10 deliberate defects, all 10 caught — including Privacy Mode falling through to the cloud, the sensitive-prompt local boost quietly shrinking tenfold, price mode losing its quality floor, and caller score overrides being ignored in favour of the shipped table.

Delivery

Source delivered as a private repository invite within 24 hours of purchase. Single-product commercial license: use and modify in any number of products; no redistribution or resale of the source.

Interface

What you call, and what comes back. Types and signatures only — the implementation ships with the source.

  export function scoreFor( id: string, tier: 'local' | 'cloud', overrides?: Record<string, Score>, ): Score;
  export function classifyPrompt(text: string):;
  export function routeModel(opts: { prompt: string mode: RouteMode catalog: CatalogModel[] grounded?: boolean scores?: Record<string, Score> }): RouteDecision;

01Capabilities

Does

  • + Budget policies & spending limits
  • + Model-routing visibility
  • + Cost estimation

Doesn’t

  • No exclusions declared

02Requirements & stack

Depends on

No declared dependencies

Credentials needed

None declared

Stack

typescript

03Community

No endorsements yet

No verified confirmations yet — be the first.

Confirmations come from verified purchasers, installers, vetted reviewers, or an installation outcome your org reported through the agent tools. They grade quality — security is verified separately, and community votes can never override the security gate.

Open an issue

Sign in to confirm — weight comes from verified usage, not vote count.

0 open · 0 answered · 0 fixed · 1 said it worked

04Trust Passport

Full passport →
–/100

0/0 automated components pass. An automated score is never a security guarantee.

✓ Verified · first-partyreviewed Sep 20, 2026 · re-verification due Dec 19, 2026
  • publisher identity Publisher status verified; 1 verification(s) on file
  • malicious pattern scan No known malicious-behavior patterns across 8 source file(s) plus listing text
  • capability contract All 0 observed capability reference(s) match the declared manifest
  • agent safety scan No injection patterns in agent-readable content
  • provenance No release signature or provenance attestation
  • behavioral sandbox Not performed in this environment — requires the production isolated runner (docs/sandbox-requirements.md). No untrusted code is ever executed on the application host.

Every listing must pass this review before it can be sold, and it is re-run on every release. Verification describes what we checked — it is not a guarantee that the software is safe.

VersionChannelReleasedNotes
1.0.0stableAug 10, 2026First public release.