Skip to Content

Jev

@typia/jev converts the questions of typia.llm.evaluation<T>() to the wire format of Jev , TypeSafe’s System One model. Jev answers typed questions with calibrated probabilities, and never returns a value outside the declared options.

typia.llm.evaluation<T>() emits the provider-neutral questions of Vercel AI SDK’s experimental_evaluate(), which spells a yes/no question "boolean". Jev’s own wire format spells it "noul", and that format is shared by TypeSafe’s API and SDK and by OpenRouter’s Decisions API. toJevQuestions() renames exactly that question type; choice and score questions pass through unchanged.

Terminal
npm install typia @typia/jev @typesafe-ai/sdk npx typia setup

Through Vercel AI SDK, pass evaluation.questions to experimental_evaluate() as they are; its TypeSafe and OpenRouter providers convert them. Use @typia/jev to call Jev without AI SDK.

Usage

typesafe.ts
import { TypeSafeClient } from "@typesafe-ai/sdk"; import { toJevQuestions } from "@typia/jev"; import typia from "typia"; interface ITriage { /** Is the ticket urgent? */ urgent: boolean; /** Which team owns the ticket? */ team: "billing" | "technical"; } const evaluation = typia.llm.evaluation<ITriage>(); const client = new TypeSafeClient(); // reads TYPESAFE_API_KEY const { answers } = await client.systemOne({ model: "jev-1.13.0", state: "The payment page crashes for every customer.", questions: toJevQuestions(evaluation.questions), }); const result = evaluation.decode(answers);

The answers need no wire-format conversion: decode() accepts Jev’s native { type: "noul", noul } answer as it is, and folds every answer back into ITriage by the conversion rules of typia.llm.evaluation<T>(). Jev’s answers come rounded to two decimals in practice, which is the default of decimals, so decode() accepts them as they are. The raw answers keep what ITriage has no room for, such as the probability of every option.

Pin a versioned model once you tune probability thresholds, because TypeSafe’s aliases such as jev-latest move when a new release ships.

Wire format

toJevQuestions() returns a new map keyed like its input:

Neutral questionJev question
{ type: "boolean", instructions }{ type: "noul", instructions }
{ type: "choice", instructions, criteria }unchanged
{ type: "score", instructions, criteria }unchanged

The returned questions type-check against @typesafe-ai/sdk’s Question, so they can be passed to systemOne() directly.

Last updated on