JEV / TYPESAFE AI / EXPLAINED
What Is Jev? A Refund Request, Step by Step
Jev is an AI model from TypeSafe. Give it some information and a specific question; it returns a choice, a score or a probability that your app can use.
For a support app, that might mean choosing which team should handle a message. Here is what you send, what comes back, and what the app does with it.
Official introduction ↗
From message to billing queue
Illustrative example, not a recorded API response.
Jev classifies the message. The app checks payment records and handles any refund.
Send the customer’s message
“I was charged twice for the same order. Please refund the duplicate charge.” Send this message and any relevant order details through the API. The docs call this input state: the information the model has to work with.
Give it a question and options
Ask: “Which team should handle this message?” Supply four options: billing, technical support, account support, and other. Describe each option so the model knows what belongs there.
Read the selected category
In this example, the expected choice is billing. A Choice response also includes probabilities for all the options and a confidence value. Those let your app check whether one category clearly stands out.
Route the message, then check the charge
Send the message to the billing queue. The billing workflow then checks the payment records, verifies the duplicate charge and calculates the refund. An unclear category can go to a person for review.
Three question types ↗
Official routing pattern ↗
How does it compare with other approaches?
Rules
For an exact condition, write a rule: does this order have two captured charges? You can check the payment records directly. Understanding what a customer means is a separate task.
Text classifiers
A text classifier can already sort messages into categories. Jev lets you describe the categories in each request, which is useful when the available choices change with the page, task or user.
LLM structured outputs
LLMs with structured outputs can also return a category in valid JSON. They are useful when the same workflow needs generated text. Jev returns choices, scores and probabilities directly, for code that needs a judgment before taking its next step.
Where Jev fits
In Jev, you supply the material, questions and answer choices. It returns values your code can use, including probability distributions. The case for trying it is strongest when your app makes many small judgments of this kind.
LLM structured outputs: an example from Claude’s docs ↗
The three answer types
Choice · Pick an option
“Which queue should this ticket go to?”
Define mutually exclusive options and receive one selection plus the full probability distribution. Include an other / unclear option for cases outside your candidates.
Score · Rate a level
“How much impact does this fault have?”
Describe ordered levels concretely, such as a cosmetic issue, a fault with a workaround or a complete blocker. The score is a probability-weighted average of level indices and can fall between levels.
Noul · Is it true?
“Does the message explicitly request a refund?”
Returns a yes probability from 0 to 1, with no separate confidence field. Near 0.5 means the two answers are similarly likely; it does not mean a moderately strong refund request.
The wording changes the task
“I’m not happy with the fit. What are my options?” expresses dissatisfaction, but leaves the next step open. “Is the customer unhappy?” and “Does the customer explicitly request a refund?” ask for different judgments. Write the distinction into the question. TypeSafe uses this kind of example in its Jev 1.13 notes.
Choice API ↗ Score API ↗ Noul API ↗
TypeSafe’s question-wording examples ↗
Does the material actually contain an answer?
Code first assigns IDs to source passages. Choice selects the most relevant candidate while Noul checks whether the material contains an answer. Code combines the results to show the source or request more information.
That extra check matters: even when every passage is irrelevant, one will rank first in the Choice distribution. A high rank only describes a relative position.
If the result is ambiguous, retrieve more material and try again. The application does not have to force an answer from its current candidates.
Official line-by-line search example ↗
A browser agent builds its own choices
Which action, on which element?
The browser-use/jev-ultrafast project turns the current page into an action space. Code reads the page elements and lists the operations and targets that are available now. A new page produces a new set of choices.
Ask the conditional questions together
One request asks which operation to take and, separately, which target to use for each available operation: if clicking, click where; if typing, type where. Code takes the selected operation and its matching target. The other target answers are left unused.
Then observe the next page
The browser executes that action and observes the page again. When the action needs new text, a small language model supplies it. This makes the division of work concrete: the page supplies possible targets, Jev selects among them, and the browser carries out the action.
Read the browser agent’s selection code ↗
Keep the useful history
Choose what stays in context
Tamara Tran’s fast-jev-compaction takes a different approach to a long agent conversation. Instead of asking a model to rewrite the history as a summary, it asks which older tool calls and results are still worth keeping for the current task.
Two questions for each tool call
Should the call stay? Should its result stay? Code combines the two probabilities: retain the call and result, retain the call with a shortened result, or remove the pair. Recent calls are pinned by code. Text that survives is kept verbatim.
Give the selector a compact view
The selector sees conversation text and tool inputs, with older tool outputs represented by short status notes; the implementation also applies input budgets. After selection, removed details leave the next context. The interesting design move is turning “write a summary” into “select the records we still need.”
Read fast-jev-compaction ↗
Ask the same question about an agent run
A repeatability experiment
In a LangChain study, Daniel Shea and Sean Roche evaluated five fixed weather-agent runs, repeating each judge’s evaluation 100 times per run. Jev’s pass/fail answers agreed with the human labels on all 500 evaluations, and its quality scores varied little between repeats. Here the repeated input makes it possible to see how consistently the judge applies the same rubric.
The experiment and its evaluation setup ↗
Why these examples fit the same model
Questions share the same material but are evaluated independently. Code must organize follow-up questions that depend on earlier answers.
Define the answer space first
In the browser example, code has already listed the available actions and elements. Jev assigns probabilities within that supplied answer space. TypeSafe calls this a System One model: it is trained to return decisions and probabilities directly. The app receives values it can use immediately.
TypeSafe describes a parallel sampler that produces these outputs without generating a long text reply token by token. Questions in a request share the state and are evaluated independently. The browser agent uses that property to ask “if clicking, where?” and “if typing, where?” together, then lets code select the matching answer.
What calibrated probabilities mean
Its training method is called RLCD: reinforcement learning for calibrated decisions. Calibration gives a probability a practical meaning: among many predictions assigned 0.8, roughly eight in ten should come true. That is useful when software needs to decide whether to act now, gather more information or send a case for review.
Read the distribution, too
Choice and Score also include confidence, which describes how concentrated the distribution is. Billing far ahead of every other option gives a different signal from billing and account support almost tied. The distribution helps the app distinguish those cases; examples with known outcomes help set the routing threshold.
TypeSafe on System One and parallel sampling ↗
RLCD and calibration ↗
Official confidence definition ↗