Jev: the smart if statement
What Jev is, its three question types, and how to wire one decision into a TypeScript product.
0 Β· Four words first
1 Β· What it is
Jev is a model from TypeSafe AI. It returns typed decisions, not generated text.1 TypeSafe calls it a System One model: it's built for fast, automatic judgments that your software makes thousands of times, not for long chains of reasoning.1 You decide the possible answers before you call it. The policy that acts on the answer stays in your code.2
Watch one call run, or scrub through it. Press βΆ, use the chapter buttons, or turn on π β π for narration:
The numbers come from the request/response example in Firecrawl's guide.1 Paused, the final frame works as a static diagram.
| Jev | Typical LLM | |
|---|---|---|
| Output | Typed answer + probabilities | Free text (you parse it) |
| Latency | 70β500 ms, most ~100 ms2 | Seconds |
| Price | $0.042 / M input tokens, output free2 | $0.20β$10 / M1 |
2 Β· Three question types
3 Β· The call, annotated
import { choice, TypeSafeClient } from '@typesafe-ai/sdk'
const client = new TypeSafeClient()
const { answers } = await client.systemOne({ 1
state: { ticket: 'Export button crashes in Safari' }, 2
questions: {
category: choice('What kind of ticket?', { 3
bug_report: 'Something is broken',
feature_request: 'New feature request',
}),
},
})
// answers.category.choice β 'bug_report' 4
// answers.category.confidence β 0.95
systemOnemakes one call. The raw endpoint isPOST https://api.typesafe.ai/v1/systemone.2- The state: only what the decision needs.
- The key (
category) names the answer. The object lists the only answers Jev is allowed to return, and each description is read literally.2 - A typed result. There's no parsing, and an answer outside your list is impossible.2
4 Β· Confidence β bands
A probability belongs to one option. Confidence describes the whole distribution.3 Both answers below have a winner, but only one can be trusted to act on alone. Use the toggle:
Your code turns confidence into an action using two lines:3
const ASSIGN = { act: 0.8, confirm: 0.5 }
const c = department.confidence
if (c < ASSIGN.confirm) return { action: 'triage' } // human handles
if (c < ASSIGN.act) return { action: 'suggest', team: department.choice }
return { action: 'assign', team: department.choice } // automatic
Don't copy the 0.8 / 0.5 numbers. Run Jev over labeled examples, measure accuracy in each confidence bucket, and set the lines where accuracy meets the error cost you can live with (for example, 90%+ for refunds).3
Zoom out: where the decision lives
TypeSafe's own design guide sums this up as "keeping code in control and giving System One narrow, structured decisions."5
5 Β· Jev or LLM?
In AI dev workflows, Jev works well as the fast gate around an LLM agent. It can decide which tool or path to take, whether an output passes a check, or whether to escalate. The LLM does the generating.
Practice: from memory
A Β· Place the marker
The zones are hidden. Remember where the lines are, pick the band, and repeat a few times.
B Β· Fill the faded example
This is the same call as in section 3, with parts blanked out. Fill it in without scrolling up.
const { answers } = await client.({
: { ticket },
: {
team: ('Which team?', { billing: 'β¦', technical: 'β¦' }),
},
})
if (answers.team. < 0.5) return { action: '' }
C Β· Quick quiz
1. Route each support ticket to billing, technical, or sales.
2. "This comment is spam." True or false?
3. Rate how severe a bug report is, from cosmetic to outage.
4. confidence measures theβ¦
5. You need to know whether a cart total is over $500. How do you get that answer?
6. Your agent needs to draft a reply to the customer. Which model should do that?
π Milestone challenge: Pick Jev vs LLM + Write solid calls
Pick one real feature from your product or agent workflow. Write the following and paste it back to me in chat:
- The
questionsobject: at least onechoiceand onenoul. - The
stateyou'll send, trimmed to only what the decision needs. - Your band lines, and what happens in each band. A rough sketch of your own band diagram is welcome too.
I'll review it like a code review. If it passes, I'll mark the milestones mastered on your dashboard.
Access note: direct sign-ups have been paused at times (one source reports a pause on 22 Sep 2026).1 Jev is also available through the Vercel AI Gateway as
typesafe-ai/jev, and through OpenRouter.
Stuck or curious? Ask me follow-up questions in the terminal. I'm your teacher for this, and nothing is too basic to ask.