Daniel Ávila’s jev-model-router uses Jev to classify a coding task before choosing its model or reasoning effort. The author’s freely readable DEV cross-post explains the policy; the current implementation adds some important edge cases.

Separate the classification from the spending policy

  • A multiple-choice question assigns the work to a fast, balanced or deep tier. Code maps that tier to configured models.
  • A score estimates how much reasoning the task needs. A separate yes/no question asks whether carrying it out changes production or irreversible state.
  • The implementation’s default confidence bars are 0.3 for upgrades and 0.6 for downgrades. These are policy settings, not measured accuracy guarantees.
  • Its risk probability above 0.7 forces the deep tier and raises the reasoning floor. The current question explicitly excludes merely writing or testing code about money or production.

Preserve the main conversation’s cache

Ávila leaves main-model switching off by default because changing models can sacrifice cached prompt work. Subagent-model routing and main-conversation effort changes are enabled. The inspected implementation applies one decision throughout a turn and abandons a pending decision when queued prompts make its ownership ambiguous.

An API error or expired classification budget leaves the original request unchanged. The configured 800-millisecond budget limits waiting for the hosted classification; it is not a measured end-to-end latency promise.

Check how the backend reports confidence

TypeSafe supplies a confidence field. The alternate gateway adapter uses the largest returned option probability when that field is absent. Those statistics need separate validation. With neither available, a recognized model tier can move upward but cannot be downgraded.

An unknown current model ID is an exception: the code treats an unrecognized rank as an upgrade. An offline probe confirmed that it can then select the fast tier without confidence. Configure and test the model ladder before relying on the downgrade protection.

Typed output makes the policy executable; task success still needs evaluation. Hosted routing also sends prompt text to the chosen provider.

Verification: read the full DEV article and inspected the current router at 816626c. Nine independent offline policy assertions passed using synthetic decisions. Claude Code integration, live Jev accuracy, cache effects and savings were not measured.