A System One model called Jev does not generate text. It accepts program state and typed questions, then returns choices, scores, and probabilities that code can use immediately. The tutorial covers the official Python SDK, a single call using three question types, how state structure affects answers, batching ten questions into one request, and building production patterns like confidence-gated routing and typed function calling. The final section adds Pydantic response models, async fan-out with asyncio, retry policies, typed errors, and a running ledger that tracks costs.
In this article
Installation and setup
The code installs the typesafe-sdk, pinned to version 0.7.0, and loads the API key from the environment. It checks Colab’s Secrets tab first, then prompts the user if the key is missing. The TypeSafeClient reads the key automatically and defaults to the jev-latest model. A helper function wraps the main call to record timing and token usage in a ledger. The ledger tracks total calls, input tokens, and output tokens. The input token price is set at 0.042 USD per million tokens. Output tokens are free. The code prints the SDK version, Python version, and lists available models for the current key.
Three primitives in one call
A single request to the model can handle three different question types simultaneously. Choice selects one label from a set of criteria and returns a probability for each option. Score places the input on an ordered rubric, returning a weighted score between levels. Noul returns a single probability that a statement is true. The question names are local to the code and do not reach the model. Instructions within the request carry the full meaning and can reference nested fields using backticked paths. The example ticket involves a duplicate charge for order A-104. The customer message states they were charged twice this year. The support reply says they are checking the charges. The order data shows two captured charges of 49 USD each. The refund policy states duplicate charges are eligible for a full refund within 30 days. The code asks which team should handle the ticket, how frustrated the customer appears, if a refund was requested, and if the policy supports the request.
State shapes and token costs
The model relies entirely on the provided state. The tutorial tests one question over three different state formats. A bare string contains only the customer complaint. An array adds the full conversation history. A JSON object includes the ticket, order details with charges, and the refund policy. The question remains identical across all three tests. The output probability changes based on the state structure. The object format provides the most context, including the policy and charge amounts. The token count increases with the complexity of the state. Named fields are recommended when the context contains multiple parts, as instructions can then refer to specific fields by name.
What it means
Developers move from prompting for text to prompting for data. The system returns structured outputs that programs can read directly without parsing. A single API call handles multiple logic branches. Batching questions reduces overhead. The ledger tracks actual usage and cost. The approach treats the model as a deterministic component within a larger system rather than a free-form chatbot.




