Route webhooks, triage tickets, and dispatch agent tools in 0.12ms with calibrated confidence guards.
Software runtimes were invented for exact booleans: ===, switch, and regular expressions. But inbound events, support tickets, and LLM agent outputs are fuzzy and semantic.
Brittle. Breaks on typos, synonyms, or paraphrasing. Maintenance nightmare with endless if (msg.includes(...)) hacks.
Overkill. A 300ms–2000ms network round-trip and API cost just to pick a branch. Prone to hallucinated confidence and prompt drift.
Fuzzy pattern matching that runs in 0.12ms in-tree. Single forward pass, calibrated logits, and inline confidence guards.
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.
Zero dependencies, sub-millisecond execution. Call jevish() as a pattern matcher, a zero-shot classifier, or a boolean predicate.
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
});
import jevish from 'jevish';
// 1. Pass an array of candidate labels — returns the winning string
const category = await jevish('Can you provide an invoice for last month subscription?', [
'bug', 'feature', 'billing', 'spam'
]);
// => 'billing'
// 2. Access calibrated probabilities, Brier score, and runtime telemetry
const meta = await jevish.detailed('Database connection pool exhausted', ['bug', 'feature']);
console.log(meta.label); // 'bug'
console.log(meta.score); // 0.98 (calibrated top confidence)
console.log(meta.probs); // { bug: 0.98, feature: 0.02 }
console.log(meta.engine); // 'builtin' (0.05ms) or 'typesafe' (cloud)
console.log(meta.device); // 'cpu' | 'mps' | 'cuda' | 'webgpu' | 'cloud'
import jevish from 'jevish';
// Natural language boolean evaluation (Noul mode) returns a boolean
const isSpam = await jevish(
'Congratulations! You won a free luxury vacation trip prize right now!',
'is promotional spam'
);
// => true
// Or query raw probability score [0.0 - 1.0]
const confidence = await jevish.score(
'Fatal kernel panic in thread worker 500',
'is critical defect'
);
// => 0.96
import jevish from 'jevish';
// Point-free currying: calling jevish() with only patterns returns a reusable router
const triageRouter = jevish({
'bug @ >0.8': (t) => dispatchP0(t),
'bug': (t) => queueReview(t),
_: (t) => backlog(t),
});
const inboundEvents = await fetchEventQueue();
// Map over high-throughput streams in sub-millisecond time
const dispatched = await Promise.all(inboundEvents.map(triageRouter));
// Curried boolean filter helper
const urgentTickets = await inboundEvents.filterAsync?.(jevish.is('is urgent blocker'));
import jevish from 'jevish';
// Speculative Cascade: Resolve 76% in local CPU (<0.05ms), escalate edge cases to Jev
const meta = await jevish.detailed(
'Checkout crashed with 500 error after clicking submit',
['bug: system defect', 'billing: payment error', 'feature: enhancement'],
{ cascade: true }
);
// If confidence margin >= 2.0: resolves instantly in CPU cache
console.log(meta.label); // 'bug: system defect'
console.log(meta.fastPath); // true (0.04 ms, $0 API cost)
console.log(meta.device); // 'cpu'
// If ambiguous or natural question: speculatively escalates to cloud Jev
// => { engine: 'cascade', fastPath: false, device: 'cloud' } (99.0% accuracy)
import { jevish, Engine } from 'jevish';
// Option A: Auto-connect to TypeSafe System One (Jev) via environment variable
// export TYPESAFE_API_KEY="apikey_..."
const res = await jevish('Database deadlock on write', ['bug', 'feature']);
// Automatically uses TypeSafe Jev in cloud with full calibrated confidence
// Option B: Instantiate custom Engine with explicit credentials
const cloudEngine = new Engine({
apiKey: process.env.TYPESAFE_API_KEY,
endpoint: 'https://api.typesafe.ai/v1/systemone',
});
const classification = await jevish('Checkout modal crash', ['bug', 'billing'], {
engine: cloudEngine
});
Watch natural language events route through branches in real-time. Notice how confidence guards (@ >0.8) prevent uncertain execution and fall through.
Pass an array of arbitrary labels to pick the winning category: jevish(text, labels).
Evaluates natural language truth statements as true booleans: jevish(text, 'is spam').
Authored strictly per hemanth-diagram-style and diagram-design. Pure monochrome ink-on-paper clarity with inverted solid-black focal cards and orthogonal routing.
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).
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.
| 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) |
| 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) |