createJevRouter() is a routing policy backed by TypeSafe’s Jev. Jev is a System One model: it does not generate text. Each selection sends the conversation and candidate evidence as Jev state and asks two typed Choice questions — which candidate serves the next turns, and how many turns to lease — and reads the answers back as calibrated probabilities. No prompt parsing, no JSON coercion.
You need a TypeSafe API key. Selection is billed by TypeSafe per input token (output tokens are free). Your executors still make provider calls and your provider credentials stay in your application.
Setup
createJevRouter uses the deterministic policy engine for candidate eligibility, cache-aware cost estimates, and benchmark evidence, so pricing and averageOutputTokensByModel are required exactly as they are for createDariRoutingPolicy. Custom rules are not supported; Jev serves only the default routing policy.
What Jev sees
Candidates are de-identified through the same anonymous-action protocol as Dari’s trained policy: each candidate is an action letter, stable for the whole conversation, and no model identity ever reaches TypeSafe. The state is the retained task, the previous action, the lease history, and the (image-scrubbed) conversation. Each action is one option in theaction question, described only by its projected loop cost at each lease length with a cost rank across actions, and its benchmark scores and ranks. Comparisons Jev is weak at — cost ordering and benchmark standing — are computed in this package and passed as text.
The lease question offers the same turn commitments as Dari (5, 10, 30 by default). The chosen lease becomes leaseTurnsRemaining on the decision, so createRouter holds the pair for that many turns without calling Jev again. Pass leaseTurns: [] to route one turn at a time.
Reading the answers
router.select() and the onSelection hook expose the raw Jev answers through policyDetails.selectorOutput, a JSON document with the decision and a jev field carrying model, both answers with their probability distributions and confidence, and token usage. Use the probabilities to gate on confidence in your own code, for example by only honoring long leases when the lease answer is confident.
Configuration
createJevSelector under /policy-engine returns the same selection as a Selector for createDariRoutingPolicy when you want to combine Jev with your own state or eval sources. buildJevSelectorRequest and parseJevSelectorResponse are exported for inspection and tests.