typesafe/jev-router) selects a model and reasoning effort for each request. Jev, TypeSafe’s decision model, assesses the task, its difficulty, and the potential benefit of a stronger model. The routing policy balances those signals against estimated cost and your preferences.
Use it as a model, or add the jev-router plugin to choose a cost tier and set model preferences. Jev makes the routing decision; the selected model generates the response.
How it works
- Assess the request. Jev evaluates the conversation to identify what the task needs.
- Select a model and effort. The router applies the selected cost policy, available model capabilities, and your model and provider restrictions.
- Adapt across turns. During supported agentic workflows, the router can retain a model, adjust its effort, or switch models as the task progresses. When the policy permits it, an expert advisor can assist the model doing the work.
Usage
Setmodel to typesafe/jev-router. No plugin is required:
cURL
model field reports the model that served the request. The router works with Chat Completions, Responses, and Messages, streaming and non-streaming.
Plugin parameters
The plugin is optional. Add it to configure routing for a request:
All fields except
id are optional. Unknown fields and invalid values return 400; for example, allowed_model is not accepted as an alias.
Cost tiers
cost_tier selects the routing policy, not the model’s reasoning effort:
Set
cost_tier to choose a policy for your request. Your model and provider restrictions still apply.
If you omit cost_tier, Jev uses its default routing policy. To explicitly choose the medium policy, set cost_tier: "medium". An unrecognized tier name returns 400.
Changing cost tiers can change the selected model, even within the same conversation.
Reasoning effort
The router normally chooses reasoning effort. You can supply the standard top-levelreasoning.effort field as a hint, independently of cost_tier:
reasoning_effort field is also accepted. The router can select a different effort or adapt it across turns, so a hint is not a guarantee of the setting sent to the final model. reasoning.max_tokens and reasoning.mode: "pro" are not supported and return 400. See Reasoning tokens for the standard reasoning fields.
Model preferences
Combine a cost tier with include and exclude preferences when needed:- An exact model slug, such as
openai/gpt-6-luna. It matches every dated revision of that slug. - A dated revision, such as
openai/gpt-6-luna-20260922, which matches only that revision. - A wildcard pattern, such as
anthropic/*or*flash*. Matching is case-sensitive. - A
~author/family-latestalias, such as~openai/gpt-luna-latest, which matches every revision of that family.
How the lists apply
The lists only narrow the router’s pool. They do not add models, and they do not change how Jev ranks the candidates that remain.- An include list that matches nothing is ignored. If no pool model matches
models, the router uses the whole pool, andexcluded_modelsstill applies. This keeps requests working when an entry is misspelled or names a model outside the pool. The pipeline stage reportslist_fallback: "models_ignored". - Exclusions are never ignored. If
excluded_modelsremoves every pool model, the request fails with404instead of routing to an excluded model. - The lists can lower the capability tier. When a hard request needs stronger models than the lists leave, the router can lower its capability requirement. The stage reports this as
list_tier_cap; it is not thelow/medium/highcost tier. - The lists can remove the advisor. For the hardest requests, the router can pair the chosen model with an expert advisor. If your lists remove every advisor, the router uses an eligible model without an advisor, and the stage reports
max_fallback: "deep".
404. The error names the fields you sent, such as widen allowed_models or remove excluded_models.
Seeing what the router did
The response’smodel field identifies the model that served the request. Send X-OpenRouter-Metadata: enabled for more detail in router metadata. The jev-router entry in openrouter_metadata.pipeline includes:
cURL
Availability and errors
Jev Router is available only in the global data region and is not supported for HIPAA workspaces. Access to the router and the selected models is still required. Do not combinetypesafe/jev-router with another router model in the same request.
Related
- Jev: the decision model behind the router
- Auto Router: a separate router with its own cost-tier behavior
- Router metadata: the
openrouter_metadataresponse field