Docs
OfficialJev Cookbooks
Cookbook: Parallel Questions
A 13-question regulatory briefing that shows batching every question into one call is 12.2x cheaper and 10x faster with no change in answers.
- Format
- Docs
- Reading time
- 2 min
- Published by
- TypeSafe AI
- Last verified
- Sep 2026
Works forJev for Scoring
Used inJev for Legal & Compliance
Highlights
- The briefing runs 8 Noul, 2 Choice, and 3 Score questions over a pinned ~54,000-character Wikipedia GDPR revision.
- One batched call cost $0.000497 and took 0.27s; 13 single-question calls cost $0.006090 and 2.71s — 12.2x cheaper and 10.0x faster.
- Both strategies ran 5 repeats; most answers had std dev exactly 0.0, and the two noisy Nouls showed the same variance either way.
- Pricing used was $0.042 per 1M input tokens and $0.00 per 1M output tokens for jev-1.12 as of 2026-09.
Quickstart
python
response = client.system_one(state={"article": DOCUMENT}, questions=QUESTIONS, model="jev-1.12")
answer = response.answers[key]
if isinstance(answer, NoulAnswer):
values[key] = answer.noul
elif isinstance(answer, ChoiceAnswer):
values[key] = max(answer.probabilities.values())
else:
values[key] = answer.score / (len(QUESTIONS[key].criteria) - 1)Watch out
The 10x speedup assumes the 13 single-question calls run sequentially; fired concurrently the latency gap shrinks, though the 13x token cost stays.
Questions about this entry
Short answers drawn from the linked project or page.
On the 13-question briefing: one batched call cost $0.000497 and took 0.27s, against $0.006090 and 2.71s for 13 single-question calls — 12.2x cheaper and 10.0x faster, with the same answers across 5 repeats.
Partly. The caveat says the 10x latency gap shrinks if the single-question calls run concurrently, though the 13x token cost stays — batching saves tokens because the state is sent once rather than once per question.
A regulatory briefing of 8 Noul, 2 Choice and 3 Score questions over a pinned revision of Wikipedia's GDPR article, about 54,000 characters. The revision id is fixed so the text and the numbers stay stable even as the live article gets edited.
Noul gives the probability of yes directly. For a Choice you take the probability on the picked label, with criteria mapping each label to its meaning. For a Score you divide the score by the top level index, so levels are comparable across questions with different numbers of rungs.
No. Both strategies were run 5 times and most answers had a standard deviation of exactly 0.0. The two noisy Nouls showed the same variance either way, so the report's speed and cost figures are not buying you a different answer.
The batched call is $0.000497 against $0.006090 for the singles, priced at $0.042 per million input tokens and $0.00 per million output tokens for jev-1.12 as of 2026-09. The document is fetched at a pinned Wikipedia revision so the comparison is reproducible.
pip install ipython 'cooksafe>=0.2.0,<0.3.0' and set TYPESAFE_API_KEY. The cookbook fetches a pinned Wikipedia revision and caches both the document and every API call in json_cache.json, so re-rendering replays the published numbers without new spend; the model is jev-1.12.
Reactions & coverage
Posts, threads, and videos about this entry from around the web.
X: 200 rows, 32 template families, and traps, judged in one call
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.