Jev AI Structured Extraction: Pick Candidates, Read Dates, Verify with a Cascade

Updated Applies to Jev 1.14

Structured extraction is the job most teams reach for a chat model to do, and it is the job chat models are worst at: asked to return a date, an amount or an address, a generative model will return something that looks right — including a year nobody wrote, a digit transposed, a currency guessed from context. Jev’s three documented extraction recipes attack that from three directions, and all three share one rule: the model makes the judgment, the code holds the value.

This page works through those three shapes using TypeSafe’s published cookbooks — pre-parsed value extraction, date extraction and the SDE cascade — with their recorded answer values, thresholds and cost figures.

Provenance: every confidence value, probability, threshold, sample output and cost figure on this page is copied from those three cookbook pages (all run against jev-1.14.0) and from Models, Choice, Advanced: structure and How to build with TypeSafe, read on 2026-11-10. Where the documentation shows a masked value (+141****0177), it is masked here too. Arithmetic I performed myself is labelled as derived.

The three shapes at a glance

ShapeThe model doesYour code doesDocumented recipe
Pick from pre-parsed spansChooses which regex-found span plays the roleCopies the span verbatim, parses it into a typed valuePre-parsed value extraction
Read the partsAnswers Choice questions about what the text saysFills gaps, does calendar arithmetic, validatesDate extraction
Verify and escalateAnswers one Noul per rule the answer must followEscalates above a threshold, keeps the cheap answer otherwiseSDE cascade

The premise underneath all three is the one TypeSafe’s build guide states as its most important concept: broad questions hide several judgments behind one answer, while atomic questions expose those judgments so you can inspect, tune and combine them in code. “Extract the invoice data” is a broad question. “Which of these four found amounts is the total the customer must pay?” is atomic, and its answer is checkable against the document.

Shape 1 — pick from spans your code already found

The pre-parsed cookbook takes three values out of one page of text: the address a sender wants their receipt sent to, a phone number, and an invoice total. The method is the same each time, in three steps:

  1. A regex finds the candidate values. It is tuned for recall — catch every real value, even if it also catches wrong ones.
  2. Jev picks which candidate the question is asking for, and reads off any attribute you need downstream: currency, country, whether an amount is a credit or a charge.
  3. Code copies the picked string and normalises it.

The candidates are the options of a Choice question, which is what makes invention impossible: the answer is one of the spans, copied, or the explicit none hatch. The pick helper in the cookbook builds its criteria from the candidate list plus one escape:

criteria = {c: None for c in candidates} | {
    "none": "None of these is the requested value."
}
answer = ts.system_one(
    state=document,
    questions={"pick": Choice(instructions=question, criteria=criteria)},
    model="jev-1.14.0",
).answers["pick"]
return {"choice": answer.choice, "confidence": answer.confidence}

Email: the body overrides the header

The sample thread has four addresses in it and the body asks for the receipt to go to a personal address rather than the billing alias in To:. Two questions go out against the same document: which address gets the receipt, and which one sent the message. Recorded answers:

Both are copies of regex matches. Nothing was regenerated; the only transformation is the lowercase step the cookbook applies in code.

Phone: two answers feed a library

Three numbers, none with a country code. That is two separate judgments, so the cookbook asks two questions: which number is the direct mobile, and in which country is this office — the second a Choice over a fixed label set (US, GB, DE, FR, CA, AU). phonenumbers then combines the picked string and the picked country into E.164. Recorded: mobile (415) 555-0177 at confidence 1.00, country US at 1.00, formatted output +141****0177 (masked in the published page).

Note how the work is split. The text says “main desk”, “billing fax”, “my direct cell” — reading which is which is the model’s job. Assembling an international phone number is phonenumbers’ job. Neither does the other’s.

Money: pick, classify, and check the sign

The invoice carries four amounts. The cookbook picks the total due and the courtesy credit, classifies the currency over a fixed label set, and asks one Noul per picked amount — is this a credit or a refund, not a charge? Recorded results:

QuestionPicked spanParsedFlagP(credit)
total due$1,315.501315.50 USDcharge0.03
courtesy credit$50.0050.00 USDcredit0.98

The two Noul answers are what give the parsed Decimal its sign. That is a real decision — a refund line and a charge line look identical to a regex.

The cookbook also flags the trap in its own parsing assumption: it treats the comma as a thousands separator and the dot as the decimal point, which holds for $1,315.50 and is reversed in €1.315,50. Its documented fix is another Noul in the same request — “Does this document use a comma as the decimal point?” — and a branch on the answer.

Two limits worth knowing before you build

Shape 2 — read the parts, let code do the math

Dates are where “just ask the model for the date” fails quietly. The date extraction cookbook inverts it: Jev answers Choice questions about what the text says, and Python resolves those parts into a date.

Seven questions go out in a single call. mode says how the date is written — absolute (a calendar date naming a month), relative (today, tomorrow, the day after tomorrow, or a named weekday), or none (the document does not state this date). Then month, day, year, day_anchor, weekday and week_offset read the pieces, and code reads only the pieces mode calls for.

Two details make it work:

The fill-in rule for a missing year is stated plainly: take the current year and move to the next one only when the date is already more than a month past. And the ambiguity in “next Thursday” is resolved by a stated convention, not by the model: a bare weekday means the next one on or after today, next means the following calendar week, current means this week.

The published scorecard

Six dates across four short documents, all resolved against a pinned TODAY of 2026-07-30 (a Thursday), with REVIEW_BELOW = 0.60:

QuestionExpectedGotConfidenceFlag
the date the agreement takes effect2025-01-012025-01-010.87
the date the agreement expires2027-12-312027-12-310.97
the deadline to return the form2026-08-142026-08-141.00
the date of the kickoff callnonenone0.66review — no such date stated
the date the survey closes2026-07-302026-07-300.98
the date of the design review2026-08-062026-08-060.87

Five auto-accept, one to a person. The interesting row is the fourth: the form contains a date, just not that one. mode came back none, the date came back empty — and it was flagged even though its 0.66 cleared the 0.60 gate, because a date the document never states always goes to review.

That last property matters more than the accuracy numbers. An extractor that returns nothing when the document says nothing is worth more than one that returns a plausible date you then have to audit.

Shape 3 — verify with Jev, escalate to a reasoning model

The SDE cascade cookbook is the pattern for the case where extraction is done by a cheap generative model. Big reasoning models produce correct structured data slowly and expensively; small models are cheap and make mistakes. A cascade runs the cheap model first and pays for the strong one only when a check fires.

In the published version the rungs are gpt-6-luna at rung 0, gpt-6.1-sol with reasoning_effort="high" at rung 1, and jev-1.14.0 as the verifier. The verifier never sees a correct answer — it sees the task and the cheap model’s record — and it answers one Noul per rule the answer must follow, each framed so that true means the rule is broken:

RuleQuestion it asks
busy_conflictDoes the meeting time overlap a time when any participant is busy?
outside_hoursIs the meeting time outside the allowed work hours or days?
breaks_preferenceDoes it break a stated preference, such as a participant who would rather not meet on a certain day?
not_earliestDoes the task ask for the earliest availability, and is an earlier valid time available?
wrong_lengthIs the meeting a different length from the one asked for?
no_single_timeDoes the answer fail to propose exactly one day with a start and end time?

Why the schema check is not enough

The sample task’s cheap answer is {"day":"Monday","start_time":"10:30","end_time":"11:30"}. It is schema-valid — and wrong: Monday 10:30–11:30 overlaps Joan’s meeting at 11:00 and Shirley’s at 11:00. A JSON-Schema validator cannot see that, which is exactly the class of error the cookbook is built to catch.

The recorded Noul answers for that answer:

RuleP(broken)
busy_conflict0.97<== FIRES
not_earliest0.25
wrong_length0.17
breaks_preference0.09
no_single_time0.07
outside_hours0.04

One rule fires and the rest stay quiet — which is what makes a single threshold of 0.7 usable. Two design notes from the cookbook are worth repeating: the escalation test is a max, not a mean, so one confident red flag is enough instead of being averaged into silence; and the decomposition into six narrow questions is what a flag can name, where a single “is this answer right?” score cannot say what went wrong.

The escalation did its job — the reasoning model proposed Monday 14:00–15:00, free for all three people.

The cascade on 1,000 tasks

One example shows the loop; the published run shows whether it pays. 1,000 calendar-scheduling tasks from NATURAL PLAN, an answer graded as working if it is schema-valid and proposes one of the task’s valid times, numbers recorded from jev-1.14.0 on 2026-11-05:

SetupMean $ per 1,000 tasksShare of answers that work
gpt-6-luna alone0.15692.6%
gpt-6.1-sol-high alone1.89098.1%
Cascade, threshold 0.58 (2.7% escalated)0.26194.9%
Cascade, threshold 0.29 (13.3% escalated)0.49096.5%
Cascade, threshold 0.18 (53.6% escalated)1.30798.1%
Cascade, threshold 0.16 (64.1% escalated)1.50098.3%

Two numbers explain why the cascade has room to work at all: the cheap model was wrong on 74 of the 1,000 tasks, and 72 of those wrong answers passed the schema check. Only semantic rule questions could catch them. Jev’s checks cost $0.04 per 1,000 tasks — about a fortieth of the difference between the two rungs. Past roughly 64% escalation, spending more buys nothing.

The arithmetic before you ship

Jev is priced per input token at $42 per Btok, or $0.042 per Mtok, with output tokens free (Models). Working from the cascade’s published check cost:

The general lesson from the cost and latency guide applies unchanged: the document usually dominates the bill, which is why one request carrying many questions beats many requests carrying one.

Choosing between the three

All three shapes keep the same discipline the confidence and fallback guide argues for: the model answers, the code decides, and every threshold is a named constant in one reviewable file. Extraction is where that discipline pays most visibly, because the failure mode of getting it wrong — a value that was never in the document — is the one users notice.

FAQ

Can Jev extract values that are not already in the document? No, and that is the point of the documented recipes. In pre-parsed extraction the regex finds every span that could be the value and those spans become the Choice options, so the answer is a verbatim copy of text that was already there. The model chooses which span plays the role; your code owns the string. When nothing fits, the model answers with the explicit none option rather than manufacturing a value.

Why ask for the parts of a date instead of the date? Because the calendar math is deterministic and the reading is not. Seven Choice questions capture what the text says; Python resolves it. The code fills in an unstated year, decides what “next Thursday” means by a stated convention, and rejects impossible readings such as February 30. Jev never does arithmetic.

How many options can one Choice question take? 255. Beyond that, narrow in two stages — pick the section first, then the span inside it. And remember that candidate finding is the real work: emails, phone numbers and amounts have regexes; names do not, so they need a roster or a named-entity recogniser.

Should the cheap rung use structured outputs? The cascade cookbook deliberately does not. Structured outputs force valid JSON and hide the rare answer that breaks the schema; the cookbook asks for a JSON object in the prompt, parses the reply as-is with no regex fishing, and escalates on any failure — escalating being the safe direction. In the published run 72 of 74 wrong cheap answers were schema-valid anyway, so rule checks were doing the actual work.

What does a cascade cost compared with always calling the strong model? $0.261 per 1,000 tasks to reach 94.9% versus $1.890 to reach 98.1%; $1.307 to match 98.1%. Jev’s checks are $0.04 per 1,000 tasks. The cascade pays when the cheap model is right most of the time and its mistakes break rules a check can see.

Does this work on Jev 1.13? Yes. Every primitive used here — Choice, Score, Noul — exists on both 1.13 and 1.14. Only Box questions require 1.14. The published cookbooks pin jev-1.14.0, which is the model ID for the release shipped on October 14, 2026, so reproduce the numbers on that model if you want them to match.

Frequently asked questions

+ Can Jev extract values that are not already in the document?

No, and that is the point of the documented extraction recipes. In the pre-parsed value extraction cookbook the regex finds every span that could be the value and those spans become the Choice question's options, so the answer is a verbatim copy of text that was already in the document. The model chooses which span plays the role; your code owns the string. When a value is not among the candidates the model answers with an explicit none option instead of manufacturing one.

+ Why ask Jev to read the parts of a date instead of asking for the date itself?

Because the calendar math is deterministic and the reading is not. The date extraction cookbook sends seven Choice questions about one date — whether it is absolute, relative or absent, and then which month, day, year, weekday and week offset the text names — and resolves those parts into a date in Python. The code fills in an unstated year, decides what 'next Thursday' means by a stated convention, and rejects impossible readings such as February 30. Jev never does arithmetic.

+ What does a verify-and-escalate cascade cost compared with always calling the strong model?

In TypeSafe's published run over 1,000 calendar-scheduling tasks, the strong model alone (gpt-6.1-sol with reasoning_effort=high) cost $1.890 per 1,000 tasks and got 98.1% of answers right. Escalating only the tasks Jev flagged hardest reached 94.9% for $0.261 per 1,000; escalating 13.3% of tasks reached 96.5% for $0.490; escalating 53.6% matched the strong model's 98.1% for $1.307. Jev's own checks cost $0.04 per 1,000 tasks.

+ How many options can one Jev Choice question take?

Up to 255. TypeSafe's documentation gives that as a hard limit and the pre-parsed extraction cookbook repeats it as one of two practical limits on span selection: with more candidates than 255, narrow in two stages — pick the section first, then the span inside it. The other limit is that candidate finding is the work: emails, phone numbers and amounts have regexes that cover them, but a name does not, so its candidates have to come from a roster you already have or from a named-entity recogniser that proposes them.

+ Should the cheap model in a cascade use structured outputs to guarantee valid JSON?

The SDE cascade cookbook deliberately does not, and says why: structured outputs force valid JSON and hide the rare answer that breaks the schema. It asks the model in the prompt to return only a JSON object matching a schema, parses the reply as-is with no regex fishing, and escalates when parsing or validation fails — escalating being the safe direction. In the published run 72 of the cheap model's 74 wrong answers still passed the schema check, so the rule checks were what caught them.

Keep reading