| Dimension | Specification / Ground Truth | Engineering Significance |
|---|---|---|
| Core Paradigm | System 1 Latent AI (Intuitive, non-generative) | Returns typed values and probabilities directlyβzero token generation. |
| Inference Latency | 70 ms β 500 ms (Cloud API P50 ~150 ms);< 1 ms (Local PyTorch /jevlike ) |
5Γ to 20Γ faster than Chat LLMs; local runs enable 60 FPS real-time loops. |
| Token Pricing | $0.042 / 1M input tokens ; output tokens100% Free ($0.00) | 200Γ cheaper than frontier LLM outputs; responses use predefined schema slots. |
| State Context Limit | 32,768 tokens (32k) | Context boundary for unstructured inputs (diffs, tickets, traces). |
| Primitives | Choice (1β255),Score (continuous scalar),Noul ($P(\text{true})$) |
Minimal, orthogonal type system covering all discrete and scalar judgments. |
| Training Objective | RLCD (Reinforcement Learning for Calibrated Decisions) | Statistically calibrated confidence: when confidence is 0.90, it is right ~90% of the time. |
| Safety Invariant | Schema-safe by construction; not infallible | Impossible to hallucinate invalid keys or syntax; can still choose wrong option (needs thresholding). |
| Deployment / APIs | β’ Cloud API: TypeSafe SDK & OpenRouter ( /api/alpha/decisions )β’ Local Reimplementation: jevlike (PyTorch) |
Cloud for scalable backend triage; local weights for sub-millisecond edge/game loops. |
Every backend system routinely needs quick, deterministic judgments on messy, unstructured real-world data:
- Which support queue should handle this ticket?
- Is this git diff introducing a breaking API change?
- Does this database query exhibit SQL injection patterns?
- Are these two customer profile records describing the same human?
Software engineering has addressed this through three distinct evolutionary phases:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β THE EVOLUTION OF SOFTWARE DECISIONS β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββ€
β Era β Mechanism β Primary Bottleneck β
βββββββββββββββββββββββββΌββββββββββββββββββββββββββββββΌββββββββββββββββββββββββ€
β 1. Brittle Keyword β Regex, substring matching, β Semantic blindness; β
β β hardcoded rule trees β combinatorial sprawl β
βββββββββββββββββββββββββΌββββββββββββββββββββββββββββββΌββββββββββββββββββββββββ€
β 2. Chat LLM + β Autoregressive generation + β High latency (1-3s), β
β Structured Outputs β grammar constraint masks β high cost, fake 100% β
β β β confidence β
βββββββββββββββββββββββββΌββββββββββββββββββββββββββββββΌββββββββββββββββββββββββ€
β 3. Jev (Latent AI) β Direct latent evaluation β None for System 1: β
β β into calibrated primitives β 150ms, \$0.042/1M, β
β β β calibrated confidence β
βββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββ
if "refund" in text.lower() or "money back" in text.lower():
route_to_billing()
elif "login" in text.lower() or "password" in text.lower():
route_to_auth()
Why it fails: Real users write*"I'd like my previous charge reversed"* (missed keyword $\rightarrow$ unhandled) or*"My credit card won't save in profile settings"* (falsely routed to billing $\rightarrow$ actually a frontend bug). #
The outcome: A 500-line spaghetti monster of regex patterns and negative lookaheads that nobody understands and everyone is terrified to touch.
Developers replaced fragile regex with generative LLMs (GPT-4o, Claude 3.7). But asking a conversational chatbot for a classification produced a polite 40-word essay instead of a routing key.
To remedy this, LLM providers introduced Structured Outputs (JSON Schema mode / grammar-constrained decoding).
Important
Category Error Alert: Structured Outputs solves the syntax problem (guaranteeing valid JSON conforming to a schema). It does NOT solve the runtime, economic, or decision problems:
The Runtime Barrier (Sequential Latency): Structured Outputs still uses autoregressive generation. The model must sample and emit opening braces, field keys, quotes, colons, and closing braces token-by-token. A simple classification takes800 ms to 3,000 ms .
2.
The Economic Barrier (Wasted Cost): Output tokens are billed at premium rates ($10.00β$15.00/1M tokens). You pay high fees for formatting characters and syntax that your application immediately strips away.
3.
The Decision Problem (Uncalibrated Certainty): LLMs are pre-trained on text completion and fine-tuned via RLHF to sound agreeable, articulate, and confident. When constrained to emit{"dept": "billing"} , the model outputs that key with identical syntactic certainty whether it is 99% confident or taking a wild 51% guess. It lacks calibrated uncertainty and cannot cleanly signal*"I don't know."*
No. They solve completely different problems using opposite physical mechanisms:
- OpenAI / ChatGPT Structured Outputs (Syntax Enforcement):
ChatGPT is fundamentally anautoregressive language generator . When you pass a JSON Schema, OpenAI runs a grammar-constrained token mask over the model's vocabulary during generation. The model is still sequentially generating text token-by-token:
{,\n,",d,e,p,t,",:,",b,i,l,l,i,n,g,",}.- The Latency Penalty: Emitting 20β40 formatting tokens sequentially takes800 ms to 3,000 ms .
- The Calibration Blindspot: The model was trained with RLHF to sound articulate and confident. When it outputs
"dept": "billing", it outputs that JSON key with the exact same syntactic certainty whether it is 99% confident or taking a wild 51/49 coin-flip guess.
- Jev (Direct Latent Decision Engine):
Jev hasno autoregressive token generation loop . It passes your unstructured context through transformer layers once, then reads the decision directly off dedicated classification heads in a single forward pass.
- Zero Token Generation: No braces, colons, quotes, or formatting tokens are emitted. Runtime is**~150 ms** (cloud) or**< 1 ms** (local).
- True Calibrated Probabilities: Jev doesn't just emit
"billing"; it emits{ "billing": 0.94, "auth": 0.04, "unclear": 0.02 }. When it reports0.94confidence, statistical calibration (RLCD) guarantees it is correct ~94% of the time.
Developers never wanted a conversational assistant in their backend routing loops. They wanted frontier machine intelligence as a typed, calibrated function call: unstructured text goes in; typed scalar values and mathematically calibrated probabilities come out.
π‘ Rule of Thumb:
Use Structured Outputs when you need an LLM to generate new text or objects (e.g., generating a full customer report with structured metadata). Use Jev when you need to judge, score, or categorize existing state.
β οΈ Pitfall to Avoid:
Confusing syntax validity with decision certainty. A schema-constrained LLM emitting valid JSON can still be hallucinating or guessing wildly without giving you any probability signal.
π Notebook Takeaway:
Structured Outputs solved the syntax problem (valid JSON). It did not solve the operational problems (latency and cost) or the decision problem (calibrated confidence and knowing when the AI is guessing).
In Thinking, Fast and Slow, Nobel laureate Daniel Kahneman demonstrated that human cognition operates across two distinct cognitive modes:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HOW MINDS AND AI OPERATE β
ββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ€
β System 1 (Fast & Intuitive) β System 2 (Slow & Deliberate) β
ββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ€
β β’ Ducking when a baseball is thrown β β’ Calculating 47 Γ 83 mentally β
β β’ Recognizing a friend's face β β’ Planning an optimal travel route β
β β’ Detecting anger in an email tone β β’ Writing a legal contract or essay β
β β’ Instant gut judgment (sub-second) β β’ Step-by-step reasoning in words β
β β’ Emits a decision, not an essay β β’ Emits sequential argumentation β
ββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ€
β JEV'S EXCLUSIVE DOMAIN β CHAT LLM DOMAIN (GPT-4o, Claude) β
ββββββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββ
- Generative LLMs are System 2 Machines: They deliberate by generating words sequentially. Chain-of-thought prompting is an explicit simulation of System 2 verbal reasoning. This is essential for synthesizing essays, writing multi-file software patches, and solving complex mathematical deductions.
- Jev is Built for System 1: It models the instant, intuitive gut judgment an expert engineer or operator makes in 2 seconds without having to draft an essay explaining why.
In production software architectures, over 90% of automated decisions do not need conversational prose or reasoning traces. They need:
- A boolean flag (Is this urgent? )
- A scalar rating (How severe is this bug from 1 to 10? )
- A categorical route (Which queue handles this? )
Running a heavy System 2 conversational model for a pure System 1 decision is massive architectural overkill.
π‘ Rule of Thumb (The Kahneman Test):
If an expert human can look at the input and make the decision in 2 seconds without writing down intermediate steps, it belongs in System 1 (Jev). If the expert needs scratch paper, multi-step logic, or paragraph synthesis, it belongs in System 2 (Generative LLM).
β οΈ Pitfall to Avoid:
Forcing Jev to solve multi-hop logic riddles or complex algorithmic puzzles that inherently require intermediate scratchpads. System 1 evaluates latent perception, not sequential proofs.
π Notebook Takeaway:
LLMs reason by generating words token-by-token (System 2). Jev executes the instant 2-second latent judgment of an expert without generating text (System 1). Backend logic almost always needs a typed return value, not conversational filler.
Jev is a hosted frontier model with a fundamental physical distinction: it contains no autoregressive text generator.
Chat LLM (Autoregressive):
[Input Tokens] ββ> [Transformer Layers] ββ> [Token 1] ββ> [Token 2] ββ> [Token N]
β² β
ββββββββββββββ (Loop: 800ms - 3,000ms)
Jev (Non-Generative Latent):
[State Context] ββ> [Frontier Transformer] ββ> [Latent State] ββ> [Classification Heads]
[Typed Questions] β
βΌ
Strictly Typed Values +
Calibrated Probabilities (70ms - 500ms)
Input Payload: An unstructuredstate string (up to 32,768 tokens) alongside one or more structuredquestions .
2.
Latent Pass: The model processes the state through its transformer layers in a single pass.
3.
Direct Emission: Output values (Choice ,Score ,Noul ) are projected directly from the final latent representations into dedicated output heads.
4.
Performance: Execution finishes in70 to 500 milliseconds (P50 around 150ms).
5.
Economics:****$0.042 per 1M input tokens . Output tokens are100% free ($0.00) because the response structure is fixed and zero autoregressive text generation occurs.
Developers often ask: βIs Jev a local weight file I run on my GPU or a cloud service?β
- Official Jev (Hosted Cloud API):
Official Jev is aclosed-weights US cloud API hosted by TypeSafe AI (and accessible via OpenRouter's
/api/alpha/decisions).- **Latency:**70 ms β 500 ms (P50 ~150 ms). The bulk of this latency is typical Internet network transit and TLS handshakes, not model inference.
- Best For: Backend web services, microservice routing, async background workers, CI/CD pipelines, and high-throughput enterprise ingestion where you want zero server management.
- Local Reimplementations (
jevlike): Projects likejevlikeare open-source PyTorch architectures that train latent decision heads on local models directly on your hardware.- Latency:****< 1 ms (sub-millisecond).
- Best For: Real-time robotics, frame-by-frame game loops (such as an AI agent navigatingDoom at 60 FPS), high-frequency financial signals, or air-gapped systems where network egress is prohibited.
Conversational LLMs are aligned using RLHF (Reinforcement Learning from Human Feedback), which inadvertently rewards models for sounding confident, authoritative, and agreeable even when hallucinating.
Jev was trained using RLCD (Reinforcement Learning for Calibrated Decisions):
- Loss functions optimize strictly proper scoring rules (e.g., Brier score, log loss).
- When Jev reports a confidence of
0.85, it is statistically guaranteed to be correct approximately 85% of the time across a large test distribution. - When input state is ambiguous, contradictory, or insufficient, probability spreads evenly across options, and reported confidence drops toward zero.
- The Engineering Breakthrough: Calibrated confidence enables deterministic branching. Your software can trust the AI when confidence is high, and automatically route to human review when confidence drops.
A critical engineering distinction must be preserved:
| Concept | What It Means | Jev's Guarantee |
|---|---|---|
| Type Safety | Output strictly matches the requested schema structure. | 100% Guaranteed by Construction. It cannot output illegal keys, invalid types, or malformed JSON. |
| Infallibility | The chosen answer is factually correct. | NOT Guaranteed. An AI can select the wrong category from your valid list. |
Caution
"Cannot hallucinate" does not mean "cannot be wrong." Jev will never hallucinate a 4th category if you provided 3. But it can still misclassify an ambiguous input. This is why confidence thresholding is mandatory in production.
π‘ Wait, what about...? If Jev "cannot hallucinate," why do I still need Confidence Thresholding? (The Forced Choice Trap)
If Jev is strictly type-safe and mathematically unable to emit illegal keys or malformed JSON, why can't backend code simply trust whatever option it returns?
Because of The Forced Choice Trap:
Imagine your system uses Choice to categorize incoming customer support tickets into three departments:
["billing", "technical_support", "account_recovery"].
Now, imagine an ambiguous, irrelevant, or spam ticket arrives:
"Can you recommend a good recipe for sourdough bread?" (or noisy garbage like Error code 0x8FA120...).
What does Jev do mechanically?
- The model evaluates the input state and calculates a normalized probability distribution across the candidate choices.
- Because it is a closed probability distribution, all candidate options must sum to 100% (
1.0). - The model is mathematically forced to distribute probability across your three options , even if none of them make sense! It might assign:
"billing":0.37"technical_support":0.33"account_recovery":0.30
- If your software blindly reads
response.choice, it sees"billing"(the bare argmax winner) and routes a bread recipe directly into the billing team's priority queue!
The model did not hallucinateβ"billing" is a valid option in your schema. But the model was forced to guess.
team = response.choice # Might be a 37% coin-flip guess on irrelevant noise!
route_ticket(team)
if response.confidence >= 0.85 and response.choice != "unclear":
route_ticket(response.choice)
else:
route_to_human_triage(ticket, reason="Low confidence or ambiguous category")
Confidence thresholding is the mechanical safety valve that protects your architecture against forced guesses. Without checking confidence, your code treats the bare winner of a 37%-33%-30% split as an absolute, 100% ground-truth decision.
- **Maximum State Context:**32,768 tokens (32k) . Exceeding this triggers an HTTP 400 error (
max_tokens_exceeded/context_length_exceeded). - Maximum Choices: Up to255 options per
Choicequestion. - Zero Output Token Billing: Fixed response schema means you never pay for output tokens.
π‘ Rule of Thumb:
Treat Jev's confidence score as an actionable risk metric: confidence $\ge 0.80$ allows full automation; confidence $< 0.80$ triggers human-in-the-loop escalation or secondary fallback.
β οΈ Pitfall to Avoid:
Passing state inputs larger than 32k tokens without pre-filtering. Jev does not perform document chunking for you; truncate or extract relevant sections first.
π Notebook Takeaway:
"Can't hallucinate" only guarantees schema validity, not factual perfection. Jev's true superpower is RLCD calibrated confidence, allowing deterministic code to isolate and escalate low-confidence cases before they cause silent bugs.
Jev replaces open-ended text with exactly three orthogonal primitives:
ββββββββββββββββββββββ
β Jev Primitives β
ββββββ¬βββββ¬ββββββ¬βββββ
βββββββββββββββββββββββββββββ β βββββββββββββββββββββββββββββ
βΌ βΌ βΌ
ββββββββββββββββ βββββββββββββββ βββββββββββββββ
β Choice β β Score β β Noul β
ββββββββββββββββ€ βββββββββββββββ€ βββββββββββββββ€
β Pick 1 from β β Continuous β β Truth value β
β 1 to 255 β β rating on β β P(true) β
β options β β anchor scaleβ β [0.0, 1.0] β
ββββββββββββββββ βββββββββββββββ βββββββββββββββ
| Primitive | Underlying Data Type | Primary Use Case | Key Return Fields |
|---|---|---|---|
Choice |
Categorical string | Routing, taxonomy classification, triage | choice ,probabilities ,confidence |
Score |
Continuous float | Quality ratings, risk assessments, severity | score ,legend ,probabilities ,confidence |
Noul |
Probability float $[0.0, 1.0]$ | Verification, boolean assertions, guardrails | noul |
Think of Choice not as an abstract JSON schema, but as a multiple-choice ballot or a group of mutually exclusive radio buttons on a web form:
- Exactly one option is selected: Just like clicking a radio button, the system must commit to a single discrete winner from your predefined list (from 1 up to 255 options).
- The probabilities share a single pie: Every candidate option is assigned a slice of probability, and all slices sum to exactly 100% (
1.0). - The escape hatch is mandatory: If you present three radio buttons on a ballot (
[Database, Auth, Frontend]) and none apply, the voter isphysically forced to click an incorrect button unless you provide an escape hatch option like"Other"or"Unclear".
Choice(
instructions="Identify the primary subsystem responsible for this issue",
criteria={
"database": "Connection pooling, slow queries, deadlocks, migrations",
"auth": "OAuth tokens, login sessions, SSO, permissions",
"frontend": "UI rendering, CSS layouts, client-side bundle crashes",
"unclear": "Logs are ambiguous or insufficient to determine subsystem" # <-- ESCAPE HATCH!
}
)
Returned JSON Payload:
{
"type": "choice",
"choice": "database",
"confidence": 0.94,
"probabilities": {
"database": 0.94,
"auth": 0.03,
"frontend": 0.01,
"unclear": 0.02
}
}
Under the hood, choice selection relies on a normalized probability distribution across all provided criteria. If a user submits an irrelevant query (e.g., "How do I bake bread?") and your choices only contain database, auth, and frontend, the model is mathematically forced to pick one of them.
- Requirement: Always provide an explicit escape hatch key:
"other","none_of_the_above", or"unclear".
A very common architectural question:
"Why do I need Score? Can't I just define a Choice with ['low', 'medium', 'high', 'critical']?"
Yes, you can! Both primitives can evaluate urgency. But they produce fundamentally different data structures that serve completely different engineering needs:
| Dimension | Using Choice for Priority |
Using Score for Priority |
|---|---|---|
| Output Data Type | Discrete categorical string (e.g., "high" ) |
Continuous decimal scalar (e.g., 3.82 ) |
| Primary Software Purpose | Filtering & Dropdowns: Storing a tag in a relational database (WHERE priority = 'high' ). |
Sorting & Dynamic Queues: Ordering an active work queue (ORDER BY urgency DESC ). |
| Resolution in Queues | Ties everywhere: If 50 tickets are marked"high" , they all look identical. Which one does the on-call engineer open first? |
Zero ties: Ticket A is3.05 (barely high), while Ticket B is3.95 (on the brink of critical). Ticket B floats to the very top. |
| Downstream Math | None. You cannot average strings ( "medium" + "high" / 2 is undefined in Python). |
Arithmetic. You can calculate moving averages, SLA decay curves, and composite formulas in code. |
π‘ The Rule of Thumb:
If you need a dropdown label to store in a database or trigger a hard if/elif branch, use Choice.
If you need a numerical slider to sort an active queue or do arithmetic, use Score.
Evaluates continuous quality or severity along ordered semantic anchors.
Score(
instructions="Rate the operational urgency of this production incident",
criteria=[
"1 - Low: Cosmetic glitch with negligible user impact",
"2 - Medium: Partial degradation; functional workaround exists",
"3 - High: Core business flow blocked; significant customer impact",
"4 - Critical: Full outage, widespread data corruption or security breach"
]
)
Returned JSON Payload:
{
"type": "score",
"score": 2.78,
"confidence": 0.89,
"probabilities": {
"1": 0.01,
"2": 0.28,
"3": 0.64,
"4": 0.07
},
"legend": { ... }
}
The returned score is not clamped to integers. Jev computes the expected value over the latent anchor probabilities:
- A score of
2.0represents exactly "Medium". - A score of
2.78indicates that the incident exhibits all the hallmarks of "Medium" but is rapidly tipping toward "High".
π‘ Wait, what about...? What does "Semantic Interpolation" actually mean? (Hint: It's NOT String Interpolation!)
When software engineers hear the word "interpolation," they immediately think of String Interpolation:
name = "Alice"
greeting = f"Hello, {name}!" # Injecting a variable into a string template
In Jev, interpolation comes from mathematics and computer graphics (like linear interpolation or lerp): finding a smooth, continuous position on a slider between known endpoints (e.g., sliding between 0.0 and 10.0).
- "Semantic" = Meaning.
- "Interpolation" = Finding a continuous point between reference anchors.
So Semantic Interpolation means Jev places the meaning of your input on a continuous slider between your anchor descriptions:
[ 1: Low ] ββββββββββββββ [ 2: Medium ] ββββββββ²ββββββ [ 3: High ] ββββββββββββββ [ 4: Critical ]
β
Incident Score: 2.78
If anchor 2 is "Partial degradation; functional workaround exists" and anchor 3 is "Core business flow blocked; significant customer impact":
- A score of
2.00means it matches anchor 2's description exactly. - A score of
2.78means the incident exhibits the workaround of Medium, but the customer fallout is heavily spilling over toward High. - Jev does not clamp or round to the nearest integer. It computes the expected value across the latent probability distribution of your anchors, giving your code an analog, high-resolution measurement of real-world meaning.
In computer science and mathematics:
- A scalar is asingle, individual number that represents magnitude along a scale (like temperature $72.4^\circ$, vehicle speed $65\text{ mph}$, or body weight $175\text{ lbs}$).
- A vector or array is anordered collection of multiple numbers (like
[0.12, -0.45, 0.89]or a 1536-dimensional embedding).
When we say Jev returns a scalar, we mean it condenses an entire unstructured, messy 500-line document (a support thread, a crash log, or a git diff) down into one single floating-point number.
Because it is a scalar, your software doesn't need to parse complex JSON objects or traverse listsβyou can immediately use standard numerical operations:
if incident.score >= 3.5: trigger_oncall_page()tickets.sort(key=lambda t: t.urgency_score, reverse=True)daily_avg = sum(review.score for review in reviews) / len(reviews)
Evaluates whether a specific declarative proposition is true based exclusively on the state. Named as a shorthand for truth-value assertions ($P(\text{true}) \in [0.0, 1.0]$).
Noul(instructions="The author of this message expresses an explicit intent to cancel their subscription.")
Returned JSON Payload:
{
"type": "noul",
"noul": 0.962
}
Unlike Choice and Score, Noul has no separate confidence field. The probability itself encodes both the answer and the model's uncertainty:
0.98: High confidence TRUE.0.02: High confidence FALSE.0.50:Maximal uncertainty (coin flip) . The state does not contain sufficient evidence to affirm or deny the statement.
Never phrase a Noul as a question:
- β Wrong:
Noul(instructions="Is this user angry?") - β
Correct:
Noul(instructions="The user's message contains hostile, aggressive, or abusive language.")
π‘ Rule of Thumb:
Use Noul when you need a single binary verification signal ($P(\text{true})$). Use Choice when selecting among multiple mutually exclusive buckets. Use Score when measuring intensity on a spectrum.
β οΈ Pitfall to Avoid:
Leaving out the escape hatch in Choice questions. Without "other" or "unclear", out-of-distribution inputs force false positives.
π Notebook Takeaway:
Choice picks 1 from $\le 255$ options (always include "other"). Score continuously interpolates between descriptive anchors (2.8 is valid and meaningful). Noul returns a single float $P(\text{true})$ where 0.50 is an explicit coin flip.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β JEV ARCHITECTURAL PATTERNS β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Pattern β Architectural Purpose β
ββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 1. Speculative Fan-Outβ Ask 20 questions in 1 call; filter in code β
β 2. Three-Way Branch β Confident A / Confident B / Escalate to Human β
β 3. Composite Scoring β Combine atomic 2-second scores via weighted math β
β 4. Hybrid Sandwich β Surround slow LLMs with Jev pre- and post-guards β
ββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
In conversational LLMs, packing 20 classification questions into a single prompt triggers prompt distraction, attention dilution, and high token costs.
In Jev, all questions evaluate in parallel over the state during a single latent pass:
State (3,000 tokens) ββββ¬βββ> Question 1 (subsystem) ββββ> "database" (0.95)
ββββ> Question 2 (severity) ββββ> 3.42 (0.91)
ββββ> Question 3 (has_pii) ββββ> 0.02
ββββ> Question 4 (churn_risk)ββββ> 0.88
[ Evaluated in a single ~150ms HTTP pass ]
- The Economics: Adding questions increases input token count negligibly ($0.042/1M tokens). Round-trip network latency is your primary bottleneck.
- Best Practice: Ask for every question youmight need in a single pass, then use deterministic application code to filter what matters.
Calibrated confidence enables safe, automated triage without human fatigue:
team_answer = response.answers["team"]
severity_answer = response.answers["severity"]
if team_answer.confidence >= 0.85 and team_answer.choice == "billing":
auto_route_to_billing(ticket)
elif team_answer.confidence >= 0.85 and team_answer.choice == "auth":
auto_route_to_auth(ticket)
else:
route_to_human_triage_queue(
ticket,
reason=f"Low confidence ({team_answer.confidence:.2f}) or ambiguous category"
)
Important
Build the human queue first. If your architecture does not provide a destination for uncertain classifications, developers will inevitably lower the confidence threshold, reintroducing silent misclassifications into production.
Never ask Jev one giant, subjective question like:
- β
Score("Is this code review high quality?")
Instead:
Apply the Two-Second Test: Break the question down into atomic components that an expert could judge in 2 seconds.
2.
Decompose into orthogonal questions: - Score("Rate the cognitive complexity of the diff")
Noul("The change introduces unit tests covering the new branch logic")Score("Rate architectural coupling with existing modules")
Combine via weighted arithmetic in code: $$\text{QualityScore} = (0.40 \cdot \text{Correctness}) + (0.35 \cdot \text{TestCoverage}) - (0.25 \cdot \text{Complexity})$$
- The Operational Benefit: When business requirements shift, you adjust a numerical coefficient in code and run automated unit testsβyou don't waste days re-prompting an LLM.
Deploy Jev as a high-speed pre-filter and post-verifier around expensive System 2 LLMs:
User Input ββ> [ JEV PRE-FILTER (100ms) ] ββ> Flagged injection / irrelevant? ββ> Early Reject
β
βΌ (Clean & Relevant)
[ GENERATIVE LLM (2,000ms) ] ββ> Drafts detailed text / code
β
βΌ
[ JEV POST-VERIFIER (100ms) ] ββ> Noul: "All claims grounded in state?"
β
βββ (Noul >= 0.90) ββ> Emit to User
βββ (Noul < 0.90) ββ> Route to Human Review / Regenerate
- Pre-Routing: Filter 100 database tables down to the 3 relevant tables before constructing the LLM prompt.
- Inline Guardrails: Detect prompt injection, PII, or policy violations in 100ms before triggering expensive models.
- Post-Verification: Verify that generative output is factually grounded in the source text before returning it to the user.
π‘ Rule of Thumb:
Never let an expensive System 2 generative model touch unvetted user input directly. Place a 150ms Jev guardrail in front of it.
β οΈ Pitfall to Avoid:
Asking compound, multi-part questions inside a single primitive. Keep instructions laser-focused on one atomic property.
π Notebook Takeaway:
Fan out 20 questions in one round-trip (questions are cheap, round-trips are slow). Always build the human queue first to catch low-confidence cases. Use composite scores in code rather than one vague prompt.
βββββ
β 1 β THE "BEGGING PROMPT" SMELL
βββββ Spending 50 prompt tokens pleading: "Output valid JSON only, no markdown fences, no chit-chat."
Why it's a smell: Using a conversational simulator for a typed data serializer.
βββββ
β 2 β THE "THROWAWAY OUTPUT" SMELL
βββββ An LLM generates 60 words and your backend code does: if "approved" in resp.lower():
Why it's a smell: Paying high latency and cost to generate 59 discarded tokens.
βββββ
β 3 β THE "SILENT HALLUCINATION" SMELL
βββββ An LLM emits {"category": "security"} with 100% syntactic certainty when guessing wildly.
Why it's a smell: RLHF models lack calibrated probability distributions.
βββββ
β 4 β THE "GROWING REGEX" SMELL
βββββ A 250-line ladder of if/elif substring and regex checks that breaks whenever users use synonyms.
Why it's a smell: Manually hardcoding a semantic ontology that AI solves natively.
βββββ
β 5 β THE "BILL SHOCK" SMELL
βββββ Running 100,000 classification requests per day through GPT-4o costs thousands of dollars monthly.
Why it's a smell: 100k requests on Jev costs ~$0.40/day.
Does this task require writing
original prose, code, or synthesis?
/ \
YES NO
/ \
Use Generative LLM Can candidate options or
(GPT-4o, Claude) scales be defined in advance?
/ \
YES NO
/ \
USE JEV Decompose into
(System 1) Atomic Questions
| Operational Criterion | Chat LLMs (GPT-4o, Claude) | Structured Outputs Mode | Jev System 1 |
|---|---|---|---|
| Typical Latency | 1,500 ms β 5,000 ms | 800 ms β 3,000 ms | 70 ms β 500 ms |
| Input Cost (per 1M) | $2.50 β $5.00 | $2.50 β $5.00 | $0.042 |
| Output Cost (per 1M) | $10.00 β $15.00 | $10.00 β $15.00 | $0.00 (100% Free) |
| Output Guarantee | Unstructured text | Guaranteed JSON syntax | Guaranteed typed primitive |
| Uncertainty Signal | Anecdotal / Overconfident | Overconfident JSON keys | Statistically calibrated (RLCD) |
| Primary Domain | Creative synthesis / essays | Structured data extraction | High-speed triage & scoring |
-
Synchronous API Gateways: Request-time routing, bot detection, feature gating.
-
Triage & Classification: Support ticketing, bug categorization, PR assignees.
-
Continuous Quality Loops: Scalar code review (
jev-review), compliance auditing. -
High-Throughput Ingestion: Security log categorization, malware sandbox triage.
-
Pairwise Verification: Entity deduplication, record matching, semantic assertion checks.
Text / Prose Generation: Drafting emails, summarizing articles, authoring documentation. #
Multi-Step Deductive Proofs: Math calculations or logic puzzles requiring scratchpad tokens. #
Unbounded Selection ($>255$ Choices): Picking 1 item from 50,000 inventory items (use vector search first). #
Network Microsecond Routing: Sub-millisecond packet filtering requires eBPF or C, not AI models.
π‘ Rule of Thumb:
If the application writes to a user, use an LLM. If the application branches to another function or queue, use Jev.
β οΈ Pitfall to Avoid:
Using Jev as a database lookup replacement. If you have exact ID lookups, use a relational database or key-value store, not AI.
π Notebook Takeaway:
If you find yourself begging an LLM for JSON or regexing one word out of a paragraph, switch to Jev immediately. If you need original paragraphs written, stay on a generative LLM.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β JEV PRODUCTION CASE STUDIES β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β System β Architectural Impact β
ββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 1. jev-review β 19 quality dimensions evaluated across 57 questions β
β 2. Malware Triage β 50,000 samples analyzed daily for ~$3.50/day total β
β 3. Entity Resolution β Two-stage pipeline: BM25 candidate block + Jev Noul β
β 4. Local Game Loops β jevlike PyTorch runs in <1ms for 60 FPS Doom agents β
ββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Traditional AI code review prompts an LLM to write long narrative critique essays. Developers find these essays verbose, repetitive, and difficult for automated tooling to act upon.
The Jev Architecture:
- Runs as an MCP (Model Context Protocol) server.
- Takes the current git diff and repository context as
state. - Evaluates 19 distinct software dimensions (Correctness, Complexity, Modularity, Coupling, Test Coverage) across57 atomic questions in parallel.
- Provides coding agents with a scalar feedback loop : $$\text{Implement} \longrightarrow \text{Validate} \longrightarrow \text{Score} \longrightarrow \text{Inspect Deltas} \longrightarrow \text{Improve} \longrightarrow \text{Rescore}$$
- Agents track concrete score movement (e.g.,
Cognitive Complexity: 4.2 β 8.1) rather than parsing prose essays.
A security pipeline receives 50,000 suspicious binaries and process execution logs daily. Passing these logs to GPT-4o would cost over $250/day with severe rate-limiting bottlenecks.
The Jev Architecture:
- Static features (PE headers, entropy, suspicious API imports) and sandbox traces are concatenated into a structured state string.
- A single Jev call evaluates:
1.
verdict:Choice("clean", "pua", "malicious", "unclear")2.threat_severity:Score("Negligible to Critical")3.has_persistence:Noul("Binary writes to auto-start run keys or startup services")
Performance & Cost: - Throughput: 50,000 evaluations completed in parallel.
- Total daily cost: ~$3.50/day (compared to $250.00+ on commercial LLMs).
- High-confidence malicious files are automatically quarantined; ambiguous files route to reverse engineers.
Standard string matching (Levenshtein, Jaro-Winkler) fails when entities use completely different aliases (e.g., threat actors "APT29" vs. "Cozy Bear" vs. "Nobelium").
The Jev Architecture:
Stage 1 (Candidate Blocking): Local vector search or BM25 retrieves the top 3 candidate records in 5 ms. #
Stage 2 (Jev Pairwise Verification): State contains Record A and Record B: #
is_same_entity :Noul("Both records describe the exact same real-world corporate entity") #
relationship :Choice("identical", "subsidiary", "unrelated", "unclear") #
- Records with $P(\text{same}) \ge 0.92$ are merged automatically. Ambiguous records ($0.40 \le P \le 0.91$) are assigned to human data stewards.
While the official cloud API excels at ~150ms backend triage, real-time interactive loops cannot wait for Internet latency. At 60 frames per second, a new frame renders every 16.6 millisecondsβa 150ms cloud call means the AI acts 9 frames behind reality.
The Local Jev Architecture:
- Runs an open-source PyTorch reimplementation (
jevlike) locally on the workstation GPU/CPU. - Direct memory buffers (game frame features, player health, ammo counts) are fed into the latent transformer layers in memory.
- High-speed action heads evaluate discrete actions (
Choice:"turn_left","fire","strafe_right") inunder 1 millisecond (< 1 ms) . - Proves that the System 1 non-generative paradigm scales from cloud triage down to local, sub-millisecond edge robotics and game agents.
π‘ Rule of Thumb:
When dealing with high volume ($>10,000$ items/day), always separate candidate generation (fast local index) from candidate verification (Jev System 1). If you need sub-millisecond real-time actions, run local weights (jevlike).
β οΈ Pitfall to Avoid:
Passing thousands of candidates to Jev in one call. Use vector/BM25 indexing to narrow down to 2β5 candidates, then let Jev verify pairwise.
π Notebook Takeaway:
Jev shines in high-volume, high-throughput verification loops: scalar code reviews, malware triage for $3.50/day, pairwise entity deduplication, and sub-millisecond local game loops.
pip install typesafe-sdk
python
import os
from typesafe_sdk import TypeSafeClient, Choice, Score, Noul
client = TypeSafeClient()
incident_state = """
SYSTEM INCIDENT REPORT:
Service: Payments-Worker
Region: us-east-1
Event: Database connection timeout spikes to 45% of all incoming requests.
Error: 'FATAL: remaining connection slots are reserved for non-replication superuser connections'
Impact: Customer checkout flows are failing intermittently.
"""
response = client.system_one(
state=incident_state,
questions={
"routing_team": Choice(
instructions="Identify which engineering team owns this incident",
criteria={
"dba": "Database administration, connection pooling, PostgreSQL configuration",
"frontend": "Web checkout page, UI form errors, JavaScript exceptions",
"billing": "Stripe charges, invoice generation, discount codes",
"unclear": "Insufficient log information to make an unambiguous routing decision"
}
),
"urgency_rating": Score(
instructions="Rate the operational urgency of this production incident",
criteria=[
"1 - Low: Internal or cosmetic issue with no revenue impact",
"2 - Medium: Partial degradation with functioning retries",
"3 - High: Severe disruption impacting active revenue transactions",
"4 - Critical: Total platform outage or irrecoverable data loss"
]
),
"requires_page": Noul(
instructions="This incident requires immediate off-hours on-call engineer paging."
)
}
)
team_ans = response.answers["routing_team"]
urgency_ans = response.answers["urgency_rating"]
page_ans = response.answers["requires_page"]
print(f"Selected Team: {team_ans.choice} (Confidence: {team_ans.confidence:.2f})")
print(f"Urgency Score: {urgency_ans.score:.2f} (Confidence: {urgency_ans.confidence:.2f})")
print(f"Requires Page: P(true) = {page_ans.noul:.3f}")
if team_ans.confidence >= 0.85 and team_ans.choice != "unclear":
print(f"--> Automated routing to: {team_ans.choice}")
else:
print("--> Escalating to human incident commander for triage.")
Jev is natively available via OpenRouter using the dedicated Decisions API:
- Endpoint:
POST https://openrouter.ai/api/alpha/decisions - Model:
~typesafe/jev-latest - Headers: -
Authorization: Bearer $OPENROUTER_API_KEYContent-Type: application/json
{
"model": "~typesafe/jev-latest",
"state": "User transaction: $4,200. Account created 14 minutes ago. Card country: US. Shipping country: SG.",
"questions": {
"fraud_risk": {
"type": "score",
"instructions": "Rate immediate transaction fraud risk",
"criteria": [
"1 - Low risk: Consistent profile and trusted parameters",
"2 - Moderate: Mild anomalies present, standard verification needed",
"3 - High: Significant risk indicators, likely fraudulent",
"4 - Critical: Confirmed malicious pattern or stolen card signatures"
]
},
"auto_decline": {
"type": "noul",
"instructions": "This transaction exhibits sufficient fraud risk to justify immediate automated decline."
}
}
}
For offline, edge, or real-time game environments where a 150ms cloud network round-trip is unacceptable, open-source reimplementations like jevlike execute System 1 latent heads directly in PyTorch:
pip install torch jevlike
python
import torch
from jevlike import JevLikeModel
model = JevLikeModel.from_pretrained("jevlike-base").to("cuda")
with torch.inference_mode():
state_tensor = model.encode_state(local_state_buffer)
action_probs = model.evaluate_choice(
state_tensor,
actions=["attack", "dodge", "retreat", "idle"]
)
best_action = action_probs.argmax().item()
print(f"Local System 1 decision executed in <1ms -> Action: {best_action}")
| HTTP Status | Error Type / Code | Cause | Recommended Action |
|---|---|---|---|
| 400 | max_tokens_exceeded /context_length_exceeded |
Input state exceeds 32,768 tokens . | Truncate state or filter to relevant diffs/logs before sending. |
| 401 | invalid_api_key |
Missing or invalid API key. | Check OPENROUTER_API_KEY orTYPESAFE_API_KEY . |
| 402 | insufficient_credits |
Account balance exhausted. | Add credits at openrouter.ai/settings/credits. |
| 422 | invalid_questions_schema |
Malformed primitive criteria or $>255$ choices. | Validate that choices has $\le 255$ keys and instructions is a string. |
| 429 | rate_limited |
Exceeded request concurrency or RPM. | Implement exponential backoff ($250 \text{ms} \times 2^\text{attempt}$). |
| 529 | service_overloaded |
Temporary infrastructure congestion. | Retry with jitter up to 5 seconds. |
π‘ Rule of Thumb:
Always implement exponential backoff with jitter on HTTP 429/529. For HTTP 400 context errors, fail fast and log the token count.
β οΈ Pitfall to Avoid:
Forgetting to read the HTTP status code. If Jev returns a 422, your question schema is malformed (e.g., missing criteria or invalid choice keys).
π Notebook Takeaway:
Call Jev natively via typesafe-sdk or OpenRouter's /api/alpha/decisions (~typesafe/jev-latest). Stay under the 32k state token limit and handle calibrated outputs using clear confidence thresholds.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β THE 5 GOLDEN RULES OF JEV β
βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Rule β Engineering Invariant β
βββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 1. The Two-Second Test β If an expert can't decide in 2s, decompose it. β
β 2. Always Provide an Outβ Always add "other" or "unclear" to Choice. β
β 3. Speculative Fan-Out β Pack all questions in 1 call; filter in code. β
β 4. Build Human Queue 1stβ Create the uncertainty sink before automating. β
β 5. Calibrate Real Data β Run Shadow Mode for 2 weeks before thresholding. β
βββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββ
- The Two-Second Test: If a human expert cannot answer the question in 2 seconds without having to explain why, do not ask Jev. Decompose the problem into narrow, atomic questions.
- Always Provide an Out: Never create a
Choicewithout an"other"or"unclear"escape hatch. Closed softmax distributions force false positives on edge cases. - Speculative Fan-Out: Ask for every dimension you might need in a single pass. Questions in a single call cost virtually nothing ($0.042/1M tokens); network round-trips cost precious latency.
- Build the Human Queue First: Always establish where low-confidence and ambiguous results go before turning on automated downstream execution.
- Calibrate from Real Data (Shadow Mode): Never guess your confidence thresholds in production. Run Jev inShadow Mode alongside your existing rules for two weeks. Graph the error distribution against confidence scores and draw your cutoffs where empirical errors cluster.
π‘ Rule of Thumb:
In Shadow Mode, record the tuple (confidence, choice, ground_truth) for 1,000 production events. Plot an empirical calibration curve before setting your automated cutoff.
β οΈ Pitfall to Avoid:
Setting arbitrary thresholds like 0.99 out of fear (starving the automation) or 0.50 out of greed (introducing silent bugs). Let empirical shadow data pick the cutoff.
π Notebook Takeaway:
Deconstruct decisions into 2-second questions. Always provide an escape hatch. Fan out questions in one call. Build the human queue first, and calibrate thresholds from real shadow data.