Skip to content

Docs

Cookbook: SDE Cascade

A two-stage extraction cascade: a mini model extracts, a Noul battery verifies each field in one request, and a 0.7 gate escalates to a reasoning model, sitting on the cost/quality frontier.
Format
Docs
Reading time
3 min
Published by
TypeSafe AI
Last verified
Sep 2026

Highlights

  • Pipeline: gpt-5.4-mini extracts, one Noul battery verifies fields in a single call, and a 0.7 gate escalates to gpt-5.5.
  • A fabricated description read hallucinated 0.95 and off_target 0.85 while correct and empty fields read 0.02 to 0.14.
  • On an internal 100-prompt sweep the cascade sat up-and-left of every single model on the cost/quality chart.
  • A jsonschema-valid but semantically wrong record shows validation alone cannot catch extraction errors.

Quickstart

python
mini_record = extract(MINI, prompt, schema, content, temperature=0)

answers = ts.system_one(
    state={"source_text": content, "schema": schema, "extraction": mini_record},
    questions=build_questions(mini_record),  # per-field Noul battery, P(wrong)
    model=TS_MODEL,
).answers

fired = {qid: a.noul for qid, a in answers.items()
         if not qid.startswith("__overall__") and a.noul > FIRE_T}  # FIRE_T = 0.7
if fired:  # any field flag fires -> escalate to the reasoning rung
    final = extract(REASONING, prompt, schema, content, reasoning_effort="high")

Watch out

The cost/quality sweep is a historical snapshot not recalculated at the current Jev rate, so re-run it before quoting the numbers.

Questions about this entry

Short answers drawn from the linked project or page.

Reactions & coverage

Posts, threads, and videos about this entry from around the web.

X: A 26-sheet plan set in 2.9 seconds

X: Which exam questions come back

X: 100,000 viral posts in 20.4 seconds

X: 900 images in 40 seconds

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.

Follow @typesafeai