Docs
CommunityJev Tools & CLIs
Pydantic AI: TypeSafe (Jev) Model
Run a Pydantic AI agent on Jev: each field of the output type becomes one question, the prompt is the state, and confidence comes back per field.
- Format
- Docs
- Reading time
- 3 min
- Published by
- Community
- Last verified
- Sep 2026
Highlights
- Each field of output_type becomes one question, the prompt is the state, and versioned ids like typesafe:jev-1.13.0 are accepted.
- Confidence is per field in provider_details['confidence']; for a boolean it is the distance from the decision threshold, scaled 0 to 1.
- typesafe_boolean_threshold defaults to 0.5 and applies to every bool field and each option of a fanned-out list.
- A rubric is whole numbers from 0 upward, at least 2 and at most 10 levels, each needing a description; a half rounds up.
- Jev picks from at most 255 options in one question, so a run-time candidate set needs a ceiling of 253 plus abstain and reobserve.
Quickstart
python
from enum import Enum
from pydantic import BaseModel, Field
from pydantic_ai import Agent
class Verdict(str, Enum):
run = 'run'
reject = 'reject'
ask = 'ask'
class Handling(BaseModel):
verdict: Verdict
irreversible: bool = Field(description='Would running this destroy data or leak secrets?')
agent = Agent('typesafe:jev-latest', output_type=Handling)
result = agent.run_sync('rm -rf ./build')
print(result.output)Watch out
Jev cannot fill plain strings, unbounded numbers, datetimes, or unions of models, and those fields raise UserError before a request is sent, so questions belong on field descriptions.
Questions about this entry
Short answers drawn from the linked project or page.
No. Jev cannot fill plain strings, unbounded numbers, datetimes, or unions of models, and those fields raise a UserError before any request is sent. Put the judgment on the description of a bool, enum, or rubric field and leave the prose to a separate model.
For a boolean it is the distance from the decision threshold, scaled from 0 to 1, and it arrives per field in provider_details['confidence']. The threshold itself, typesafe_boolean_threshold, defaults to 0.5 and applies to every bool field and to each option of a fanned-out list.
At most 255 in one question. That ceiling is the catch for run-time candidate sets: a list built at runtime needs a hard cap of 253 options plus an abstain option and a reobserve path, or the request will not fit.
Not in the captured page. Its table of contents includes a section on what Jev answers badly and one labelled Published by TypeSafe, but the body was cut before any numbers, and the repository copy carries no benchmark either. The captured text also holds no install or configuration detail beyond those headings.
Every field of output_type becomes one question, and the prompt you pass is the state those questions judge. Fields on one class are answered in the same run rather than one request per field.
Pass a provider-prefixed id such as typesafe:jev-latest. Versioned ids like typesafe:jev-1.13.0 are accepted too, so a run can be pinned to a release instead of tracking whatever is newest.
A rubric is whole numbers from 0 upward, with at least 2 and at most 10 levels, and each level needs a description. A value that lands exactly on a half rounds up.
From the Jev guides
Original write-ups on what this entry is for.
From the Jev AI model community
Posts from builders shipping with Jev right now.