Rhys Lindmark’s Model Router Workshop separates describing a prompt from deciding what to spend on it. Jev answers typed questions about the prompt. An ordered table in JavaScript turns those answers into a model tier and a reasoning setting. The repository includes saved results so readers can change the rules and see which answers would have passed.
Route on traits that explain a failure
- Lindmark’s first table emphasized reasoning depth, expertise and stakes. The next version added questions about exact letters or digits, quick recall, code writing and long procedures after inspecting misses on the training set.
- Each yes/no probability becomes a flag at 0.5 or above, a policy setting. The first matching rule wins. The final row sends otherwise unmatched prompts to the medium model at low effort.
- In the offline calendar example, Jev flagged both exact details and a long procedure. The first rule picked Qwen 3.7 Plus at high effort. The direct model-choice question picked the largest tier.
The command prints the matched rule alongside the probabilities. A typed probability tells the table what to do; whether the resulting answer passes is measured separately.
Compare the router with a model you could use for everything
Offline replay of Lindmark’s 168 held-out prompts returned these figures. Costs cover the saved answer runs, before any Jev routing charge:
| Policy | Passed | Answer cost per 1,000 prompts |
|---|---|---|
| Ask Jev which model to use, then run at high effort | 85.7% | $7.36 |
| Jev judgments plus the rule table | 91.1% | $3.20 |
| Jev judgments plus saved picks from a learned router | 93.5% | $3.25 |
| Always Qwen 3.7 Plus at high effort | 93.5% | $3.32 |
The table beat the replay’s shuffled baseline, which assigned the same mix of model settings to prompts at random. The fixed Plus setting still passed more tasks. The learned router matched its pass count, with only about 7 cents per 1,000 prompts in answer-cost savings before paying for the routing step.
Keep a fresh test set after editing the rules
The workshop exposes failures so readers can revise the starter table. Once those examples guide an edit, use a fresh set to check whether it generalizes. For a production decision, measure the full bill and repeat the comparison on real traffic.
Verification: inspected the TypeSafe client and policy at c8f6e6a; all six repository tests passed and the scores replayed offline. Each answer setting had one recorded run per prompt, using Qwen stand-ins for the Claude-named tiers. No provider calls were made, and the replay reads the learned router’s saved picks without retraining it.