Open source · Prompt & Agent Workflows

Model Routing Policy Checker

Check model routing rules against capability, risk, latency and cost limits.

v0.1.0 · Node.js 22+ · MIT

Browse the public repository · View releases

You give it two JSON documents. A snapshot says what each model can do, what it costs, how much context it has and what data it is authorised for, and when those facts were captured. A policy says what each task needs and which model each route sends it to, with an explicit fallback edge from one route to the next.

This walkthrough uses the tool's public README and checked-in example files. Run the command from a repository checkout with Node.js 22+; inspect the source before using it on your own files.

Run the checked-in example

# Check the worked example: passes, exits 0
node bin/model-routing-policy-checker.mjs \
  --policy examples/routing-policy.json \
  --snapshot examples/snapshot.json \
  --config examples/checker.config.json

# The same run as machine-readable JSON
node bin/model-routing-policy-checker.mjs \
  --policy examples/routing-policy.json \
  --snapshot examples/snapshot.json \
  --as-of 2026-09-14 --json

# A policy with a cheap-but-unsupported primary and a fallback cycle: exits 1
node bin/model-routing-policy-checker.mjs \
  --policy examples/broken-policy.json \
  --snapshot examples/snapshot.json

# Everything: lint, tests, both examples, packaging
npm run check

Read the result

A consumer piping stdout must handle the empty case. Emitting a fake report for a run that never started would be worse.

Where this check stops

Every limit is enforced, overridable from the command line, and named in the finding when it is reached. Exceeding one is an incomplete result with no routing decision.

Before adapting the command to your own workflow, review the accepted inputs, exit codes and safety boundaries in the README.

Compiled with AI assistance from checked-in public documentation and example scripts. Run the example and review the repository's current documentation before relying on its result.