Principle:1jehuang Jcode Jev Typed Decisions
| Knowledge Sources | |
|---|---|
| Domains | LLM_Applications, Decision_Systems |
| Last Updated | 2026-10-18 00:00 GMT |
Overview
A typed Decisions API that classifies structured state into typed answers (noul probabilities, choice selections, score rankings) through a single model call, with bounded request size, provider-credential isolation, and built-in answer validation.
Description
Jev Typed Decisions is a classification service that takes a state object and a set of typed questions, and returns typed answers. Unlike chat completions, which produce free text, the Decisions API produces structured answers: noul questions return a probability in [0, 1], choice questions return a selected option, and score questions return ranked level descriptions.
The problem solved is unreliable classification through text generation: using a chat model to classify requires parsing free-text responses, which is fragile and unbounded. The Decisions API produces typed answers that are validated against the question types, so the caller always gets a well-formed response or an error.
The design includes multi-provider routing: the same Decisions API can be served by different providers (Typesafe, OpenRouter, AIMLAPI, Jcode subscription), each with its own credentials and endpoints. Provider selection is automatic (credential-first) or explicit, and never falls back to another account on failure.
Usage
Use this principle when you need a model to make a classification or relevance decision, not generate text. The trigger is: "the application needs a yes/no probability, a best-choice selection, or a ranking — not free text." It is used for: memory relevance scoring, browser action selection, and voice intent classification. It is not appropriate for text generation, code synthesis, or conversation.
Theoretical Basis
The Decisions API contract has three question types:
- noul: A yes/no question. The state and instructions are provided; the answer is a float probability in [0.0, 1.0].
- choice: A multiple-choice question. The criteria object maps option names to descriptions (2-255 options). The answer is the selected option name with a confidence score.
- score: A ranking question. The criteria array provides level descriptions. The answer is a ranking.
Pseudo-code logic:
# Abstract algorithm (NOT real implementation)
def evaluate(state, questions, provider):
# 1. Build request body
body = {
"model": provider.model,
"state": state,
"questions": questions,
}
# 2. Validate request bounds
assert 1 <= len(questions) <= provider.max_questions
assert len(serialize(body)) <= MAX_REQUEST_BYTES
# 3. Send to provider endpoint
response = http.post(provider.endpoint, json=body, auth=provider.key)
# 4. Validate answers
for qid, question in questions.items():
answer = response.answers[qid]
assert answer.type == question.type
if question.type == "noul":
assert 0.0 <= answer.noul <= 1.0
return response
Provider routing follows a priority order: in auto mode, the Jcode subscription (included access) wins, then Typesafe direct, then OpenRouter, then AIMLAPI. Explicit selection never falls back to another account. For the Jcode provider, a live entitlement check (GET /me) verifies the account has the specific capability before each evaluation.