The AI World · Article 7

TypeSafe and Jev: how typed AI judgments are changing the way we use AI

Why software shouldn’t chat with AI, System One models, Choice, Noul and Score, calibrated confidence, your first app step by step, and the patterns that cut AI costs by orders of magnitude.

By Mrinal Singh Raja19 min read

How to read this

Not a developer? The green sections explain the big idea — why software shouldn’t “chat” with AI — with everyday analogies. Builders: the amber and red sections take you from the three question types to a working app, cost maths and production patterns.

BeginnerIntermediateAdvanced

Over the last six articles we have met the great AI chatbots — ChatGPT, Claude, Gemini, Copilot, DeepSeek. All of them are built to talk. But a huge share of what software actually needs from AI isn’t conversation at all. It’s tiny decisions: is this email urgent? Which team should get this ticket? Does this review mention a crash? How angry is this customer?

TypeSafe is a company built around that observation, and Jev is its model. Jev doesn’t write a single word. You give it some text and a list of typed questions, and it returns typed answers — a choice from your list, a probability, a position on a scale — with calibrated confidence, in about a tenth of a second, for a tiny fraction of a cent. This article explains why that is a genuinely different way of engaging AI, and how to build with it, from the first idea to production patterns.

01Beginner

The professor and the checkbox

Using a big chatbot for every small decision is like hiring a professor to tick checkboxes. It works — the professor is brilliant — but it’s slow, expensive, and sometimes, instead of a tick, you get an essay in the margin. Software then has to read that essay and hope to find a tick inside it. Developers call this pattern prompt-and-parse, and anyone who has built with it knows the pain.

The old way: prompt, then parse

“Classify this ticket as billing, technical or sales. Reply in JSON.”

Sure! Here’s the classification: ```json {"category": "Billing/Technical" …

  • ✗ Invents a category that isn’t on the list
  • ✗ Broken JSON → retry loop
  • ✗ No idea how sure it is
  • ✗ You pay for every word it writes

The typed way: ask, get a value

Choice: billing | technical | sales | other

{"choice": "billing", "confidence": 0.81, "probabilities": {…}}

  • ✓ Always one of the options you gave
  • ✓ Never breaks — nothing to parse
  • ✓ Calibrated probabilities with every answer
  • ✓ Output tokens are free
Fig. 1 — Prompt-and-parse versus a typed judgment. The typed answer can’t leave your list, can’t break, and tells you how sure it is.

The idea TypeSafe summarises in one sentence: let plain code do the steps, let Jev make the quick common-sense calls, and call a big AI only when you truly need writing or deep thinking.

02Beginner

How software talks to AI: a short history

For fifty years, the way programs use “intelligence” has swung between two poles: typed and reliable but narrow, or flexible and general but messy. System One models are an attempt to get both.

  1. 1970s–80s

    Hand-written rules

    Expert systems encode knowledge as if-then rules. Predictable and typed, but brittle: every case needs a new rule.

  2. 1990s–2010s

    Classical machine learning

    Spam filters and fraud models learn from examples and return a label with a probability. Typed and calibrated — but each task needs its own labelled dataset and model.

  3. 2011

    Thinking, Fast and Slow

    Daniel Kahneman popularises “System 1” (fast, intuitive) and “System 2” (slow, deliberate) thinking — the idea TypeSafe’s name for its models borrows.

  4. 2020–2022

    Large language models and RLHF

    One model handles any task described in words. Tuned with human feedback, it writes fluently — and software starts “prompting and parsing” its prose.

  5. 2023–2025

    JSON mode, function calling, structured outputs

    Providers constrain LLM output to schemas, fixing broken JSON. But the model still generates token by token, and output still costs money.

  6. 2026

    System One models

    TypeSafe’s Jev answers typed questions directly — a choice, a probability, a level — with calibrated confidence and no text generation at all.

Fig. 2 — From hand-written rules to typed judgments. Each step fixed a problem the previous one left behind.

Classical machine learning — the spam filter in your inbox — already returned typed, calibrated answers, but every new task needed its own labelled dataset and model. Large language models removed that cost: describe any task in words and it works. System One models keep that flexibility while returning to typed, calibrated outputs.

03Beginner

System 1 and System 2

The name comes from psychology. In Thinking, Fast and Slow, Nobel laureate Daniel Kahneman described two modes of the mind: System 1, fast and intuitive — you recognise a friend’s face instantly — and System 2, slow and deliberate — you work out 17 × 24. TypeSafe’s documentation puts it simply: System One models are “a class of AI models built to make fast, structured decisions that software can use directly.”

System 1

In you: Recognising a friend’s face; “is this email angry?”

In software: Jev: typed judgments in ~100 ms

fast and automaticone focused judgmentreturns a valuecheap to run thousands of times

System 2

In you: Working out 17 × 24; writing a careful letter

In software: Big LLMs: write, explain, reason at length

slow and effortfulopen-endedreturns prose or codecostly per call
Fig. 3 — Two kinds of thinking, two kinds of AI. Most software needs far more System 1 calls than System 2 ones.
04Intermediate

How Jev works

Everything happens through one endpoint, POST https://api.typesafe.ai/v1/systemone. You send two things: the state — the text or JSON to judge — and questions, a map of named, typed questions. Jev reads the state once and answers every question in parallel; the questions can’t see each other’s answers.

One Jev call. Your code sends state — the text or JSON to judge — and a set of named, typed questions. Jev reads the state once and answers every question in parallel, returning a choice with probabilities, a noul probability, and a score with confidence. Your code applies rules and thresholds to decide what happens next.state“Help! My payouts havebeen failing for 3 days.”text or JSON, sent oncequestionsdepartment: Choiceis_urgent: Noulfrustration: Scoremany, in one request⚡ Jevreads once,answers in paralleldepartmentbilling · conf 0.81is_urgentnoul 0.95frustrationscore 1.05 · conf 0.92
Fig. 4 — The shape of one Jev call, using the example from TypeSafe’s API reference.
Terminal — a raw API call
curl https://api.typesafe.ai/v1/systemone \
  -H "Authorization: Bearer $TYPESAFE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jev-latest",
    "state": "Help! My payouts have been failing for 3 days.",
    "questions": {
      "is_urgent": { "type": "noul", "instructions": "Does this convey urgency?" },
      "department": {
        "type": "choice",
        "instructions": "Which team should handle this?",
        "criteria": {
          "billing":   "Payments, invoicing, refunds",
          "technical": "Bugs, outages, integrations",
          "sales":     "Pricing, upgrades, new accounts"
        }
      }
    }
  }'

Three details matter. The question IDs (is_urgent, department) are for your code only and are never sent to the model, so the instructions must carry the full meaning. You pay only for input tokens — at the time of writing $0.042 per million, with output free. And the model version comes back in every response, so you can log exactly which model made each decision.

05Intermediate

Choice, Noul and Score

Every question is one of three types — TypeSafe calls them primitives — and you choose by what the answer means:

Choice

“Pick one from this list”

Which team should handle it?

  • billing0.88
  • technical0.12
  • sales0.00

→ “billing”, confidence 0.81

Noul

“Is this true?”

Does it convey urgency?

0 · no0.5 · can’t tell1 · yes

→ 0.95 (a probability of “yes”)

Score

“Where on this ladder?”

How frustrated is the customer?

  1. 2Very angry0.05
  2. 1Frustrated0.95
  3. 0Calm0.00

→ 1.05, confidence 0.92

Fig. 5 — The three primitives with the answers from TypeSafe’s API example: one choice, one probability, one position on a ladder.
  • Choice — pick one from up to 255 options. Returns the choice, the probability of every option, and a confidence. Always include an “other” or “none” option when nothing may fit.
  • Noul — the probability that a condition is true, from 0 to 1. Crucially, 0.5 means “can’t tell”, not “somewhat”. When several labels can apply at once, ask one Noul per label.
  • Score — a position on 2 to 10 ordered levels, each describing a concrete situation. The answer is a probability-weighted position, so 1.4 means “between frustrated and furious, leaning frustrated”.
06Advanced

Calibration and confidence

The probabilities are the point. Jev is trained to be calibrated: across many predictions, things it gives 0.8 to happen about 80% of the time. That turns uncertainty into something code can act on — which a chatbot’s confident tone never can.

A reliability diagram. Across many predictions, a calibrated model’s points sit on the diagonal: things it gives 70% to happen about 70% of the time. An overconfident model sits below the diagonal: its 90% predictions come true only about 60% of the time.perfect calibrationwhat the model said (probability)how often it was trueillustrativeCalibratedsays 70% → right about 70% of the time.You can set thresholds on it.Overconfidentsays 90% → right about 60% of the time.Sounds sure; can’t be trusted unattended.
Fig. 6 — A reliability diagram, illustrative. Calibration is a property over many predictions; it never guarantees any single answer.

For Choice and Score answers, Jev also returns a confidence: how concentrated the probability distribution is. For a three-option Choice, TypeSafe’s docs give it as:

confidence = ( 3 × pmax − 1 ) / 2

three options, top probability 0.85 → confidence ≈ 0.78 — concentrated, but not certain

A practical way to use it is a traffic light: green, act automatically; amber, act but log; red, send to a person or a bigger model. Where to put the lines depends on what a mistake costs — a refund needs a higher bar than a folder label. Try it:

Playground

Set a threshold on your own data

24 test messages, each with Jev’s Noul for “customer asks for a refund”. At or above the threshold, the app acts automatically; below it, a person reviews.

0.80

10

handled automatically

2

automatic mistakes

14

sent to a person

Fictional data. Raise the threshold and mistakes fall but people do more work; lower it and the reverse. The right setting depends on what a mistake costs you — which is why you tune it on your own examples.

07Advanced

RLCD: training for trust, not charm

How do you train a model to be calibrated? TypeSafe calls its method RLCD — reinforcement learning for calibrated decisions — and positions it as a third kind of post-training, alongside the two behind today’s chatbots.

RLHF

Reinforcement learning from human feedback

Optimises for: answers people prefer

Good at: fluent, helpful chat

RLVR

RL from verifiable rewards

Optimises for: answers a checker marks correct

Good at: maths, code, long reasoning

RLCD

RL for calibrated decisions

Optimises for: probabilities that match real outcomes

Good at: unattended automation

Fig. 7 — Three post-training targets. Each makes a model good at something different.

TypeSafe’s argument, from its machine-learning primer: RLHF — a technique its co-founder Diogo Almeida helped pioneer, according to TypeSafe — optimises for answers people prefer, and that can reward confident-sounding answers over honest uncertainty. In the primer’s words: “An output can be compelling to a person without being reliable enough for unattended automation. Human preference and machine trustworthiness are different optimization targets.”

08Intermediate

Your first app, step by step

Let’s build what the guide builds: a support-ticket sorter that reads a customer message and decides the team, the urgency, whether a refund is requested, and how frustrated the customer is — in one call.

  1. Sign up

    console.typesafe.ai

  2. Playground

    try questions, free of code

  3. API key

    save as TYPESAFE_API_KEY

  4. SDK + code

    one call, many questions

  5. Test & tune

    20–50 real messages

Fig. 8 — From sign-up to a tuned app. Most of the real work is in the last step.
  1. Sign up at console.typesafe.ai with Google or email.
  2. Play first. In the Playground, paste a sample message as the state, add questions, and look at the answers. It is the cheapest place to get your wording right.
console.typesafe.ai — Playground — illustration

State

I was charged twice for my Pro plan this month and I want one of them refunded today, this is the second time!!

Questions

teamChoicebilling · technical · sales · other

refundNoulCustomer asks for a refund

urgentNoulConveys urgency

frustrationScoreCalm · Frustrated · Very angry

▶ Run

Answers · jev-1.13.0 · 96 ms

teambilling conf 0.97

refund0.99 noul

urgent0.93 noul

frustration1.62 conf 0.71

usage: 212 input tokens · output free

Fig. 9 — Illustration of the console Playground: state and questions on the left, typed answers on the right.
  1. Create an API key at console.typesafe.ai/keys and save it permanently in your shell profile:
Terminal — save the key and install the SDK
echo 'export TYPESAFE_API_KEY="paste-your-key-here"' >> ~/.zshrc
source ~/.zshrc

python3 -m venv .venv          # a private Python for this project
source .venv/bin/activate
pip install typesafe-sdk

Your first raw call returns something like this — a real run from the guide:

Terminal — first call
$ bash examples/first_call.sh | jq .
{
  "model": "jev-1.13.0",
  "answers": {
    "is_urgent": { "type": "noul", "noul": 0.99 },
    "department": {
      "type": "choice", "choice": "technical", "confidence": 0.78,
      "probabilities": { "sales": 0.0, "technical": 0.85, "billing": 0.15 }
    }
  },
  "usage": { "input_tokens": 376, "output_tokens": 57 }
}
# 376 input tokens × $0.042 per million ≈ $0.000016 — output is free
Fig. 10 — A real first call: one Noul, one Choice, 376 input tokens — roughly $0.000016.
  1. Ask every question in one call with the Python SDK:
triage.py — the call
from typesafe_sdk import Choice, Noul, Score, TypeSafeClient

TICKET = "I was charged twice for my Pro plan this month. Refund one today please!!"

with TypeSafeClient() as client:            # reads TYPESAFE_API_KEY
    r = client.system_one(
        state={"ticket": TICKET},
        questions={
            "team": Choice(
                instructions="Which team should handle this ticket?",
                criteria={
                    "billing":   "Payment or subscription issues",
                    "technical": "Bugs or integration problems",
                    "sales":     "Pricing or account questions",
                    "other":     "None of the above",
                },
            ),
            "urgent": Noul(instructions="The ticket conveys urgency or time-sensitivity"),
            "refund": Noul(instructions="The customer asks for a refund"),
            "frustration": Score(
                instructions="How frustrated does the customer appear?",
                criteria=["Calm, just stating facts", "Frustrated but civil", "Very angry, strong language"],
            ),
        },
        model="jev-latest",   # pin a versioned ID once you have tuned thresholds
    )
  1. Let code decide. Jev supplies judgments; your code owns the rules, in plain sight:
triage.py — the rules
team = r.choices["team"]
urgent = r.nouls["urgent"].noul
frustration = r.scores["frustration"].score

queue = team.choice if team.confidence >= 0.5 else "human-review"
priority = "P1" if urgent > 0.8 or frustration >= 1.5 else "P2"
refund_flag = r.nouls["refund"].noul > 0.7

print(f"queue={queue} priority={priority} refund_flag={refund_flag}")
# queue=billing priority=P1 refund_flag=True   (sample output)
  1. Test and tune. Run 20 to 50 real messages. Where answers are wrong, sharpen the wording or add a missing option. Set thresholds from your own results, then pin a versioned model ID so answers don’t shift under you.
09Intermediate

Batching and cost

The guide explains the economics with a pizza: ordering thirteen toppings in thirteen separate deliveries means thirteen delivery fees. The document is the fee; the questions are the toppings. Since you pay for input, sending the document once with every question is far cheaper:

separate: N × (D + q)   vs   batched: D + N × q

D = document tokens, N = questions, q = tokens per question — batching saves close to N× when D ≫ q

TypeSafe measured it: 13 questions about the ~54,000-character Wikipedia article on the GDPR came out 12.2× cheaper and 10× faster batched than as separate calls, with the same answers. Play with the numbers:

Playground

What does it cost per month?

The defaults match TypeSafe’s GDPR batching cookbook: an ~11,000-token document and 13 questions.

11,000
13
55
1,000
$5.0
$30.0
  • Big LLM, all questions in one prompt$2,108
  • Jev, one call per question$181
  • Jev, all questions batched$14.76

Batching sends 11,715 tokens per document instead of 1,43,715 — 12.3× fewer.

Jev: $0.042 per million input tokens, output free (TypeSafe’s models page, Sept 2026). The big-LLM line assumes ~30 output tokens per answer at the prices you set — an assumption, not a quote.

Six levers keep costs low, per the guide:

  • 📦 Batch every independent question into one call, including speculative ones for branches you might take.
  • ✂️ Trim the state to named fields — less to pay for, and less to distract the model.
  • 💻 Code first: maths, dates, counting, regex and lookups cost nothing and never get it wrong.
  • 👉 Select: code finds candidates, a Choice picks one — short, and no invented values.
  • 💾 Store raw scores: change weights and thresholds later without paying again.
  • 🪜 Cascade: cheap model first, Jev checks, the expensive model only when flagged.
10Advanced

The layered blueprint

Put it together and a well-designed AI application looks like layers, each doing what it is best and cheapest at:

The layered blueprint. Incoming data is cleaned by code, which also finds candidates. One Jev call makes all the judgments. Code applies rules and thresholds: most cases are done immediately; cases that need writing go to a big language model, optionally checked again by Jev; unsure cases go to a human.📥 Incoming: ticket, email, review, form💻 Code — clean, look up, find candidates⚡ ONE Jev call — route + checks + scores💻 Code — apply rules and thresholds✅ Most cases: donefast and nearly free🧑‍🏫 Needs writingbig LLM → Jev re-checks🙋 Unsurelow confidence → a personcost and time grow left to right — so most traffic should stop on the left
Fig. 11 — The layered blueprint from the guide: code, one Jev call, code — and only the leftovers go to an LLM or a person.

For any single step, one question tells you which layer it belongs to:

Deciding which tool to use. If a simple rule or lookup can do it, use plain code at no cost. If not, and the answer is a pick, a yes-or-no, or a level, use Jev at tiny cost. Otherwise — writing or deep reasoning — use a big language model.Can a rule orlookup do it?yes💻 Plain codemaths, dates, regex — $0noA pick, yes/no,or a level?yes⚡ Jevtyped judgment — tiny costno🧑‍🏫 Big LLMwriting, deep reasoning
Fig. 12 — Code first, Jev for judgments, a big model only for writing and deep reasoning.

Big LLMs still have a job. The guide pictures Jev as the receptionist who sorts every visitor in a tenth of a second, and the LLM as the specialist called only when someone needs a written reply. A “needs a written reply?” Noul decides; the LLM gets a focused prompt with Jev’s decisions already in it; and Jev can check the draft against policy before a person approves it. Because most traffic never reaches the specialist, even a rate-limited free LLM tier can go a long way.

11Advanced

Patterns that compose

TypeSafe’s docs describe these as “units of AI intelligence usable like programming primitives”. The interesting part is how they combine:

Fan-out

Ask every independent question — even speculative ones for branches you might take — in one call.

e.g. Route a request and fill each handler’s arguments at once.

Select, don’t generate

Code finds candidates; a Choice picks the right one. No invented values.

e.g. Regex finds every date in an email; Jev picks the delivery date.

Composite scoring

Score each dimension separately; code weights them. Change weights without re-running the model.

e.g. Résumé fit per skill, weighted by the hiring manager.

Cascade

A cheap model does the work, Jev checks each field, and only flagged items go to an expensive model.

e.g. Invoice extraction with reasoning-model quality at a fraction of the cost.

Verify

Ask whether a claim is supported by its source before showing it.

e.g. Citation checks on an LLM’s answer.

Confidence routing

Use confidence as a second axis: act, act and log, or escalate.

e.g. Auto-refund only when refund and duplicate charge are both clear.

Fig. 13 — Six patterns from TypeSafe’s documentation and cookbooks. Each keeps code in charge and uses judgments where code needs understanding.

Real applications the guide lists include a smart inbox (folder, urgent, spam), app-review analysis (a sentiment Score plus one Noul per topic), search re-ranking (a relevance Score per result), invoice extraction (code finds candidate amounts, a Choice picks the total), fact-checking an LLM’s citations, guardrails on chatbot input and output, and résumé screening with a Score per skill weighted in code.

12Intermediate

The Claude Code skill

You don’t have to design all of this by hand. TypeSafe publishes a skill for coding agents: a briefing that teaches the agent TypeSafe’s design rules and points it at the live documentation before it plans or writes any code. In Claude Code (see our Claude guide):

Terminal — install the skill
claude plugin marketplace add typesafe-ai/skills
claude plugin install typesafe@typesafe-ai

# other coding agents
npx skills add typesafe-ai/skills --skill typesafe-ai

Then invoke it with what you want. Prompts from the guide:

  • /typesafe:typesafe-ai explore this project and find fragile parsing or if/else logic that a judgment could replace
  • /typesafe:typesafe-ai build an App Store review analyzer: sentiment score + one noul per topic
  • /typesafe:typesafe-ai check whether any cookbook matches my code and refactor it
13Beginner

Limits and mistakes to avoid

TypeSafe publishes a candid “jaggedness” page for each model version, listing where it is weak. Knowing these is what separates a demo from a system:

Weak spotIn plain wordsWorkaround
Reads literallyAnswers the words, not what you meantWrite the exact condition; put boundary cases in the criteria
Maths and countingIt isn’t a calculatorDo arithmetic in code; one Noul per item, sum in code
Dates and timesReads them as words, not a timelineExtract the parts, compare in code
Long, noisy stateIrrelevant text distracts itFilter in code first; send named fields
Injected instructionsText in the state can sway itPrecise criteria; test adversarial cases
WritingIt doesn’t generate text at allUse an LLM for prose — Jev decides when
Fig. 14 — Known weak spots of jev-1.13, from TypeSafe’s jaggedness page and the guide, with the standard workaround for each.

And the most common design mistakes:

  • One call per question instead of batching.
  • Reading a Noul of 0.5 as “medium” — it means “can’t tell”; use a Score for degree.
  • Treating confidence as “chance it’s right” — it measures concentration; validate on your own data.
  • Forgetting a “none of these” option, forcing a wrong pick.
  • Copying thresholds from examples instead of tuning on real data.
  • Using jev-latest in production — pin the version you tuned against.
  • Putting the API key in front-end code — call Jev from a server only.

If these ideas seem familiar, they should: the prompting advice in our ChatGPT guide — be specific, give context, check the answer — still applies. TypeSafe’s twist is to make the answer itself something software can check.

14Beginner

Your 30-day path

From your first Playground run to a production pattern.

  1. Week 1 · Feel it

    • Sign up at console.typesafe.ai
    • Try all three question types in the Playground
    • Make one curl call
  2. Week 2 · Build

    • Install the Python SDK
    • Build the ticket sorter
    • Batch every question into one call
  3. Week 3 · Tune

    • Run 50 real examples
    • Set thresholds from your data
    • Pin the model version
  4. Week 4 · Compose

    • Add a cascade or a verify step
    • Let an LLM write only when Jev says so
    • Try the Claude Code skill on your own code
Fig. 15 — Four weeks with TypeSafe. Week three — tuning on your own data — is where most of the value is.

Quick quiz

Tap a question to check your answer.

Q1Why is a typed Choice safer for software than asking a chatbot to “reply with one of these categories”?

A Choice can only return one of the options you supplied, with probabilities and confidence, and nothing to parse — a chatbot can invent a category, break the format or ramble.

Q2A Noul comes back 0.5. What does that mean?

The model can’t tell whether the condition is true — similar probability for yes and no. It does not mean “half true”; for degree, use a Score.

Q3You ask 10 questions about a 5,000-token document, 40 tokens each. Roughly how many input tokens do you pay for batched versus separately?

Batched: 5,000 + 10 × 40 = 5,400. Separately: 10 × (5,000 + 40) = 50,400 — about 9× more.

Q4Which layer should compute “is this invoice overdue by more than 30 days?”

Plain code: it’s date arithmetic, which is free and exact in code and a known weak spot for the model. Jev might help find which date in the text is the due date.

Chatbots taught the world to talk to AI. Typed judgments teach software to use it — quickly, cheaply and with its uncertainty out in the open. Let code do the steps, let Jev make the calls, and save the big models for the work that truly needs them. ⚡

TypeSafe and Jev are products of TypeSafe AI; Claude Code is a product of Anthropic. This article is independent and not affiliated with or endorsed by either. It is based on the unofficial TypeSafe Easy Guide; model facts, prices, API and SDK shapes, the confidence formula, RLCD and the batching benchmark follow docs.typesafe.ai as of 24 September 2026. Claims about TypeSafe’s history are attributed to TypeSafe. The threshold data and big-LLM prices in the playgrounds are illustrative; screens are illustrations. Spotted something out of date? Tell us.