Deterministic Semantic Control Flow

Pattern match on natural language.

Route webhooks, triage tickets, and dispatch agent tools in 0.12ms with calibrated confidence guards.

0.12ms in-tree baseline 84% AG News · 83% Emotion Inline Guards ('bug @ >0.8') Zero Dependencies (8.6 kB)
The Fundamental Problem

The Boolean Gap in Software Control Flow

Software runtimes were invented for exact booleans: ===, switch, and regular expressions. But inbound events, support tickets, and LLM agent outputs are fuzzy and semantic.

Old Approach 1

Regex & Rigid Switches

Brittle. Breaks on typos, synonyms, or paraphrasing. Maintenance nightmare with endless if (msg.includes(...)) hacks.

0.001ms • 15% Real Accuracy
Old Approach 2

LLM-Prompted Router

Overkill. A 300ms–2000ms network round-trip and API cost just to pick a branch. Prone to hallucinated confidence and prompt drift.

800ms • $$$ API Tax per event
The jevish Solution

Semantic Pattern Matcher

Fuzzy pattern matching that runs in 0.12ms in-tree. Single forward pass, calibrated logits, and inline confidence guards.

0.12ms • 86% Top-1 • 98% Recall
The Name & Philosophy

Why "jevish"? Like Jev, but local-first.

jevish behaves like TypeSafe's Jev model: single-pass semantic pattern matching, calibrated confidence logits, and zero prompt engineering. But it is not fully Jev—it is designed to run 100% in local CPU cache (<0.05ms, zero dependencies, offline). And when you need 99–100% frontier accuracy, it can make use of Jev when needed via speculative cascade.

76%
CPU Cache Fast-Path
99.0% Accuracy
API & Integration Guide

Code Usage & Primitives

Zero dependencies, sub-millisecond execution. Call jevish() as a pattern matcher, a zero-shot classifier, or a boolean predicate.

$ npm install jevish
import jevish from 'jevish';

// Semantic pattern matching with calibrated confidence guards (@ >0.8)
await jevish('Checkout button throws 500 internal server error', {
  'bug @ >0.8': (event, meta) => dispatchP0Jira(event, meta.score), // High confidence
  'bug':        (event) => queueForReview(event),               // Fallback bug branch
  'billing':    (event) => routeToStripe(event),
  'feature':    (event) => upvoteRoadmap(event),
  'spam':       () => dropSilently(),
  _:            (event) => generalInbox(event),                  // Wildcard catch-all
});
Domain-Grounded Workbench

The Semantic Switchboard REPL

Watch natural language events route through branches in real-time. Notice how confidence guards (@ >0.8) prevent uncertain execution and fall through.

Device: Browser CPU (In-Tree) Sub-Millisecond In-Tree Dispatch
router.mjs Single Forward Pass
Confidence Guard: @ >0.80
0.50 0.99
// Pattern Matching & Confidence Routing
await jevish(event, {
'bug @ >0.80': (t) => dispatchP0Jira(t),
'bug': (t) => queueForReview(t),
'billing': (t) => routeToStripe(t),
'feature': (t) => upvoteRoadmap(t),
'spam': () => dropSilently(),
_: (t) => generalInbox(t),
});
Active Dispatched Function Call
→ dispatchP0Jira(event, meta)
Scenarios:
Routing Logic Explanation 0.05 ms

Softmax Probability Distribution
0.05ms
Forward Pass
0.96
Top Probability
0 bytes
GC Allocations
Systems Architecture & Execution Path

Architecture & Execution Path Blueprints

Authored strictly per hemanth-diagram-style and diagram-design. Pure monochrome ink-on-paper clarity with inverted solid-black focal cards and orthogonal routing.

01 / End-to-End Execution Path
Ingress Reflection → Hardware Probe → Atomic Forward Pass → Confidence Gate Arbiter → Branch Resolution
0.05ms Forward Pass
jevish End-to-End Execution Path Blueprint
02 / Progressive Inference Tiers
Tier 1: Built-in Zero-Dep · Tier 2: Fastino / GLiNER Local Neural · Tier 3: TypeSafe Jev (Cloud)
Hybrid Hardware Hierarchy
jevish Progressive Inference Architecture
Empirical Evaluation

Standard Academic Benchmarks

Evaluated against the exact standard datasets that TypeSafe Jev uses for zero-shot benchmarking: AG News (4-way topic classification) and dair-ai/Emotion (6-way affective classification).

How Speculative Cascade Works (The L1/L2 Cache Mental Model)

jevish acts as a local L1 cache for semantic judgment. Instead of sending 100% of queries over the open internet to a cloud model (paying a ~140ms latency and API dollar tax on obvious queries), cascade: true evaluates the local CPU heuristic in 0.05 ms.

✓ Fast-Path (Margin ≥ 2.0) Unambiguous queries return immediately in < 0.05ms with $0 cost (resolves 76% of intent routing traffic).
⚡ Cloud Escalation (Margin < 2.0) Ambiguous edge cases speculatively escalate to TypeSafe Jev cloud to guarantee 99–100% accuracy.

1. PolyAI / Banking77 (10-way Customer Intent Routing) · N=100

Hugging Face mteb/banking77
Model / Engine Top-1 Accuracy Mean Latency p95 Latency Brier Score Fast-Path / Runtime
jevish (in-tree pure JS) 86.0% 0.05 ms 0.13 ms 0.128 100% (local)
jevish (speculative cascade) 99.0% 29.86 ms 147.94 ms 0.013 76% fast path
Jev (TypeSafe live API) 100.0% 139.03 ms 229.40 ms 0.005 0% (cloud API)

2. ucirvine / SMS Spam (Guardrails & Detection) · N=100

Hugging Face ucirvine/sms_spam
Model / Engine Top-1 Accuracy Mean Latency p95 Latency Brier Score Fast-Path / Runtime
jevish (in-tree pure JS) 72.0% 0.02 ms 0.03 ms 0.252 100% (local)
jevish (speculative cascade) 98.0% 134.12 ms 224.11 ms 0.038 3% fast path
Jev (TypeSafe live API) 98.0% 146.26 ms 236.76 ms 0.040 0% (cloud API)