Skip to content

About

a simulated playground along with actual code samples scenario-based examples

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

46 Commits

Folders and files

Repository files navigation

jev-playground

A working engineer's playground for Jev — TypeSafe's System One model.

Runnable cookbooks, a plain-English guide, and sixteen interactive simulations of what a fast, calibrated, typed decision model changes about your architecture — including inside systems you already built around OpenAI, Claude, or Gemini.

Live demos Deploy simulations to Pages No API key needed

▶ Live demos · Cookbooks · The guide · Where it breaks · Setup


See it before you read it

Sixteen interactive simulations, built so a non-technical colleague can follow the flow. No install, no API key, nothing is actually called. Press play, drag a threshold, watch the routing change. Every page links straight to the Python it is built from.

Support tickets flowing through Jev and fanning out to a database lookup, two specialist AI prompts, and a human queue

Customer conversations — messages from people who want something

Simulation What it shows Try
01 Support triage cascade Most tickets never reach an expensive model Drag the confidence floor
07 The shared inbox One mailbox, sorted onto the right desk before anyone opens it Raise the floor, watch the owner's pile grow
04 The second pair of eyes Checking a chatbot's reply before it sends Step through four drafts

Sales and orders — the front of the business

Simulation What it shows Try
05 Scoring while they wait AI inside a form submit, under 200ms Re-weight the formula
08 Orders by WhatsApp Jev judges the message, a regex reads the number Set the bar for acting without a person

Money and paperwork — the back-office grind

Simulation What it shows Try
09 The bill that just arrived Matching a bill against your own open orders Drag the approval limit
10 A month of transactions Calibration as the product: which rows a person still reads Move the floor, watch accuracy move with it

Around the models you already run — screening, checking, routing

Simulation What it shows Try
02 The gatekeeper Screening documents before RAG, injection included Raise the relevance bar
03 The checkpoint Gating an AI agent's tool calls on four hazards Move each hazard limit
06 Picking the right brain Routing across GPT, Claude, Gemini — or no model Watch the split

Agentic systems — Jev making the decisions between LLM agents, one use case per architecture (overview)

Simulation Architecture Try
11 Three desks, one claim Sequential: a gate at every handoff Drag the grounding bar; watch invented facts slip through or get caught
12 Four specialists, one verdict Parallel: Jev plans the fan-out and merges it Toggle "Jev picks" vs "Run all four"
13 The foreman Orchestrator–workers: Jev is the supervisor Raise the confidence floor; shrink the step budget
14 Passing the customer on Router / handoff between agents Drag the handoff margin; watch the ping-pong appear
15 Write, judge, rewrite Evaluator–optimizer: Jev is the rubric Raise the quality bar; watch rounds stop paying
16 The agent on call Tool-calling agent: hazards and the loop Raise the loop bar; the agent re-reads the same logs

Prefer to run them locally? git clone, then open simulations/index.html. The numbers in them are illustrative, not measured.


The rest of this README is written for someone who has to put this in a request path, not someone evaluating a demo.


Table of contents


The one-paragraph version

Jev is deliberately worse than the models you already use. It cannot write. It cannot explain itself. It cannot look anything up. It has no idea what happened in the world after you stopped typing. What it does instead is answer bounded questions about a blob of state — all of them at once, in the time a database returns a moderately complex join. TypeSafe calls the category a System One model, after Kahneman's fast, intuitive System 1, and the pitch aims squarely at the gap between "the demo worked" and "we put it in the request path."

The mental model that makes it click:

A frontier-intelligence function call. Unstructured state in, typed probabilistic decisions out.


Why this is a different shape of model

You have been using a System 2 model to make System 1 decisions. "Which bucket is this?" "Is this urgent?" "Does this passage matter?" Those were never reasoning problems. They got routed through a chat model because a chat model was the only thing available that understood language at all. You paid for that mismatch in latency budgets, retry loops, review queues, and a pile of pilots that worked in the demo and never shipped.

  LLM · System 2 — sequential
  ──────────────────────────────────────────────────────────────────

    prompt ─▶ tok ─▶ tok ─▶ tok ─▶ tok ─▶ "…a string"
                                               │
                                               ▼
                       parse ─▶ validate ─▶ retry on failure

    every token waits for the one before it, then you parse the result


  Jev · System One — parallel
  ──────────────────────────────────────────────────────────────────

                     ┌─▶ Q1 ─▶ choice + probabilities + confidence
    state            ├─▶ Q2 ─▶ score  + probabilities + confidence
    ingested once ───┤
                     ├─▶ Q3 ─▶ noul
                     └─▶ Q4 ─▶ choice + probabilities + confidence

    every question sees the same state, all in one round trip
Existing LLMs System One + Jev
Trained with RLHF / RLVR RLCD — Reinforcement Learning for Calibrated Decisions
Optimizes for Human preference, or verifiable rewards Calibrated decisions: epistemically honest probabilities
Input Unstructured text, emphasis on sequential messages Unstructured text, emphasis on structured program state
Output Strings. Must be parsed and validated. Can be anything — including a hallucination Type-safe structured values. Answer space defined in advance
Sampling Sequential, one token at a time Parallel, all outputs in a single query
Confidence Sounds like confidence Calibrated: higher confidence genuinely means higher accuracy
Best at Chat, copilots, coding agents, verifiable problems, demos Smart if-statements, map-reduce over big data, real-time paths, verifying LLMs

Neither one replaces the other. The interesting systems use both — which is what the cookbooks are about.


Hello, Jev

There is no prompt here in the sense you are used to. There is state — a string, a JSON object, or an array of text — and there are questions, each of which declares its own answer space before the model runs.

from typesafe_sdk import Choice, Noul, Score, TypeSafeClient

client = TypeSafeClient()  # reads TYPESAFE_API_KEY, defaults to jev-latest

response = client.system_one(
    state={
        "ticket": {
            "subject": "Duplicate charge",
            "messages": [
                {"from": "customer",
                 "text": "I was charged twice for order A-104. Please refund the duplicate."},
            ],
        },
        "order": {"id": "A-104", "charges": [
            {"amount_usd": 49, "status": "captured"},
            {"amount_usd": 49, "status": "captured"},
        ]},
        "refund_policy": "Duplicate charges are eligible for a refund.",
    },
    questions={
        "department": Choice(
            instructions="Which team should handle this",
            criteria={
                "billing":   "Payment or subscription issues",
                "technical": "Bugs or integration problems",
                "sales":     "Pricing or account questions",
            },
        ),
        "frustration": Score(
            instructions="How frustrated the customer appears",
            criteria=["Calm, just stating facts",
                      "Frustrated but civil",
                      "Very angry, strong language"],
        ),
        "refund_requested": Noul(
            instructions="The customer is explicitly asking for a refund"),
        "policy_supports": Noul(
            instructions="The stated refund policy covers this situation"),
    },
)

dept = response.answers["department"]
print(dept.choice, dept.confidence)               # "billing" 0.97
print(response.answers["frustration"].score)      # 1.035
print(response.answers["refund_requested"].noul)  # 0.98

One endpoint backs all of it:

POST https://api.typesafe.ai/v1/systemone
Authorization: Bearer <API_KEY>
Content-Type: application/json
The same call in TypeScript — the result type is inferred from your questions
import { choice, noul, score, TypeSafeClient } from "@typesafe-ai/sdk";

const client = new TypeSafeClient();

const response = await client.systemOne({
  state: { document: "I was charged twice. Please fix this ASAP." },
  questions: {
    category: choice("What is this ticket about?", {
      billing:   "Payment or subscription issues",
      technical: "Bugs or integration problems",
      other:     "Anything else",
    }),
    frustration: score("How frustrated the customer appears", [
      "Calm", "Frustrated but civil", "Very angry",
    ]),
    urgent: noul("The message conveys urgency"),
  },
});

response.answers.category.choice;  // "billing" | "technical" | "other" — not `string`

Your editor knows the answer space, because you declared it.

The same call as raw HTTP
curl -X POST https://api.typesafe.ai/v1/systemone \
  -H "Authorization: Bearer $TYPESAFE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "state": "Help! My payouts have been failing for 3 days.",
    "model": "jev-latest",
    "questions": {
      "department": {
        "type": "choice",
        "instructions": "Which team should handle this?",
        "criteria": {
          "billing":   "Payments, invoicing, refunds",
          "technical": "Bugs, outages, integrations",
          "sales":     "Pricing, upgrades, new accounts"
        }
      },
      "is_urgent": { "type": "noul", "instructions": "Does this convey urgency?" }
    }
  }'
{
  "model": "jev-1.13.0",
  "answers": {
    "department": {
      "type": "choice",
      "choice": "technical",
      "confidence": 0.78,
      "probabilities": { "technical": 0.85, "billing": 0.15, "sales": 0.0 }
    },
    "is_urgent": { "type": "noul", "noul": 1.0 }
  },
  "usage": { "input_tokens": 392, "output_tokens": 65 }
}

Three primitives, and only three

The entire API surface is three question types. TypeSafe is explicit that this is the design, not a limitation to route around.

Primitive Asks Returns
Choice Which one of these options? .choice, .probabilities per option, .confidence
Score Where on this ordered spectrum? .score (continuous, can land between levels), .legend, .probabilities, .confidence
Noul Is this statement true? .noul — a single probability from 0 to 1

Choice takes up to 255 options, each costing a few tokens. Because the marginal cost of an option is so low, the guidance inverts the usual instinct to pre-filter: pass the full list of teams, categories, or SKUs rather than a shortlist. Add an explicit other option so the model can say nothing fits, instead of picking the closest wrong thing.

Score takes two to ten ordered levels, described in words rather than numbers. The level index comes from array order, so level 0 is the first entry. The returned score is continuous — 1.035 means "just past the second level." That continuity is the useful part: you can threshold in code at a granularity the levels themselves don't express.

Noul — TypeSafe's coinage for a probabilistic boolean — returns a bare number and, notably, no confidence field. There is nothing to add: the number already is the belief.

Pick the type whose answer your code can act on directly

flowchart TD
    Q["What shape is the answer?"]
    Q -->|"one of a known, unordered set"| C["<b>Choice</b><br/>maps onto branches"]
    Q -->|"a position on a spectrum<br/>you can describe in words"| S["<b>Score</b><br/>maps onto a threshold"]
    Q -->|"a clean yes/no where the<br/>probability itself is the signal"| N["<b>Noul</b><br/>maps onto an if-statement"]
Loading

A Noul of 0.5 means the model gives yes and no equal probability. It does not mean "medium." If you want to measure a level, use a Score with defined levels.

Ask one thing per question

Ask for a judgment a knowledgeable person makes in a second, given the right context.

  • ✅ "Does this message convey urgency?"
  • ❌ "Analyze this message and determine the best course of action."

If the judgment depends on several independent factors, ask each factor separately and combine the answers with your own logic. Instead of "rate this startup pitch", ask about market size, technical feasibility, and differentiation, then weight them in code. When priorities shift you change a coefficient, not a prompt.


Why parallel sampling is the whole story

Here is the architectural claim, and everything else follows from it.

An autoregressive model generates one token at a time, each conditioned on every token before it. That sequential dependency is what lets an LLM write an essay — and it is also what makes it slow, because you cannot compute token n+1 until token n exists. Ask an LLM ten questions in one prompt and it answers them in sequence; the tenth answer waits for the first nine.

Jev gives up string generation and, with it, the sequential dependency. It ingests the state once and evaluates every question against it in parallel, in a single query.

The practical consequence is a rule that will feel wrong for about a day:

Ask everything up front.

Adding a question barely changes response time, and costs only the tokens for that question. TypeSafe calls this speculative fan-out. Its cookbook reports that batching a 13-question regulatory briefing over a long article into one call is 12.2× cheaper and 10.0× faster than asking one at a time, with identical answers.

response = client.system_one(
    state=ticket,
    questions={
        "category": Choice(
            instructions="Broad category of this ticket",
            criteria={"bug_report":      "Something is broken or erroring",
                      "billing":         "Charges, invoices, refunds",
                      "feature_request": "Asking for new functionality",
                      "account":         "Login, permissions, security"}),

        # Only meaningful if it IS a bug report. Ask anyway — it is nearly free.
        "bug_severity": Score(
            instructions="How severe is the reported issue",
            criteria=["Cosmetic; no impact",
                      "Degraded feature; workaround exists",
                      "Blocking; no workaround"]),
        "has_repro": Noul(instructions="The user describes steps to reproduce"),

        # Only meaningful if it IS billing. Ask anyway.
        "refund_wanted": Noul(
            instructions="The user explicitly asks for a refund or credit"),
    },
)

a = response.answers
if a["category"].choice == "bug_report":
    if a["bug_severity"].score > 1.5 and a["has_repro"].noul > 0.6:
        escalate_to_engineering(ticket_id, severity="high")
    else:
        add_to_bug_backlog(ticket_id)
elif a["category"].choice == "billing" and a["refund_wanted"].noul > 0.7:
    start_refund_flow(ticket_id)

You are no longer designing a conversation. You are designing a query plan — and the branch selection happens in your code, on data that is already local, with zero additional round trips.

Context works accordingly: jev-1.13 allows 64k tokens for the state and all questions combined, and 32k for the state plus the single longest question, because the state is ingested once and the questions run against it. Each question is evaluated independently, so adding questions does not create context rot between them.


"Cannot hallucinate" is a claim about the output space

This gets misread most often, so be precise about it.

The claim is not that Jev is never wrong. It is that Jev cannot return something outside the answer space you declared. A Choice returns one of your keys. A Score returns a number bounded by your levels. A Noul returns a float in [0, 1]. There is no code path that produces a fabricated option, a malformed JSON object, or a key you did not define — the sampler is constrained to the space, rather than being asked politely to stay inside it.

TypeSafe is refreshingly direct about the epistemics: schema matching is guaranteed, so the 0% type-error figure in their charts "is not empirical" — it is a structural property, and a single counter-example would falsify it. The comparison numbers for LLMs come from OpenRouter traffic, which they flag as carrying routing bias.

Why this matters more than it sounds: a hallucinated tool call in an interactive agent is an annoyance a human notices and corrects. The same failure buried four layers deep in a dependency chain, behind a latency guarantee, at three in the morning is an incident. Retry-and-validate loops paper over it at the cost of exactly the tail latency you were protecting. Removing the failure mode from the type system is categorically different from making it rarer.

What Jev can still be is wrong within the space — confidently routing a ticket to billing when a person would have said technical. Which is why the second half of the design exists.


Confidence is control flow, not telemetry

Ask a chat model for its confidence and you get a number that sounds like confidence. Models optimized on human preference tend to be overconfident and inconsistent, because assertive text reads better to a rater than hedged text. That failure is subtle and expensive:

If a model can do a task 95% of the time but cannot tell you when it is in the 5%, you cannot automate that task. You review all of it, and the review cost eats the saving.

Jev is trained with RLCD — Reinforcement Learning for Calibrated Decisions — which optimizes probabilities against outcomes rather than against preference. The target is epistemic honesty: higher confidence should genuinely mean higher accuracy.

Two caveats the docs state plainly, and you should hold onto:

  1. Calibration is a population property. It does not promise any individual answer is right.
  2. confidence is a derived statistic, computed from the probability distribution the answer already carries. Concentrated distribution → high confidence; flat → low. You always get the raw probabilities, so if TypeSafe's definition isn't the measure you want, compute your own.

A flat distribution is a diagnostic, not just a number. It usually means the options weren't distinguishable from the state you provided — more often a defect in your criteria than confusion in the model.

Thresholds are a risk decision, not a config value

Once confidence is trustworthy in aggregate, it stops being telemetry and becomes control flow. The pattern that actually changes your architecture: one threshold per action, scaled to what being wrong costs — not one global threshold for the system.

action = response.answers["action"]

if action.confidence < 0.5:
    route_to_human(user_message)            # floor: the model says it does not know

elif action.choice == "check_balance":
    show_balance(account_id)                # read-only; wrong screen is recoverable

elif action.choice == "approve_transfer":
    if action.confidence > 0.9:             # moves money; irreversible
        confirm_then_execute(account_id)
    else:
        ask_user_to_confirm(account_id)

else:
    route_to_human(user_message)

Note what happened to the code review. Risk tolerance is no longer buried in a prompt a non-engineer edited last quarter. It is a numeric literal next to the action it guards, in a file with a git history.

Pin your version

Aliases move. jev-latest resolves to jev-1.13.0 today, and the answers behind an alias can change without a change on your side.

client = TypeSafeClient(model="jev-1.13.0")   # pin, don't drift
Alias Points to Meaning
jev-latest jev-1.13.0 Most recent stable release. SDK default.
jev-preview jev-1.13.0 Most recent release, official or not.

The response's model field reports the versioned ID that actually answered — log it.


The numbers, and how much weight to put on them

Jev (jev-1.13) Frontier LLMs
End-to-end latency 70–500 ms 3–329 s
Input price $0.042 / MTok $0.20–$10 / MTok
Output price free ~5× input
Sampling parallel, single pass sequential, token by token
Structured-output errors 0% by construction 0.58%–45.5% (OpenRouter)
Rate limits 250k tokens/sec, 1,200 req/min varies
Context 64k total; 32k state + longest question varies
Input modalities text only (string, JSON object, array) often multimodal

TypeSafe's headline claims of 193.6× faster and 444.6× cheaper come from its own workflow evaluations, in which every model gets the same compute graph and is scored against the average of two frontier models as a reference. The methodology is more honest than most launch benchmarks — it evaluates models inside a workflow rather than on a leaderboard classification task, which is the right unit of analysis — and the company lists its own biases: the reference answers skew toward the two vendors used as ground truth, and the workflows were authored by its own capabilities team.

The correct engineering response is neither credulity nor dismissal. These are vendor-reported, self-run, not yet independently reproduced. They are a strong reason to run a shadow evaluation on your own traffic, and no reason at all to change a production threshold before you do.

Two more things worth flagging honestly. Jev is in early access with a waitlist, and TypeSafe says rate limits are adjusting dynamically while it serves launch demand — a real dependency consideration for anything production-bound. And the published evidence is young and largely self-reported. That is not a reason to ignore it. It is a reason for your shadow period to be longer than you would like.


Where it breaks

TypeSafe publishes a jaggedness page for jev-1.13 — a documented list of its own failure modes — which is a better signal about the team than any benchmark on the page. Read it before your design review, not after your incident.

# Failure mode Do this instead
1 Literal reading. Scoping words, negations and implied conditions are taken at face value. Write the exact condition. Put boundary cases in the criteria. When you explain what you really meant, that explanation is the missing half of your instruction.
2 Math and numbers. Counting and arithmetic are unreliable. Numeric representations underperform semantic ones (color names beat hex values). Keep arithmetic in code. Convert to semantic buckets first, then ask the judgment question.
3 Dates and times. Read as text, not as ordered quantities. Extract components with a Choice over enumerated options — twelve months, thirty-one days — and compare in code.
4 Indirection. A property of a property, or a double negative, is measurably worse. Reduce hops. Name the relevant part of the state directly, in backticks.
5 Context rot. Accuracy falls as the state fills with material the question doesn't need. Retrieve and filter in code first. Send only the fields the question uses.
6 Adversarial content. State is not treated as hostile. Text written to steer its own classification can move the answer. Write precise criteria, test edge cases, treat it as defence in depth — not a perimeter.
7 Contradictory instructions and criteria. A Noul whose true maps to "no" performs worse. Treat criteria as an extension of the instruction. Align the two.
8 Structural invariants don't hold. A Noul and a yes/no Choice on the same question return numbers that are not interchangeable, and a Noul and its negation do not sum to 1. Ask each decision one way. Never carry a threshold tuned on one primitive over to the other. Enforce identities in code.
9 Generation. It is not trained to produce text. Use a generative model. That's what the cookbooks are for.
Why #8 surprises people — the actual numbers from the docs

"Is the customer asking for a refund?" on the ticket "I'm not happy with the fit. What are my options here?"

Noul value Choice P(yes) Choice P(no) Choice confidence
0.22 0.01 0.99 0.97

The same question and its negation, as two separate Nouls, on "I was charged twice for the same order. Can someone look into this?"

refund not_refund Sum
0.72 0.47 1.19

A Choice is relative — which option wins. A Noul is absolute — and can be low for every option. They are answering different questions.

Every one of these points the same direction:

Keep the deterministic work in code, and give the model only the part that is genuinely a judgment. That is not a workaround. It is the programming model.


Cookbooks: Jev + your existing LLM

The highest-value pattern is not replacing your LLM. It is deciding which requests deserve one. Each cookbook in cookbooks/ is a runnable script with built-in sample inputs, a cost table, and a clearly marked boundary between the Jev part and the frontier-model part.

flowchart LR
    IN["request"] --> JEV{{"Jev<br/>70–500ms<br/>$0.042/MTok"}}
    JEV -->|"high confidence,<br/>simple"| CODE["plain code<br/><i>no model at all</i>"]
    JEV -->|"needs language"| LLM["GPT / Claude / Gemini<br/><i>narrow prompt, right tier</i>"]
    JEV -->|"low confidence"| HUMAN["human review"]
    LLM --> VERIFY{{"Jev<br/>verify the output"}}
    VERIFY --> OUT["ship it"]
    VERIFY -->|"ungrounded"| HUMAN
Loading

Patterns that sit around the models you already run:

# Cookbook What it combines The point
01 Support triage cascade Jev → code | specialist LLM | human One branch never touches a model. Two load different specialists — a narrow prompt beats a general one. One escalates honestly.
02 RAG gatekeeper Jev filters passages → Claude/GPT answers A Noul per passage is cheaper than the tokens you'd spend feeding it to a frontier model to find out it was irrelevant. Also catches prompt injection in retrieved text.
03 Tool-call gating Jev gates every tool call in an OpenAI/Anthropic agent loop Four independent judgments, one round trip, a fraction of a cent, inside the latency budget of the call it guards.
04 LLM output verifier LLM generates → Jev judges before it ships Grounding, citation checking, policy, tone. The generator and the judge should not be the same model.
05 Real-time scoring Jev in the request path → LLM only for the top tier AI inside a user-facing request, where a three-second model call was never an option. Weights live in your code, with a diff and a test.
06 Cross-provider router Jev picks GPT vs Claude vs Gemini vs nothing Route by what the task needs, not by which key you configured first. Re-weighting is a code change.

Patterns for a business that does not have an AI team — the sorting work someone is currently doing by hand, every day:

# Cookbook What it combines The point
07 The shared inbox Jev routes → template | LLM draft | a person Six judgements on every message in info@. The confidence floor is the owner's "when in doubt, ask me", written down as a number.
08 Orders by WhatsApp Jev judges → a regex parses → code reconciles Jev has no "extract a number" primitive, and that is a feature. It says whether a quantity is there; a regex says what it is; disagreement routes to a human.
09 Bills and invoices Jev matches against your open orders → LLM chases "Does this bill match something we ordered?" is a question about your data, not about language. Your ledger goes into the call as state.
10 Bank transactions Jev categorises at scale → LLM writes the month-end note The one where calibration is the product — and the one cookbook that ships a calibration_report() to check the confidence number against your own history before trusting it.

Start here: cookbooks/README.md


Agentic systems: Jev between the agents

A multi-agent system is LLM agents doing the work, plus a stream of small decisions between them: is this output good enough to pass on, who goes next, does this conversation belong to another agent now, is it done, is it looping. Most frameworks hand those decisions to another LLM writing a string. Each one is a typed, calibrated question, which is exactly Jev's shape — and it fits every common architecture, not just one.

LLM agents do the work. Jev makes the decisions between them. Your code holds the thresholds.

# Architecture Cookbook What Jev decides What stays in code
11 · ▶ Sequential Insurance claim: intake → assessor → letter grounded, complete and stage-specific checks at every handoff Retry once with feedback named by the failing check; stop the line
12 · ▶ Parallel Vendor due diligence: four specialists Which specialists to run; severity and evidence of each finding Contract-value rules; the merge rule
13 · ▶ Orchestrator–workers Bug fix: researcher, coder, tester, reviewer next_agent, last_output_ok, stuck, needs_external_action — one call per step Confidence floor, step budget
14 · ▶ Router / handoff Travel assistant: concierge, flights, hotels, refunds Topic probabilities, mid_task, wants_human, frustration A handoff margin, so agents don't pass the customer back and forth
15 · ▶ Evaluator–optimizer Product copy: writer ⇄ rubric Five rubric questions, each with its own bar "Done" is a line of code; the feedback text; the round budget
16 · ▶ Tool-calling agent Incident response Hazards of each call plus repeats and resolved about the loop Per-hazard bars; nudge once, then stop
# The same four lines sit between the agents in all six.
while not finished(state):
    a = jev.system_one(state=compact(state), questions=DECISION).answers  # small state in, typed answers out
    branch = policy(a, THRESHOLDS)                                        # plain code, readable bars
    state = AGENTS[branch].run(state)                                     # an LLM does the work

The worker agents call whichever provider key you have set, and fall back to scripted sample output when none is set, so every agentic cookbook's Jev half runs with only TYPESAFE_API_KEY.

Be careful about the same things in all six: send the decision a compact state (task, last output, step count — not the transcript), ask one judgement per question, treat agent output as untrusted input that can try to steer the router, and calibrate the bars on your own logged runs before trusting them.

Overview page: Agentic systems: where Jev sits

The shape they all share

# 1. CODE assembles the state. Precisely. Only what the question needs.
state = build_state(request)

# 2. JEV makes the judgments. All of them, in one call.
answers = client.system_one(state=state, questions=QUESTIONS).answers

# 3. CODE owns the control flow, the thresholds, and the side effects.
if answers["needs_generation"].noul > 0.7 and answers["route"].confidence > 0.8:
    # 4. The LLM does the one thing only an LLM can do.
    reply = llm.generate(SPECIALISTS[answers["route"].choice], state)

Whatever assembles the state decides what the model is allowed to know. Pad it and you lose accuracy; ground it in a weak source and you get a beautifully calibrated judgment about bad material.


Running the demos locally

The demos at the top are served from GitHub Pages. To run them from a checkout instead — offline, or to change one:

git clone https://github.com/exponen-agi/jev-playground.git
open jev-playground/simulations/index.html      # macOS
xdg-open jev-playground/simulations/index.html  # Linux
start jev-playground\simulations\index.html     # Windows

No build step, no package install, no keys. Each page is plain HTML with a small shared stylesheet and a 37 KB D3 bundle vendored into simulations/assets/, so nothing is fetched at runtime.

Note that GitHub renders .html as source, so opening a simulation file in this repo shows markup rather than the page — use the live links or a local checkout. simulations/README.md covers the structure and how to rebuild the D3 bundle.


Setup

git clone https://github.com/exponen-agi/jev-playground.git
cd jev-playground

python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

cp .env.example .env    # then add your keys

You need a TYPESAFE_API_KEY (join the waitlist). The frontier-model keys are optional — every cookbook runs its Jev half without them and tells you which half it skipped.

python cookbooks/01_triage_cascade.py
Variable Needed for
TYPESAFE_API_KEY everything
AUTOJEV_BACKEND, AUTOJEV_LLM_MODEL optional: answer with an LLM instead of Jev
OPENAI_API_KEY cookbooks 01, 03, 04, 06
ANTHROPIC_API_KEY cookbooks 02, 03, 04, 06
GOOGLE_API_KEY cookbook 06

Answering with an LLM instead of Jev

The cookbooks get their client from one place, cookbooks/_shared/clients.py. Set AUTOJEV_BACKEND to openai, anthropic or gemini (plus AUTOJEV_LLM_MODEL, an exact model name, and that provider's key) and the same system_one(state=, questions=) calls are answered by an LLM through system-one-adapter (pip install 'system-one-adapter[openai]'). Leave it unset and nothing changes: Jev answers. The LLM's probabilities are not Jev's, so confidence thresholds tuned for one do not transfer. This is the same switch AutoJEV uses.

Letting your coding agent write the integration

TypeSafe ships an agent skill so Claude Code, Codex, and friends know the exact request and response shapes:

# Claude Code
claude plugin marketplace add typesafe-ai/skills
claude plugin install typesafe@typesafe-ai

# Other agents
npx skills add typesafe-ai/skills --skill typesafe-ai

Not sure which primitive your problem needs?

AutoJEV is a Claude Code plugin built on the patterns in this repo. Describe a decision in plain words (/autojev should we auto-approve this expense claim?) and it reads your project, works out whether the problem is a yes/no gate, a multiple choice, a score or a cascade, shows you the alternatives it weighed, and builds a tested Jev decision engine. No API key is needed to build or test it. It keeps the engine recalibrated as your project changes, until you run /autojev-stop.


How to pilot this without betting anything

A sober adoption path, in order:

  1. Pick one decision. High volume, low stakes, currently made by either an LLM call or a regex-and-hope rule. Ticket categorization and RAG passage filtering are the usual first wins.
  2. Shadow it. Run Jev alongside the incumbent. Log both answers plus Jev's confidence, and change no behavior at all for a week or two.
  3. Build the calibration curve. Bucket by confidence, measure accuracy per bucket on your own labelled data. This is the deliverable. It tells you where your automation threshold goes, and it is the artefact that gets sign-off from whoever owns the risk.
  4. Automate the top band only. Leave everything else on the existing path. Expand the band as the evidence supports it, not as the enthusiasm does.
  5. Pin the version once thresholds are tuned, and re-run the curve before moving.
  6. Keep the arithmetic in code. Every time you are tempted to ask the model to count, compare dates, or compute a magnitude — that is the jaggedness page telling you where the bug will be.

Why this is more interesting than another model release

Strip away the numbers and the argument underneath is architectural: most of the decisions inside software are System 1 judgments, and we have been renting System 2 to make them.

Jev is one vendor's early-access bet on that thesis, with numbers that need independent verification. The thesis itself looks durable regardless of whether this particular model is the one that wins: the interface between AI and software should be a typed function call with an honest probability attached, not a string you hope parses.

The naming is a tell. Jev is named for William Stanley Jevons, whose paradox observed that making coal-fired engines more efficient increased coal consumption rather than reducing it. TypeSafe expects the same of machine intelligence: every order-of-magnitude fall in the cost of a decision unlocks orders of magnitude more decisions worth making.

If they are right, the interesting question is not what you can make cheaper. It is which decisions you never automated because, until now, each one cost a tenth of a cent and three seconds too many.


This is an independent, unofficial playground. Not affiliated with TypeSafe AI. All figures are as published by TypeSafe in September 2026 and are vendor-reported unless stated otherwise — verify on your own traffic before you rely on them.

Code and docs in this repository are released under the MIT License.

About

a simulated playground along with actual code samples scenario-based examples

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages