Skip to Content
ModelsJev (TypeSafe)Overview

Jev

TypeSafe Jev is a decision model. It does not generate text; it answers only questions defined in advance. A request provides the content to be evaluated and a set of questions, and the model returns a structured answer with probabilities for each question, so that the application can branch directly on the result.

Use cases

Key pointUse Jev when the application must execute different logic based on a decision; use a chat LLM when text intended for human readers must be generated.

Suitable for:

  • Classification and routing: the team responsible for a ticket, or the category of a user’s intent.
  • Yes/no decisions: whether content contains personal information, is a refund request, or is a prompt injection.
  • Scoring and ranking: urgency, relevance, sentiment intensity, and filtering of retrieval results.
  • Quality control of LLM output: whether a response is on topic or violates a policy.

Not suitable for:

  • Generating text, summaries, translations, or code.
  • Image decisions (Jev accepts only text and JSON input; for image decisions, use GPT-6 Luna).
  • Open-ended questions whose answers cannot be defined in advance as options or levels.

Comparison with a chat LLM plus JSON output:

JevChat LLM + JSON output
Returned valuesLimited to the predefined options or levelsMay return values outside the options; additional validation is required
UncertaintyEach answer includes probabilities; choice and score also include confidenceUsable probabilities are generally not provided
Multiple questionsAnswered together in a single request that shares one inputMust be combined into one prompt or sent as multiple calls
BillingInput tokens only; output is not billedBoth input and output are billed at chat model rates

Quick start

1. Prepare the connection details: Create an API key in the OfoxAI console  and use the following values:

Connection details
Base URLhttps://api.ofox.ai/v1
Model IDtypesafe/jev-latestjev-latest is also accepted
Endpoint/v1/decisionsPOST; /v1/chat/completions is not applicable

2. Install the SDK: When calling through the official OpenAI Python SDK, install a version that includes client.decisions:

Terminal
pip install -U openai
NoteIf AttributeError: 'OpenAI' object has no attribute 'decisions' occurs at runtime, the SDK version is outdated; run the command above to upgrade (openai 3.31.0 has been tested and works). Without the SDK, the API can also be called with the cURL example below.

3. Make the call:

quickstart.py
import os from openai import OpenAI client = OpenAI(base_url="https://api.ofox.ai/v1", api_key=os.environ["OFOX_API_KEY"]) r = client.decisions.create( model="typesafe/jev-latest", input="Customer message: I was charged twice, nobody has answered my two emails, and I need a refund today.", questions=[{"type": "predicate", "name": "is_frustrated", "instructions": "Is the customer frustrated?"}], ) print(r.answers[0].probability) # 0.98

Example response:

{ "model": "typesafe/jev-latest", "answers": [{ "type": "predicate", "name": "is_frustrated", "probability": 0.98 }], "usage": { "prompt_tokens": 302, "completion_tokens": 23, "total_tokens": 325 } }

probability is the probability that the answer is “yes”; 0.98 indicates that the model considers it highly likely that the customer is frustrated. To apply this to a specific use case, replace input with the actual content and questions with the actual questions.

Question types

Select the question type according to the form of the required result:

Required resultQuestion typeFields to provideReturned fields
Yes or nopredicateThe question; optionally criteria defining what “yes” and “no” meanprobability: the probability of “yes”
One of several optionschoicechoices: 2–255 optionschoice, per-option probabilities, confidence
Degreescorelevels: 2–10 levels ordered from low to highscore, per-level probabilities, confidence

Examples: “Is this a refund request?” uses predicate; “Which team should handle it?” uses choice; “How urgent is it?” uses score. All three questions can be placed in the same request, and all answers are returned at once.

After selecting a question type, review the questions and options against Question design.

Common errors

SymptomCauseResolution
AttributeError: 'OpenAI' object has no attribute 'decisions'The OpenAI SDK version is outdatedRun pip install -U openai and retry
400 endpoint_not_supported, with the message Please use /v1/decisions insteadJev was called as a chat model through /v1/chat/completionsCall /v1/decisions instead
400 Invalid request payloadThe TypeSafe native format (state, questions as an object) was used on /v1/decisionsUse input and questions as an array, or call /typesafe/v1/systemone instead
400 questions are required for decisionquestions is emptyProvide at least one question
400 question "a" has kind choice and requires criteria optionsA choice question has no choicesAdd the options
400 Too many score levels. Must have at most 10 levels.A score question has more than 10 levelsMerge levels
400 max_tokens_exceededThe input exceeds 64K tokensSplit long documents, or send only the relevant parts
400, with input_image and Typesafe cannot read in the error messageAn image was sent to JevRemove the image, or use a model that supports images
404 model_not_foundThe model ID is incorrectUse typesafe/jev-latest
The request succeeds, but the answer is clearly wrong and confidence is highThe choice options do not cover the actual caseAdd a “none of the above” option and improve the option descriptions; see Question design
Answers lack name and cannot be matched to questionsThe questions have no nameSet a name for every question

For the complete list of errors, see Decisions API · Common errors.

Official documentation

FAQ

How does Jev differ from having an LLM output JSON?

Jev answers only within the given options and levels and never returns values outside that range. Each answer includes probabilities, and choice and score answers also include confidence, which can be used directly for thresholds. JSON output from an LLM requires additional validation and generally does not provide usable probabilities.

Which should be used, /v1/decisions or /typesafe/v1/systemone?

/v1/decisions is recommended for new projects, as it can be called directly with the OpenAI SDK. Projects that already use the TypeSafe SDK or its official sample code can use /typesafe/v1/systemone, changing only the base URL.

How is Jev billed?

Only input tokens are billed; output is not billed. Rates are listed on the model page. Multiple questions in the same request share one input, so combining questions into a single request reduces cost.

Does high confidence mean the answer is always correct?

Not necessarily. When the options do not cover the actual case, the model still selects one of the available options, and confidence may be high. Choice questions should therefore include a fallback option such as "none of the above", and results should be validated against human-labeled samples.

What does a score of 1.43 indicate?

The score is a probability-weighted value across levels, which are numbered from 0. A value of 1.43 lies between level 1 and level 2, closer to level 1; the probability of each level is given in probabilities.

Is content in languages other than English supported?

Yes. In testing, Chinese content was confirmed to work with questions written in either Chinese or English.

Does Jev support images?

No. Jev accepts only text and JSON. For decisions about images, use GPT-6 Luna (openai/gpt-6-luna), which supports image input and uses the same request format.

Last updated on