Skip to content
JevDirectory.org
OfficialPractices & PatternsVerified 2026-09-20

Pattern: Speculative Fan-Out

Ask everything the system might need in one request, then let code throw away what it does not use. The ticket-triage example sends a category plus four speculative questions in parallel.

Category
Practices & Patterns
Published by
TypeSafe AI
Author
Added
2026-09-20
Tagsofficialpatternsbatchingroutingclassification

Highlights

  • All questions are evaluated in parallel, so adding questions usually has little effect on response time.
  • One request carries a Choice category plus four speculative Score and Noul judgments.
  • The example escalates bugs at severity above 1.5 with repro above 0.6 and flags refunds above 0.7.
  • Speculative answers that do not match the branch are simply ignored.

Quickstart

python
if category.choice == "bug_report":
    if bug_severity.score > 1.5 and bug_repro.noul > 0.6:
        escalate_to_engineering(ticket_id, severity="high")
    else:
        add_to_bug_backlog(ticket_id)

elif category.choice == "billing":
    if refund.noul > 0.7:
        route_to_billing_with_flag(ticket_id, refund_likely=True)
    else:
        route_to_billing(ticket_id)

Watch out

Every speculative question adds input tokens on every call, so fan out on questions that several branches can reuse.

More like this

Use the answer to decide what to do and confidence to decide whether to act: the voice-banking example routes below 0.6 to a human and needs 0.85 or more to auto-approve a transfer.
Practices & Patterns#official#patterns#confidence
Official
Classify intent with a Choice and complexity with a Score, then send each branch to deterministic code, a specialist model, or a person, with a 0.5 intent-confidence floor.
Practices & Patterns#official#patterns#routing
Official
Pick one option from a set you define. Returns the option, the full probability distribution, and 0-1 confidence, with up to 255 options and parallel questions that barely add latency.
Practices & Patterns#official#primitives#choice
Official
Back to all resources

From the community

Posts from builders shipping with Jev right now.

The case against Jev-scored compaction

This is a terrible compaction strategy that fundamentally doesn't understand how compaction and context management work. Seems like a lot of people are confused so let's break this down. 1. Compaction isn't a filter The role of compaction is to clean up history to keep the Show more

tamara
tamara
@tamarajtran

found the perfect use case for @typesafeai Jev: instant compaction in 2026, why is compaction still a summarization prompt? Jev can make it instant by scoring every tool call and dropping what’s irrelevant

Reply

Classifying rows in DuckDB