Tech Wiki

TOPICSSERIES

TypeSafe AI Jev quickstart: typed decisions without text generation

Unstructured text flowing into typed choice, score, and probability outputs

TypeSafe AI’s Jev does not generate an answer for a person to read. It evaluates questions whose possible outputs are defined in advance, then returns choices, scores, or yes/no probabilities that application code can use directly. That shape fits ticket routing, risk screening, and other workflows where the result feeds an if statement rather than a chat window.

The control flow stays in ordinary code. Jev handles narrow judgments over unstructured input; the application owns deterministic rules, side effects, permissions, and escalation. Giving up free-form generation reduces output parsing and schema drift, but it does not make the underlying judgment infallible.

How Jev differs from an LLM with JSON output

A general-purpose LLM can classify a support ticket and return JSON. It is still generating a string, though, so the caller has to parse and validate that string.

A Jev request separates the input into two parts:

  • state: the content and supporting data to evaluate
  • questions: narrow judgments to make about that state
  • response: values constrained by the declared types, plus probabilities and confidence where applicable

Questions that share a state can travel in one request. They are evaluated independently, so one answer does not become hidden context for another. If a decision depends on several factors, the intended pattern is to ask one focused question per factor and combine the results in code.

The three question types

Type Use it for Main result
Choice Selecting one member of a fixed set selected value, probability distribution, confidence
Score Rating against ordered, described levels score, legend, probability distribution, confidence
Noul Estimating whether a statement is true noul, the probability of yes

A Noul value near 0.5 means the model assigns similar probability to yes and no. It does not represent a medium level of a property. Use Score when the requirement is a spectrum such as severity or proficiency.

Build a ticket classifier with the Python SDK

The Python SDK requires Python 3.10 or newer. Create an API key in the TypeSafe console and keep it in an environment variable.

uv add typesafe-sdk
export TYPESAFE_API_KEY="your-api-key"

This example asks three questions about one support ticket in a single system_one call.

from typesafe_sdk import Choice, Noul, Score, TypeSafeClient

state = {
    "ticket": (
        "I was charged twice and cannot complete new orders. "
        "Please refund the duplicate charge."
    )
}

questions = {
    "department": Choice(
        instructions="Which team should handle `ticket`?",
        criteria={
            "billing": "Payments, invoices, or refunds",
            "technical": "Bugs or service outages",
            "other": "None of the listed categories",
        },
    ),
    "frustration": Score(
        instructions="How frustrated is the customer in `ticket`?",
        criteria=[
            "Calm and factual",
            "Frustrated but civil",
            "Blocked or using strong language",
        ],
    ),
    "is_urgent": Noul(
        instructions="Does `ticket` contain an urgent or time-sensitive request?",
    ),
}

with TypeSafeClient() as client:
    response = client.system_one(state=state, questions=questions)

print(response.answers["department"].choice)
print(response.answers["department"].probabilities)
print(response.answers["frustration"].score)
print(response.answers["is_urgent"].noul)

The object construction and response access match TypeSafe’s official Python SDK 0.7.0. A live inference call still requires a TypeSafe account and API key, and the returned values depend on the input and resolved model version.

Treat confidence as a routing input

Type-correct output is not the same as a correct judgment. Jev cannot return a department outside the supplied options, but it can select the wrong option. Confidence and probabilities should control how far automation is allowed to proceed.

answer = response.answers["department"]

if answer.confidence < 0.70:
    queue_for_human_review(state)
elif answer.choice == "billing":
    route_to_billing(state)
else:
    route_to_general_queue(state)

The 0.70 threshold is illustrative. Tune thresholds against labeled examples from the real workload and account for the different costs of false positives and false negatives. Refunds, account locks, outbound messages, and other hard-to-reverse actions still need authorization checks and approval controls outside the model.

Current model, pricing, and limits

As documented in September 2026, the stable model is jev-1.13.0, and the jev-latest alias resolves to it. Input costs $0.042 per million tokens; output tokens are free.

The documented default limits are 250,000 tokens per second and 1,200 requests per minute. A request has a 64k-token total context limit, with a separate 32k limit for the state plus the longest question. TypeSafe says these rate limits can change during early access, so production deployments should check the model endpoint and current documentation rather than hard-code them as permanent capacity.

Jev accepts text only. Images, audio, and video need preprocessing into text or structured fields. English is its primary training language. The documentation says CJK and other languages are supported but not equally strong, which makes a workload-specific evaluation set necessary before using it for Korean or other non-English traffic.

Where it fits

Jev is a reasonable candidate when the allowed answers can be defined ahead of time:

  • support routing and priority scoring
  • comparing a request with a policy
  • document classification and risk screening
  • combining several narrow scores with application-owned weights

It is not a replacement for text generation. Email drafting, summarization, report writing, and code generation still need a generative model. Tasks that require long chains of reasoning should be decomposed into smaller judgments or paired with an LLM rather than forced into one broad question.

TypeSafe AI’s practical distinction is constraint, not greater agent autonomy. The application defines the answer space before the model runs. That is useful when a predictable interface matters more than open-ended generation. The open question is performance on your own data: vendor latency and cost figures are worth investigating, but accuracy, calibration, and threshold stability on a representative evaluation set should decide whether the model belongs in the production path.

Related articles

Sources


Leave a Reply

Your email address will not be published. Required fields are marked *

Tech Wiki

Built with WordPress · Learn in public.