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
| Pattern | Official page | Hub page |
|---|---|---|
| Speculative fan-out | fan-out | Decision layer and Ultrafast architecture |
| Confidence-gated routing | confidence-routing | Confidence-gated routing |
| Composite scoring | composite-scoring | Composite scoring |
| Intent routing | intent-routing | Intent 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.
| Cookbook | What the official index says | Read beside it |
|---|---|---|
| Parallel questions | One call with 13 questions over a Wikipedia article, reported 12.2× cheaper and 10.0× faster than separate calls, with the same answers | API batching notes |
| Re-ranking | One question per query-candidate pair over BM25 shortlists | RAG filtering |
| Classifying RAG passages | Score each passage, then decide in code what reaches the answering model | RAG filtering |
| Citation check | One Choice on whether the quoted context supports the claim | Limitations on adversarial state |
| Guardrails | One request screens messages in and out of an LLM app | Content moderation |
| SDE cascade | A small extract, a verify step, then a reasoning model only when needed | Confidence-gated routing |
| Date extraction | Ask for the date parts named in the document, then resolve them in code | Limitations |
| Pre-parsed value extraction | Regex finds candidate spans. Jev selects one. Code copies it verbatim | Limitations on generation |
| Function calling | Map a request onto a function name and closed-set arguments | Agent tool selection |
| Skill suggestion | Pick at most one skill from a catalog, in two requests | Coding agents |
| Hierarchical classification | Beam search over Choice probabilities down a deep label tree | Classification |
| Classification using confidence | Report the leaf only when confidence holds; otherwise report the parent | Confidence-gated routing |
| Entity alignment | One Score plus companion Nouls on whether two records are the same product | Composite scoring |
| Structure recovery | Classify blocks and stitch hard-wrapped lines back into Markdown | Two requests, both closed label sets |
| Line-by-line search | Score line ids with a Choice, and use a Noul to ask whether the document contains an answer | Choice |
| Self-consistency | Noul and Choice cookbooks that keep uncertain cases visible for review | Noul |
| Feature discovery | Propose questions, turn them into features, fit a classical regressor | Composite 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
- PatternsTypeSafe · accessed 2026-09-30 · documentation
- CookbooksTypeSafe · accessed 2026-09-30 · documentation
- TypeSafe docs indexTypeSafe · accessed 2026-09-30 · documentation