Pydantic AI Adds Jev to Cut Classification Latency 6x Without Generating Tokens

Pydantic AI now supports Jev, a non-generative classifier that answers typed questions in about 180 ms, turning your output_type into the question itself.

·
·
Pydantic AI Adds Jev to Cut Classification Latency 6x Without Generating Tokens
  • Pydantic AI merged TypeSafeModel, adding TypeSafe's Jev classifier as a first-class provider
  • Jev answers typed questions per field with a confidence score, no text generation
  • Median latency 227 ms vs 1,415 ms for gpt-5.6-luna on a 120-ticket triage benchmark
  • Priced at $0.042 per million input tokens, output free; install via pydantic-ai[typesafe]
  • FallbackModel routes low-confidence picks and argument-taking tools to a real LLM automatically
  • Best for triage, routing, evaluators, and judging other agents' runs

Pydantic AI adds Jev for typed, confidence-scored decisions

Pydantic AI has merged TypeSafeModel, a provider integration for TypeSafe’s Jev classifier. Developers can now run classification and routing agents without a text-generating model: an existing Pydantic output schema becomes the query, and Jev returns typed values with confidence data for each field.

The integration matters for agent steps with a fixed answer space, such as ticket triage, moderation, evaluation, and tool routing. Those tasks can use a faster, cheaper classifier while preserving Pydantic AI’s validation, provider interface, and fallback machinery.

Schemas become classifier queries

Jev consumes text but generates no prose. TypeSafe describes it as a System One classifier that evaluates all requested fields together and returns probabilities in roughly 180 ms. Because it does not generate tokens sequentially, TypeSafe says latency remains stable as fields are added to a Pydantic model.

The provider maps Python annotations to Jev’s supported question types:

  • bool becomes a yes-or-no question, with distance from 0.5 used for confidence.
  • Literal and Enum become single-choice questions with full probability distributions.
  • A float constrained to [0, 1] returns the predicted probability.
  • Bounded integers with descriptions for each level become rubric-based ratings.
  • list[Literal] evaluates each option as a separate yes-or-no question.
  • X | None allows the model to decline to select a value.

Unsupported capabilities fail before the provider sends a request. These include str outputs, native file inputs, and direct tool calls that require generated arguments. Pydantic AI raises a UserError instead of attempting to synthesize an unsupported value.

One model-name swap

Existing Pydantic AI agents can select Jev with the typesafe:jev-latest model name. The output model supplies both the response schema and the field descriptions Jev uses as questions.

python
from typing import Literal

from pydantic import BaseModel, Field
from pydantic_ai import Agent


class Ticket(BaseModel):
    """Triage a support ticket."""

    urgent: bool = Field(
        description="Does this need a reply within the hour?"
    )
    area: Literal["billing", "bug", "account", "other"]
    churn_risk: float = Field(ge=0, le=1)


agent = Agent(
    "typesafe:jev-latest",
    output_type=Ticket,
)

result = await agent.run(
    "Second time this month my card was charged twice. "
    "Fix it or I cancel."
)

print(result.response.provider_details["confidence"])

Install the provider with pip install "pydantic-ai[typesafe]". TypeSafe charges $0.042 per million input tokens and does not charge for output tokens. The jev-latest and jev-preview aliases currently resolve to the same model version.

The benchmark: 227 ms median

The Pydantic team tested a FallbackModel(jev, luna) configuration on 120 support tickets with three tools attached. Jev handled 115 tickets, while five requests fell back to Luna.

Configuration Median latency Reported batch cost
Jev with Luna fallback 227 ms $0.004 for Jev calls, plus five Luna fallbacks
gpt-5.6-luna 1,415 ms Not reported
gpt-5.6-sol 2,510 ms $0.258
Claude Opus 5 Not reported $0.545

The sample was too small to establish a meaningful accuracy lead. With 120 tickets, the reported confidence interval was roughly six percentage points, and all five tested models fell within the same range for urgency and area classification. The measured differences were latency and cost.

TypeSafe separately reports Jev response times between 70 and 500 ms and claims a 40-fold to 200-fold speed advantage over conventional language models. Those broader vendor figures use a different comparison from the 120-ticket Pydantic AI benchmark, where end-to-end median latency improved by roughly sixfold over Luna and elevenfold over Sol.

Tool routing through fallback

When an agent has tools, the provider adds a classification question asking whether the input calls for one of those tools or the declared output type. Jev can select and invoke tools that take no arguments. A tool requiring generated arguments produces a ToolCallProposed response, which FallbackModel can pass to a language model.

The FallbackModel.fallback_on API accepts a response handler, allowing applications to trigger handoff according to Jev’s confidence. In the ticket benchmark, this arrangement kept 115 of 120 requests on Jev. The typesafe_tool_call_threshold setting, which defaults to 0.6, controls the confidence required to choose a tool instead of returning the output type.

Where Jev fits

Jev suits agent stages whose valid outputs are known in advance and expressible through supported Python types. Common uses include:

  • Routing and triage: support queues, pull-request labels, incident categories, and severity levels.
  • Confidence-gated fallback: routine cases stay on Jev, while uncertain cases move to a language model.
  • Agent evaluation: the material being judged and the evaluation questions travel as separate API fields.
  • Guardrails: typed decisions arrive without extracting JSON from generated prose.

Text generation, coding assistance, file analysis, and tools that need generated arguments still require another model. Pydantic AI’s provider and fallback abstractions let applications reserve that model for requests Jev cannot handle or classifies with insufficient confidence.

A growing community directory lists a PostgreSQL extension, a Vercel AI SDK provider, and a Home Assistant conversation agent built around Jev. For classification-heavy systems, the integration removes token-by-token generation and JSON parsing from decision steps while retaining typed validation and explicit confidence scores.

Trending
  • No trending articles

Comments

avatar

Next Reads