A local policy
reasoningEffort to use the candidate’s default. The TypeScript field is reasoningEffort; wire JSON uses reasoning_effort.
Inspect or serve a selection
router.evaluatePolicy(request) is stateless: it runs the policy without reading or writing leases and without firing hooks. Use it for previews, logs, or tests.
router.select(request) is the authoritative serving primitive. It reads an existing lease, applies a new lease returned by the policy, and fires onSelection. router.fetch() uses the same semantics.
Self-hosted selector policy
The advancedcreateDariRoutingPolicy uses a selector model (an LLM that answers routing questions) and the deterministic policy engine to assemble evidence, ask the selector, and validate its answer. It is public from /policy-engine because it is more opinionated than the core policy interface.
selector is the only place the selector model is called. It is an option of createDariRoutingPolicy, not of createRouter.
For self-hosted createDariRoutingPolicy, provide your own pricing and observed output-token averages. Router Core does not ship or infer them. Cache state and model metadata remain optional; unknown cache state means the engine makes no cache-savings claim.
evals also accepts a callback, so a large benchmark pool can be filtered per request. selectRelevantEvals asks TypeSafe’s Jev one yes/no question per card (does this benchmark measure the kind of work the agent is doing?) and keeps the cards whose relevance probability exceeds JEV_EVAL_RELEVANCE_THRESHOLD (0.3). This is the same filter the Managed Router applies.
Custom rules
RoutingPolicy directly; for full preparation/finalization control, use the advanced policy engine.