Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:1jehuang Jcode Jev Typed Decisions

From Leeroopedia
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:

  1. noul: A yes/no question. The state and instructions are provided; the answer is a float probability in [0.0, 1.0].
  2. 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.
  3. 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.

Related Pages

Implemented By

Uses Heuristics

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment