Jev AI Hub
Start Learning

Learn

Jev Patterns and Cookbooks

The official TypeSafe patterns and cookbooks, and which hub page to read before you copy one.

Quick answer

TypeSafe publishes four architecture patterns and a cookbook index. The patterns are speculative fan-out, confidence-gated routing, composite scoring, and intent routing. The cookbooks are worked recipes on top of those. This page maps them to hub guides. The numbers inside each cookbook are TypeSafe's measurements.

Official docs split "how to build" into patterns and cookbooks. Patterns are the architecture. Cookbooks are end-to-end recipes with their own datasets. This hub explains the patterns. It does not re-run the cookbook tables.

Patterns

PatternOfficial pageHub page
Speculative fan-outfan-outDecision layer and Ultrafast architecture
Confidence-gated routingconfidence-routingConfidence-gated routing
Composite scoringcomposite-scoringComposite scoring
Intent routingintent-routingIntent detection and Model routing

Fan-out means one request can carry questions you might ignore. The questions share the state, run together, and cannot see each other. Your code throws away the branches that did not apply. The browser-agent loop uses that for "which control?" beside "which operation?"

Cookbooks worth opening next

The blurbs are the descriptions on TypeSafe's docs index, fetched 2026-09-30. Follow the link for the recipe.

CookbookWhat the official index saysRead beside it
Parallel questionsOne call with 13 questions over a Wikipedia article, reported 12.2× cheaper and 10.0× faster than separate calls, with the same answersAPI batching notes
Re-rankingOne question per query-candidate pair over BM25 shortlistsRAG filtering
Classifying RAG passagesScore each passage, then decide in code what reaches the answering modelRAG filtering
Citation checkOne Choice on whether the quoted context supports the claimLimitations on adversarial state
GuardrailsOne request screens messages in and out of an LLM appContent moderation
SDE cascadeA small extract, a verify step, then a reasoning model only when neededConfidence-gated routing
Date extractionAsk for the date parts named in the document, then resolve them in codeLimitations
Pre-parsed value extractionRegex finds candidate spans. Jev selects one. Code copies it verbatimLimitations on generation
Function callingMap a request onto a function name and closed-set argumentsAgent tool selection
Skill suggestionPick at most one skill from a catalog, in two requestsCoding agents
Hierarchical classificationBeam search over Choice probabilities down a deep label treeClassification
Classification using confidenceReport the leaf only when confidence holds; otherwise report the parentConfidence-gated routing
Entity alignmentOne Score plus companion Nouls on whether two records are the same productComposite scoring
Structure recoveryClassify blocks and stitch hard-wrapped lines back into MarkdownTwo requests, both closed label sets
Line-by-line searchScore line ids with a Choice, and use a Noul to ask whether the document contains an answerChoice
Self-consistencyNoul and Choice cookbooks that keep uncertain cases visible for reviewNoul
Feature discoveryPropose questions, turn them into features, fit a classical regressorComposite scoring

The parallel-questions speedup is TypeSafe's measurement on that article and those 13 questions. Quote it with the cookbook, not as a property of every workload.

Dates, spans, and other things code should finish

Jev reads dates as text. The date cookbook's move matches the limitations page: ask which month, day, and year are written, including "not stated," then build the date in code and reject what does not validate.

The same split covers emails, amounts, and phone numbers. A regex proposes spans. A Choice picks the span that answers the question. Your code copies that span and normalizes it. The model never has to emit the characters.

Cascades

A cascade is confidence routing across models. A cheap typed call handles the clear cases. A generator, or a person, sees the rest. The SDE cookbook is TypeSafe's version for structured extraction. vercel-labs/jev-ai-sdk-form-router is a public form that keeps Jev's choice only when its confidence is at least 95% and otherwise calls a text model. That 95% is their application constant. It is not a TypeSafe default.

FAQ

Should I copy a cookbook threshold into production?

Copy the shape of the recipe. Re-fit every cutoff on your labels. Official confidence docs already treat 0.5 and 0.9 as examples.

Where is date handling?

In the date-extraction cookbook, and in the limitations note: Jev reads dates as text. Ask for the parts, then compare them in code.

Sources

  1. PatternsTypeSafe · accessed 2026-09-30 · documentation
  2. CookbooksTypeSafe · accessed 2026-09-30 · documentation
  3. TypeSafe docs indexTypeSafe · accessed 2026-09-30 · documentation