Introduction: The Geometry of Bounded Decisions

In traditional generative pipelines, requesting structured output relies on prompt engineering, constrained decoding filters (e.g., GBNF grammars), or post-hoc validation retries. These methods try to constrain a token-by-token generative model into behaving like a decision function.
Jev, TypeSafe AI's discriminative System 1 model, works differently. It does not output arbitrary text tokens. Instead, Jev evaluates an input state (S) alongside one or more Typed Primitives (Q), yielding discrete probability distributions directly over a declared state space.
Every query to Jev requires defining questions using one of three primitive types: choice, score, or noul.
  1. INPUT STATE (<=64k) → JEV ENGINE
  2. Question: JEV ENGINE → CHOICE; SCORE; NOUL
  3. NOUL, Binary Evaluator, (Single Float) → - noul float [0..1]
  4. noul float [0..1], (No confidence)
  5. CHOICE, Pick 1 of N, (Up to 255 keys) → - choice key
  6. choice key, probabilities map, confidence score
  7. SCORE, Ordered Scale, (2-10 levels) → - float score
  8. float score, probabilities map, legend map, confidence score

Deep-Dive: The Three Primitive Question Types

1. The choice Primitive
The choice primitive handles categorical decisions where the input state must be classified into exactly one discrete option out of a bounded set.
  • Cardinality Limit: Supports between 2 and 255 options per primitive.
  • Input Schema Structure: Requires a criteria JSON map (key-value pairs) where each key represents the typed enum value and the value contains instructions/descriptions defining that key.
  • Returned Fields: Returns the winning choice string, the full probabilities distribution across all options (summing to 1.0), and an aggregated confidence score.
Request Payload Example:
{} JSON
# JSON code goes here
{
  "state": {
    "ticket_text": "I was double billed for my subscription this month on order #TS-8821.",
    "account_tier": "enterprise"
  },
  "questions": {
    "department_route": {
      "type": "choice",
      "instructions": "Assign this ticket to the appropriate operational team.",
      "criteria": {
        "billing": "Inquiries regarding charges, double billing, invoices, or payment disputes.",
        "technical": "Reports of software bugs, API downtime, or technical integration errors.",
        "sales": "Questions about plan upgrades, custom contracts, or enterprise tier seats.",
        "needs_review": "Unclear, ambiguous, or unclassifiable requests."
      }
    }
  }
}
Response Payload Example:
{} JSON
# JSON code goes here
{
  "questions": {
    "department_route": {
      "choice": "billing",
      "probabilities": {
        "billing": 0.92,
        "technical": 0.04,
        "sales": 0.01,
        "needs_review": 0.03
      },
      "confidence": 0.89
    }
  }
}
2. The score Primitive
The score primitive rates an input state along an ordered numeric scale. Unlike choice (which treats keys as independent labels), score informs Jev that the levels are sequentially ordered.
  • Level Constraints: Accepts an ordered array of 2 to 10 criteria levels.
  • Calculation: Jev computes a probability-weighted float across the index levels rather than returning an integer. For example, if a 5-level scale distributes probability heavily across level 1 (0.4) and level 2 (0.6), the resulting score output will be 1.6 .
  • Returned Fields: Returns score (float), probabilities map (indexed by string keys "0", "1", etc.), legend map (echoing criteria descriptions), and a confidence metric.
Request Payload Example:
{} JSON
# JSON code goes here
{
  "questions": {
    "churn_risk": {
      "type": "score",
      "instructions": "Evaluate the customer churn risk based on interaction state.",
      "criteria": [
        "Low Risk: Expressing satisfaction or routine operational queries.",
        "Moderate Risk: Expressing minor dissatisfaction with pricing or feature gaps.",
        "High Risk: Threatening cancellation or requesting data export.",
        "Critical Risk: Explicit account cancellation demands and active executive escalation."
      ]
    }
  }
}
Response Payload Example:
{} JSON
# JSON code goes here
{
  "questions": {
    "churn_risk": {
      "score": 2.15,
      "legend": {
        "0": "Low Risk: Expressing satisfaction or routine operational queries.",
        "1": "Moderate Risk: Expressing minor dissatisfaction with pricing or feature gaps.",
        "2": "High Risk: Threatening cancellation or requesting data export.",
        "3": "Critical Risk: Explicit account cancellation demands and active executive escalation."
      },
      "probabilities": {
        "0": 0.01,
        "1": 0.08,
        "2": 0.66,
        "3": 0.25
      },
      "confidence": 0.81
    }
  }
}
3. The noul Primitive
The noul primitive is Jev's high-speed evaluator for binary assertions. It evaluates whether a statement is true or false relative to the input state, returning a single probability float between 0.0 and 1.0.
  • Optimized Execution: noul is stripped of overhead to maximize throughput and minimize payload size.
  • No Confidence Score: noul returns a single float and omits confidence metrics and probability maps. If your application requires a confidence score for a binary decision, use a 2-level score primitive instead.
Request Payload Example:
{} JSON
# JSON code goes here
{
  "questions": {
    "contains_pii": {
      "type": "noul",
      "instructions": "The input text contains personally identifiable information such as SSNs, credit cards, or passwords."
    }
  }
}
Response Payload Example:
{} JSON
# JSON code goes here
{
  "questions": {
    "contains_pii": {
      "noul": 0.984
    }
  }
}
Comparative Structural Summary
Feature / Characteristic`choice` Primitive`score` Primitive`noul` Primitive
Primary FunctionSelect 1 option from discrete categoriesRate on an ordered scaleEvaluate binary truth statements
Supported Boundaries2 to 255 options2 to 10 sequential levelsSingle true/false evaluation
Primary Value Type`string` (matching key)`float` (weighted scale)`float` (0.0 to 1.0)
Full Distribution Map?Yes (`probabilities`)Yes (`probabilities`)No
Confidence Score Included?Yes (`confidence`)Yes (`confidence`)No
Best Architectural RoleMulti-class routing, Intent classificationRisk scoring, Escalation thresholdsFast guardrails, Boolean flags

Hard Limits & Operational Constraints

  1. Input Context Ceiling (64k Tokens): Jev supports up to 64,000 total input tokens per request. State payload allocation caps at 32,000 tokens, leaving remaining space for primitive schemas and instructions.
  2. Cardinality Ceiling (255 Options): Individual choice primitives cannot exceed 255 keys. For larger sets (e.g., matching across 5,000 product SKUs), developers must use a two-step pattern: candidate retrieval followed by a Jev choice call over top candidates.
  3. Question Independence: All primitives submitted in a single request payload are calculated in parallel against the input state. Questions cannot reference or depend on the output of sibling questions in the same API call.

Next in the Series

With Jev's primitive types and schema rules clarified, the next step is examining how TypeSafe AI trains and optimizes the model for speed, low cost, and reliable performance.