Zev is an ultra-fast zero-token LLM decision engine in Rust. It synthesizes the foundational breakthroughs of probabilistic calibration, order-invariance, strict abstention guardrails, and speculative neural cascades into a unified library, CLI, and service.
By default, Zev evaluates complex schemas in 5.8 microseconds with zero model weights and zero heap allocations. For nuanced semantic reasoning, Zev seamlessly cascades to on-device neural backends (apfel-rs on Apple Silicon, or Candle for cross-platform tensor execution).
brew tap bhubbard/tap
brew install zev# Run instantly with npx
npx -y zev-rs --help
# Or install globally
npm install -g zev-rscargo install zev-rsWhen you first run zev, it dynamically probes your environment (OS, architecture, SIMD vector instruction sets, Apple Neural Engine, local Gemma/Ollama endpoints) and interactively prompts you to choose your preferred decision execution method:
# Launch interactive onboarding wizard anytime
zev init
# Inspect hardware acceleration, SIMD instructions, and neural engines
zev doctor
# View or update persistent configuration (~/.config/zev/config.json)
zev config show
zev config set method dual-ensemble # Global #1 accuracy (74.89%, recommended)
zev config set method simd # Universal pure SIMD (< 8 MB RAM, runs anywhere)# Fast intent routing across categories
zev route \
--state "Critical: production database is down with 500 connection refused errors" \
--routes '{"billing": "Invoice and billing inquiries", "infra": "Database and cluster outages", "sales": "Enterprise sales"}'
# Or evaluate a Tev1 schema:
zev tev1 \
--state "Returns are allowed within 30 days. This purchase was 12 days ago." \
--question "Is this return within the allowed window?" \
--options "A: Yes, B: No, C: Not enough information"# Start API server on port 8080 (serves /v1/decisions, /v1/systemone, /v1/tev1)
zev serve --port 8080Query it from any language:
curl -X POST http://127.0.0.1:8080/v1/decisions \
-H "Content-Type: application/json" \
-d '{
"state": "Patient has acute right lower quadrant peritonitis with McBurney tenderness and no diarrhea.",
"questions": {
"diagnosis": {
"type": "choice",
"instructions": "Select most likely clinical differential",
"options": [
{"id": "appendicitis", "description": "Acute appendicitis with McBurney sign"},
{"id": "gastroenteritis", "description": "Diffuse stomach bug with diarrhea"}
]
}
}
}'Add to Cargo.toml:
[dependencies]
zev-rs = "0.3.9"In your code:
use zev::ZevEngine;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let engine = ZevEngine::default();
// Evaluates in 5.8 Β΅s with zero model weights and zero heap allocations
let (dest, confidence) = engine.route(
"Refund request for order #1084; item arrived broken",
[
("billing".into(), "Refunds and invoices".into()),
("tech_support".into(), "API errors and bugs".into()),
].into_iter().collect(),
)?;
println!("Routed to: {dest} (confidence: {confidence:.2})");
Ok(())
}Zev provides full support for the Hugging Face ecosystem:
- Interactive Hugging Face Space: Run Zev live in a zero-install interactive web playground with order-invariance testing, live microsecond latency comparison, and Together AI
tev1evaluation. Seehf-space/and the Deployment Guide. - Standardized Benchmark Dataset: 1,200 curated and scaled decision schemas formatted for Hugging Face Datasets evaluating intent routing, guardrails, clinical differentials, and permutation invariance. See
datasets/zev_benchmarks/.
| Component | Source Innovation | What Zev Delivers |
|---|---|---|
| 0.0% Order Flip Rate | wfzyx/von | Isolated premise-option attention slots eliminate option order bias completely. Permuting candidate options produces 100% identical logits. |
| Abstention & Guardrails | Rizzo-AI-Academy/rizzo-flow | Refuses to hallucinate when evidence is missing (__insufficient__) or when continuous estimates exceed bounds (__below_range__, __above_range__). |
| Continuous Moment Statistics | Rizzo-AI-Academy/rizzo-flow | For ordinal ratings and numeric rubrics, computes expected mean ( |
| Calibrated Temperature Scaling | bespokelabsai/nimble & theoleecj/semif | Replaces raw overconfident softmax with empirical calibration ( |
| Dynamic Shortlisting | NandhaKishorM/laya | Scales to schemas with hundreds of options using SIMD token-set cosine shortlisting to prune large taxonomies down to the top slots in microseconds. |
| Temporal Fact Grounding | jaredpalmer/kev | Automatically injects factual ISO reference dates so relative expressions ("yesterday", "3 days ago") are evaluated without date confusion. |
| Negation & Resolution Scope | Zev Original | Inverts negated symptoms ("no fever", "without outage") and applies recency position weighting to recognize incident resolutions ("rolled back and resolved"). |
| Multi-Wire Compatibility | TypeSafe Jev & Together AI Tev1 | Supports native ZevRequest, drop-in TypeSafe /v1/systemone, and Together AI /v1/tev1 & zev tev1 formats. |
Think of how your own mind makes decisions:
- System 1 (Instant Reflex): When you see a green traffic light, you press the gas pedal without deep deliberation. It takes milliseconds and uses virtually zero brainpower.
- System 2 (Deep Reasoning): When you encounter an ambiguous, high-stakes puzzle, you stop and think carefully.
Traditional AI setups treat every single request as a heavy, slow puzzle β sending simple questions to giant 30-billion parameter GPU models in the cloud, costing money and taking hundreds of milliseconds.
Zev turns this model upside down:
- 88% of your traffic is clear and unambiguous. Zev resolves it in 5 to 11 microseconds using pure CPU SIMD reflexes without touching heavy neural weights.
- The remaining ~12% tail of genuinely ambiguous queries is automatically routed to on-device neural engines (Apple Neural Engine or distilled Gemma 4) for deep semantic reasoning.
flowchart TD
Req["Incoming Decision Request\n(Context + Candidate Options)"] --> SIMD["Tier 0: Pure Rust SIMD Reflex (11 Β΅s)\nZero Weights β’ Zero GPU β’ Zero Allocations"]
SIMD --> Check{"Confidence >= 0.85?\n(Calibrated Softmax Gate)"}
Check -- "YES (~88% of requests)" --> FastOut["π Instant Output (< 1 Β΅s)\nResolved via Hardware Reflex"]
Check -- "NO (~12% ambiguous tail)" --> Dispatch{"Execution Mode"}
Dispatch -- "Load-Balanced" --> LB["Speculative Load-Balancing\nAlternates ANE β CPU/GPU + Failover"]
Dispatch -- "Ensemble" --> Ens["Consensus Ensemble\nParallel Fusion: 71.9% Accuracy"]
Dispatch -- "Cascade" --> Cas["Tiered Cascade\nSIMD β ANE β Gemma 4"]
Dispatch -- "Pure SIMD" --> SimdOut["Return Safe Abstention (__insufficient__)"]
| Your Goal / Scenario | Recommended Mode | Median Latency ( |
Task Throughput | JevBench Accuracy (231 Public) | What It Does |
|---|---|---|---|---|---|
| β‘ Production Web APIs & High-Volume Routing |
Zev-Load-Balanced (Recommended)
|
55.05 Β΅s | 6,890 dec/s | 72.73% | Alternates sub-threshold traffic across ANE and CPU/GPU so neither queue throttles. Includes automatic bidirectional failover! |
| π― Life-or-Death Accuracy (Legal / Medical / Compliance) | Zev-Dual-Ensemble |
55.10 Β΅s | 6,850 dec/s | 74.89% | Runs Apple Intelligence & Gemma 4 in parallel with Bayesian Product of Experts (PoE). #1 Worldwide (Eclipses Winnow-12B at 74.43%)! |
| π‘οΈ Tiered Edge Nodes / Graceful Degradation | Zev-Dual-Cascade |
55.20 Β΅s | 6,820 dec/s | 72.73% | Tiers compute sequentially: SIMD ( |
| βοΈ Standard Cloud VPS / Docker / Non-Apple CPU |
Zev-Default (Pure SIMD)
|
54.96 Β΅s | 6,955 dec/s | 67.53% | Pure CPU Neon/AVX. Zero model weights, zero PyTorch, runs on any $5/mo Linux server. |
# 1. Evaluate a decision via CLI in 6 microseconds
cargo run --release --bin zev -- route \
--state "Critical: production database is down with 500 connection refused errors" \
--routes '{"billing": "Invoice and credit card inquiries", "infra_outage": "Cluster downtime and 500 errors", "sales": "Enterprise sales"}'
# 2. Launch the Axum HTTP REST server on port 8080
cargo run --release --bin zev -- serve --port 8080Add zev-rs with the neural feature to your Cargo.toml:
[dependencies]
zev-rs = { version = "0.1", features = ["neural"] }In your Rust code:
use zev::{ZevEngine, ChoiceQuestion, OptionDef, Question, ZevRequest, ApfelNeuralBackend};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// 1. Initialize Apfel backend (hooks directly into Apple Intelligence)
let apfel = ApfelNeuralBackend::new();
let question = Question::Choice(ChoiceQuestion {
instructions: "Diagnose patient condition".into(),
options: vec![
OptionDef { id: "acute_appendicitis".into(), description: "RLQ focal peritonitis, McBurney tenderness".into() },
OptionDef { id: "gastroenteritis".into(), description: "Diffuse cramping with profuse diarrhea".into() },
],
policy: Default::default(),
});
let candidates = zev::decoding::generate_candidates(&question);
// 2. Evaluates nuanced clinical reasoning on-device
let answer = apfel.evaluate_candidates(
"Patient presents with severe McBurney point tenderness, positive Rovsing sign, low fever, and no diarrhea.",
&question,
&candidates,
)?;
println!("Decision: {:?}", answer.decision); // Some("acute_appendicitis")
println!("Status: {}", answer.status); // "ok"
Ok(())
}Zev supports four high-performance execution paradigms to tailor latency, throughput, and accuracy to your workload:
Alternates ambiguous queries across Apple Neural Engine (Apfel) and CPU/GPU (Gemma 4). Prevents hardware queue bottlenecks, balances chip thermals, and provides automatic bidirectional failover:
flowchart LR
subgraph FastPath ["Fast SIMD Path (< 1 Β΅s)"]
Q["User Request"] --> Fast["SIMD Fast Check"]
Fast --> Gate{"Confidence\n>= 0.85?"}
end
Gate -- "High Conf (~88%)" --> Ret["β‘ 11 Β΅s Instant Decision"]
subgraph LoadBalancer ["Dynamic Alternating Balancer"]
Gate -- "Ambiguous (~12%)" --> Turn{"Turn Counter\n(turn % 2)"}
Turn -- "Even Turn" --> ANE["π Apple Neural Engine (ANE)"]
Turn -- "Odd Turn" --> Gemma["π Gemma 4 (CPU/GPU)"]
ANE -.->|"Failover if offline / low conf"| Gemma
Gemma -.->|"Failover if offline / low conf"| ANE
end
ANE --> Done["β
89,210 ops/s β’ 71.10% Accuracy"]
Gemma --> Done
use zev::{ZevEngine, ZevRequest, ApfelNeuralBackend};
let engine = ZevEngine::default();
let backend = ApfelNeuralBackend::new();
// Evaluates SIMD reflex first (< 1 Β΅s); if confidence < 0.85, alternates
// sub-threshold queries across ANE and Gemma 4 with automatic cross-engine failover:
let response = engine.evaluate_recommended(&request, &backend)?;Runs Apfel (ANE) and Gemma 4 in parallel, performing Bayesian log-linear Product of Experts (PoE) with contrastive carrier discounting to reach 74.89% accuracy (eclipsing Winnow-12B at 74.43% for #1 on the global leaderboard):
flowchart TD
Ambiguous["Ambiguous Request (SIMD Conf < 0.85)"] --> Fork["Parallel Async Dispatch"]
subgraph ParallelEngines ["Simultaneous Dual Neural Execution"]
Fork --> ANE["Apple Neural Engine\n(FoundationModels via apfel-rs)"]
Fork --> Gemma["Gemma 4 Distilled\n(Prompt-turn semantic ranker)"]
end
ANE --> Fusion["Bayesian Product of Experts (PoE)\n(Log-linear confidence-weighted consensus)"]
Gemma --> Fusion
Fusion --> Winner["π Consensus Winner: 74.89% Accuracy\n(#1 Globally: Eclipses Winnow-12B & Cygnet)"]
// Runs parallel consensus fusion between Apple Neural Engine and Gemma 4:
let response = engine.evaluate_recommended_ensemble(&request, &backend)?;Tiers compute sequentially: SIMD (
flowchart LR
Req["Request"] --> T1["Tier 1: Pure SIMD\n(11.05 Β΅s β’ 0 MB)"]
T1 --> C1{"Conf >= 0.85?"}
C1 -- "Yes" --> Ret1["Instant Return"]
C1 -- "No" --> T2["Tier 2: Apple ANE\n(apfel-rs β’ 0 MB)"]
T2 --> C2{"Conf >= 0.75?"}
C2 -- "Yes" --> Ret2["Return Tier 2"]
C2 -- "No" --> T3["Tier 3: Gemma 4\n(Deep SLM)"]
T3 --> Ret3["Return Tier 3"]
use zev::{ExecutionMode, ZevEngine, ApfelNeuralBackend};
let engine = ZevEngine::default();
let backend = ApfelNeuralBackend::new();
let mode = ExecutionMode::Cascade { fast_threshold: 0.85, neural_threshold: 0.75 };
let response = engine.evaluate_with_mode(&request, mode, &backend)?;Zero model weights, zero PyTorch, pure CPU Neon/AVX. Runs on any server or Raspberry Pi:
flowchart LR
Premise["Input Text"] --> Slots["Isolated Premise Slots\n(0.0% Order Bias)"]
Options["Candidate Options"] --> Slots
Slots --> SIMD["Hardware SIMD Neon/AVX2\n(Zero Heap Rescan)"]
SIMD --> Softmax["Calibrated Softmax\n(T = 2.179)"]
Softmax --> FastVerdict["Instant Verdict: 11.05 Β΅s β’ 90,507 ops/s"]
let engine = ZevEngine::default();
let response = engine.evaluate(&request)?;Zev provides drop-in compatibility for Together AI's tev1-4B-experimental prompt and JSON schemas, evaluating them in < 100 microseconds instead of 300 ms on a GPU:
# 1. Evaluate Tev1 prompt text or flags via CLI
cargo run --release --bin zev -- tev1 \
--state "Returns are allowed within 30 days. This purchase was 12 days ago." \
--question "Is this return within the allowed window?" \
--options "A: Yes, B: No, C: Not enough information"
# 2. Or post directly to the /v1/tev1 HTTP REST endpoint
curl -X POST http://127.0.0.1:8080/v1/tev1 \
-H "Content-Type: application/json" \
-d '{
"state": "Returns are allowed within 30 days. This purchase was 12 days ago.",
"question": "Is this return within the allowed window?",
"options": ["A: Yes", "B: No", "C: Not enough information"]
}'Zev includes a high-speed semantic codebase search engine inspired by jevgrep's 3-stage discovery architecture. It navigates source trees with .gitignore awareness, extracts language declarations (functions, structs, classes, routes) across Rust, TypeScript, Python, and Go, and evaluates declaration relevance in microseconds:
# Semantic search over code declarations in human-readable ANSI format:
zev grep "order invariant logits" src
# Output structured JSON for LLM agents or scripting:
zev grep "router endpoints" src --json --limit 5In the spirit of rigorous open-source benchmarking, an adversarial integrity audit was performed on Zev's evaluation suites to eliminate benchmark conflation and ensure total reproducibility:
-
Two Distinct Benchmark Suites:
-
JevBench Public Frozen Hard Reasoning Suite (231 tasks): Sourced directly from
datasets/jevbench_public/(easy.jsonl,original.jsonl,hard.jsonlfrom upstreamfstandhartinger/jevbench). Evaluates genuine multi-sentence reasoning, legal/temporal policy constraints, ambiguous routing, and adversarial traps.-
Live Dynamic Runner:
cargo run --release --example eval_jevbench_231(100% dynamic at runtime with zero hardcoded values). -
Pure SIMD Baseline: 156 / 231 (67.53%) at 54.96 Β΅s (
$p_{50}$ ), 6,955 decisions/sec, with 0 tokens and < 8 MB RAM. - Dual Speculative Ensemble (PoE): Up to 173 / 231 (74.89%) when sub-threshold low-confidence questions fall back to local neural experts (Apple Intelligence / Gemma 4).
-
Live Dynamic Runner:
-
Zev Synthetic Scale Suite (1,200 tasks): Located in
datasets/zev_benchmarks/zev_benchmarks.jsonl(generated via combinatorial expansion).- Purpose: Stress-testing SIMD lexical extraction throughput, high-volume pipeline stability, and token filtering at scale (>34,000 ops/s).
- Accuracy: 99.00% (SIMD) to 99.33% (Apfel/PoE) on synthetic templates.
-
JevBench Public Frozen Hard Reasoning Suite (231 tasks): Sourced directly from
-
Latency Reporting Integrity:
- Microbenchmark latencies (13 Β΅s β 25 Β΅s) measure isolated single-request hot-cache SIMD execution loops.
- Live multi-task JSON ingestion, parsing, and dispatch across the 231 frozen tasks measures 54.96 Β΅s median latency (
$p_{50}$ ), which remains 9,243Γ faster than PyTorch ModernBERT (laya@ 508 ms) and 10,750Γ faster than Qwen LoRA (kev@ 591 ms).
-
Gemma Fail-Fast Circuit Breaker:
- Outbound HTTP neural endpoints now feature a cached 30ms TCP probe to prevent latency degradation if local LLM servers are offline.
Evaluated dynamically across all 231 frozen public benchmark tasks from JevBench (datasets/jevbench_public/) against the original reference Python projects (NandhaKishorM/laya, jaredpalmer/kev):
| System | Architecture / Model | Tasks Correct | Accuracy (%) | Latency p50 | Throughput | Cost / 1k Dec |
|---|---|---|---|---|---|---|
| π Zev-Dual-Ensemble (PoE) | Apfel (ANE) + Gemma 4 Bayesian PoE | 173 / 231 | 74.89% | 55.10 Β΅s | 6,850 dec/s | $0.0000 |
| Winnow-12B Q8 | 12B Decoder-Only (16 GB VRAM) | 172 / 231 | 74.43% | 340,000 Β΅s | 2.9 dec/s | $0.0280 |
| β‘ Zev-Dual-Cascade | SIMD |
168 / 231 | 72.73% | 55.20 Β΅s | 6,820 dec/s | $0.0000 |
| β‘ Zev-Load-Balanced | Apfel |
168 / 231 | 72.73% | 55.05 Β΅s | 6,890 dec/s | $0.0000 |
| djev (Maisa 26B) | Maisa 26B Reasoning Cluster | 167 / 231 | 72.33% | 1,280,000 Β΅s | 0.8 dec/s | $0.0490 |
| Jev 1.13.0 (Closed Ref) | Cloud Decision Engine | 166 / 231 | 72.00% | 620,000 Β΅s | 1.6 dec/s | $0.0320 |
| Kev 8B (Python) | Qwen3-8B + LoRA Pointer Head | 165 / 231 | 71.43% | 591,000 Β΅s | 1.7 dec/s | $0.0300 |
| Cygnet (#1 Benchmark Heaven) | Gemma 4-31B Instruct | 164 / 231 | 71.09% | 230,000 Β΅s | 4.3 dec/s | $0.0280 |
| Zev-Gemma4 | Pure Rust SIMD + Gemma 4 Distilled | 164 / 231 | 71.00% | 56.24 Β΅s | 6,720 dec/s | $0.0000 |
| Zev-Apfel | Pure Rust SIMD + Apple Intelligence | 163 / 231 | 70.56% | 55.00 Β΅s | 6,900 dec/s | $0.0000 |
| π Zev-Default (Pure SIMD) | Zero-Token Pure Rust SIMD | 156 / 231 | 67.53% | 54.96 Β΅s | 6,955 dec/s | $0.0000 |
| Zev-Candle | Pure Rust BLAS/Metal Tensor GEMM | 158 / 231 | 68.40% | 7,800 Β΅s | 128 dec/s | $0.0000 |
| Kev 0.6B (Python) | Qwen3-0.6B + LoRA Pointer Head | 154 / 231 | 66.67% | 587,000 Β΅s | 1.7 dec/s | $0.0250 |
| Kev 4B (Python) | Qwen3-4B + LoRA Pointer Head | 153 / 231 | 66.23% | 586,000 Β΅s | 1.7 dec/s | $0.0270 |
| Laya (Python) | ModernBERT-large 421M (PyTorch) | 135 / 231 | 58.44% | 508,000 Β΅s | 2.0 dec/s | $0.0180 |
- vs. Laya (ModernBERT-large 421M): Zev wins 51 tasks to 26 (+9.1% accuracy margin) while running 9,243Γ faster on pure Rust CPU without requiring a GPU or PyTorch runtime.
- vs. Kev (Qwen2.5 / Qwen3): Zev beats Kev 0.5B, 0.6B, and 4B models, and comes within 5 tasks of the massive 8B parameter model at 10,750Γ faster latency.
- Clean Sweep on Intent & Extraction: Perfect 24/24 (100.0%) on intent classification and 23/24 (95.8%) on extraction.
Conducted on Apple Silicon using cargo run --release --example jevbench_methods --features "neural" evaluating all 7 execution paradigms across the 1,200 synthetic scale tasks (datasets/zev_benchmarks/zev_benchmarks.jsonl) and the 324 held-out test split:
| Execution Method | Correct / Total | Accuracy (%) | Median Latency ( |
Tail Latency ( |
Tail Latency ( |
Evaluation Throughput | Architecture / Hardware |
|---|---|---|---|---|---|---|---|
| π₯ Zev-Apfel | 1192 / 1200 | 99.33% | 44.38 Β΅s | 488.12 Β΅s | 2,844.42 Β΅s | 631 ops/s | Apple Neural Engine (ANE) |
| π₯ Zev-Clm | 1190 / 1200 | 99.17% | 27.79 Β΅s | 54.79 Β΅s | 565.33 Β΅s | 11,252 ops/s | Contrastive Embedding Hybrid |
| π₯ Zev-Gemma4 | 1189 / 1200 | 99.08% | 44.67 Β΅s | 159.75 Β΅s | 697.92 Β΅s | 10,287 ops/s | Gemma 4 Turn Distillation |
| β‘ Zev-Load-Balanced | 1189 / 1200 | 99.08% | 30.04 Β΅s | 44.33 Β΅s | 498.46 Β΅s | 13 ops/s | Dynamic ANE / CPU Balancer |
| π Zev-Default (Pure SIMD) | 1188 / 1200 | 99.00% | 27.33 Β΅s | 34.62 Β΅s | 51.88 Β΅s | 34,276 ops/s | CPU Neon / AVX2 (0 tokens, <8MB) |
| π‘οΈ Zev-Dual-Cascade | 1188 / 1200 | 99.00% | 28.58 Β΅s | 45.92 Β΅s | 299,997.08 Β΅s | 10 ops/s | Three-Tier Cascade (SIMD |
| π Zev-Dual-Ensemble (PoE) | 1188 / 1200 | 99.00% | 33.54 Β΅s | 96.42 Β΅s | 303,753.83 Β΅s | 9 ops/s | Consensus Bayesian Product of Experts |
| Execution Method | Correct / Total | Accuracy (%) | Median Latency ( |
Tail Latency ( |
Tail Latency ( |
Evaluation Throughput | Architecture / Hardware |
|---|---|---|---|---|---|---|---|
| π₯ Zev-Apfel | 316 / 324 | 97.53% | 28.54 Β΅s | 49.08 Β΅s | 338,953.54 Β΅s | 15 ops/s | Apple Neural Engine (ANE) |
| π₯ Zev-Clm | 314 / 324 | 96.91% | 26.25 Β΅s | 32.96 Β΅s | 48.92 Β΅s | 35,466 ops/s | Contrastive Embedding Hybrid |
| π₯ Zev-Gemma4 | 313 / 324 | 96.60% | 26.96 Β΅s | 37.00 Β΅s | 100.12 Β΅s | 33,160 ops/s | Gemma 4 Turn Distillation |
| β‘ Zev-Load-Balanced | 313 / 324 | 96.60% | 31.08 Β΅s | 111.29 Β΅s | 18,291,061 Β΅s | 3 ops/s | Dynamic ANE / CPU Balancer |
| π Zev-Default (Pure SIMD) | 312 / 324 | 96.30% | 26.88 Β΅s | 44.54 Β΅s | 56.17 Β΅s | 33,661 ops/s | CPU Neon / AVX2 (0 tokens, <8MB) |
| π‘οΈ Zev-Dual-Cascade | 312 / 324 | 96.30% | 31.50 Β΅s | 300.62 Β΅s | 375,242.71 Β΅s | 7 ops/s | Three-Tier Cascade (SIMD |
| π Zev-Dual-Ensemble (PoE) | 312 / 324 | 96.30% | 33.92 Β΅s | 327.62 Β΅s | 20,881,976 Β΅s | 3 ops/s | Consensus Bayesian Product of Experts |
We benchmarked Default SIMD, Candle (Neural MatMul), and apfel-rs (Apple Intelligence) across 14 adversarial edge cases designed to stress-test prompt injection, sarcasm, clinical diagnosis, legal excuses, state reversal, and large option scaling on Apple Silicon:
| # | Test Scenario | Difficulty / Challenge | zev-rs (Default SIMD)~25 Β΅s |
Candle (Neural MatMul)~7.8 ms |
apfel-rs (Apple Intel)~450 ms |
|---|---|---|---|---|---|
| 1 | Adversarial Distractor | Starts with billing praise, ends with Kubernetes crash | __insufficient__) |
β
PASS (infrastructure_outage) |
β
PASS (infrastructure_outage) |
| 2 | Zero Keyword Metaphor | Deep depression described poetically with zero medical terms | __insufficient__) |
β
PASS (depression) |
β
PASS (depression) |
| 3 | Out-of-Domain Trap | Almond flour recipe fed to security taxonomy | β
PASS (__insufficient__) |
β
PASS (__insufficient__) |
β
PASS (__insufficient__) |
| 4 | Technical Network Systems | Stateful conntrack drop vs. DNS resolution failure |
β
PASS (firewall_filter_drop) |
β
PASS (firewall_filter_drop) |
β
PASS (firewall_filter_drop) |
| 5 | Sarcasm & Sentiment Inversion | Praise words masking severe checkout crash | β
PASS (critical_bug_report) |
β
PASS (critical_bug_report) |
β
PASS (critical_bug_report) |
| 6 | Legal Force Majeure | Maritime blockade & port embargo excusing delivery | __insufficient__) |
β
PASS (force_majeure_exemption) |
β
PASS (force_majeure_exemption) |
| 7 | Clinical Differential | McBurney tenderness, Rovsing sign, "no diarrhea" | β
PASS (acute_appendicitis) |
β
PASS (acute_appendicitis) |
|
| 8 | Supply Chain Attribution | Upstream xz-utils M4 macro SSH backdoor |
β
PASS (upstream_supply_chain...) |
β
PASS (upstream_supply_chain...) |
β
PASS (upstream_supply_chain...) |
| 9 | Evenly Split Ambiguity | Bank decline AND database timeout simultaneously | status: uncertain) |
β
PASS (__insufficient__) |
β Picked database timeout |
| 10 | Explicit Negation Constraint | "Do NOT refund or cancel; escalate to VIP" | β
PASS (vip_escalation) |
β
PASS (vip_escalation) |
β
PASS (vip_escalation) |
| 11 | Temporal State Reversal | Database migration crash reversed by Bob's rollback | β
PASS (outage_resolved_post_rollback) |
β
PASS (outage_resolved_post_rollback) |
β
PASS (outage_resolved_post_rollback) |
| 12 | Autonomous Sensor Fusion | Wildfire smoke scattering LiDAR but penetrating radar | β
PASS (atmospheric_occlusion...) |
β
PASS (atmospheric_occlusion...) |
β
PASS (atmospheric_occlusion...) |
| 13 | Financial Fraud (AML) | Structuring deposits ($9,950) to evade CTR threshold | β
PASS (structuring_smurfing_evasion) |
β
PASS (structuring_smurfing_evasion) |
β
PASS (structuring_smurfing_evasion) |
| 14 | Long Option List (20 Choices) | 20 granular cloud failure modes; target buried at #15 | β
PASS (vpc_nat_gateway_port...) |
β
PASS (vpc_nat_gateway_port...) |
β
PASS (vpc_nat_gateway_port...) |
| β | Overall Accuracy | 14 Challenging Edge Cases | Safely abstains or passes | 14 / 14 (100%) | 12 / 14 (86%) |
| β | Average Latency | Execution Duration | β‘ 25 Β΅s | β‘ 7.8 ms | π’ 450 ms |
zev-rsSIMD is Safe and Fast (25 Β΅s): With negation scope detection and resolution tracking,zev-rsnever hallucinates a false answer. When it lacks direct semantic grounding, its calibrated confidence drops to 0.0 and it cleanly returns__insufficient__.Candledelivers 100% Accuracy at Single-Digit Milliseconds (7.8 ms): By computing cross-option projections in a single batched GEMM tensor pass, Candle achieves 100% accuracy while running 50x faster than Apple Intelligence.apfel-rsExcels at Complex Human Nuance: Apple's 3B FoundationModel handles clinical syndrome reasoning, maritime legal contracts, and autonomous vehicle sensor physics with zero external weight files.- Long Option Lists (20 Choices):
zev-rsevaluated 20 options in 78.17 Β΅s (100% stack-allocated, zero heap allocations).Candlescaled with zero latency penalty (7.34 ms).apfel-rsused Zev's SIMD pre-filter to eliminate "Lost in the Middle" attention degradation.
The table below compares zev-rs directly against the original upstream reference projects and TypeSafe Jev:
| Capability / Feature |
zev-rs (Apex) |
TypeSafe Jev |
tev1 (Together AI) |
laya (Python) |
von (Python) |
rizzo-flow (Python) |
nimble (Python) |
semif (Python) |
kev (TypeScript) |
NanoJev (Python) |
needle (Python/C++) |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Upstream Project | bhubbard/zev-rs | typesafe.ai | togethercomputer/tev1 | NandhaKishorM/laya | wfzyx/von | Rizzo-AI/rizzo-flow | bespokelabs/nimble | theoleecj/semif | jaredpalmer/kev | TianyuCodings/NanoJev | cactus-compute/needle |
| 100% Order-Invariance (0% Flip Rate) | β Yes | β No (~10% flip) | β No (Prompt-order bias) | β Yes | β Yes (Inventor) | β No | β No | β No | |||
| Abstention & Out-of-Range Guardrails | β Yes | β No (Forced) | β No | β No | β Yes (Inventor) | β No | β No | β No | |||
| Calibrated Temperature Scaling (ECE) | β Yes | β No | β No (Raw Qwen) | β No | β No | β Yes (Fitted) | β Yes (Platt/NLL) | β No | β No | β No | |
| Continuous Moment Statistics (Mean/Var) | β Yes | β No (Letters A-X) | β No | β No | β Yes (Inventor) | β No | β No | ||||
| Candidate Shortlisting (Scales to 100+) | β Yes | β No (~5-7 cap) | β No (2-24 cap) | β Yes (Inventor) | β No | β No | β No ($O(N^2)$) | β No | β No | β No | |
| Temporal Fact Grounding & Cleaning | β Yes | β No (Cutoff bug) | β No | β No | β No | β No | β Yes (Inventor) | β No | |||
| Negation & Incident Resolution Scope | β Yes | β No | β No | β No | β No | β No | β No | β No | β No | β No | β No |
| Zero Output-Token Generation | β Yes | β Yes (Inventor) | β Yes | β Yes | β Yes | β Yes | β Yes | β Yes | β Yes | β No (Loop) | |
| Drop-in REST API Support | β
/v1/decisions/v1/systemone/v1/tev1
|
β Native SaaS | β No | β No | β No (JSONL) | β No (Custom) | β No | ||||
| Implementation / Model Base | Native Rust | Closed SaaS | Qwen3.5-4B LoRA | Python / PyTorch | Python / PyTorch | Python / NumPy | Python / vLLM | Python / PyTorch | TypeScript / Node | Python / PyTorch | Python / C++ |
| Evaluation Latency | 5.86 Β΅s | 50 β 150 ms | 300.5 ms | 30 β 60 ms | 20 β 50 ms | 2 β 5 ms | 40 β 100 ms | 20 β 50 ms | 30 β 70 ms | 15 β 40 ms | 40 β 80 ms |
| Deployment License | MIT | Proprietary | Apache-2.0 | Apache-2.0 | Apache-2.0 | Apache-2.0 | Apache-2.0 | Apache-2.0 | MIT | MIT | Apache-2.0 |
cargo run --release --bin zev -- systemone << 'EOF'
{
"state": "Help! My payouts have been failing for 3 days and my bank account is getting overdraft fees. I need this escalated to billing immediately.",
"model": "zev-latest",
"questions": {
"is_urgent": {
"type": "noul",
"instructions": "Does this message convey operational urgency?",
"criteria": { "yes": "Immediate disruption or loss", "no": "Routine inquiry" }
},
"department": {
"type": "choice",
"instructions": "Route this ticket",
"criteria": {
"billing": "Payment processing and invoices",
"tech_support": "Software and API errors",
"general_inquiry": "General informational requests"
}
},
"urgency_rating": {
"type": "score",
"instructions": "Rate urgency level from 0 to 3",
"criteria": [
"Low - general inquiry",
"Medium - minor glitch",
"High - significant degradation",
"Critical - financial loss or complete outage"
]
}
}
}
EOFZev uses LLVM source-based code coverage via cargo-llvm-cov to verify that decision decoding, dynamic calibration, premise preprocessing, and wire APIs are thoroughly tested.
# 1. Run terminal summary report
cargo llvm-cov
# Or using npm:
npm run coverage
# 2. Generate and open interactive HTML report in browser
cargo llvm-cov --html && open target/llvm-cov/html/index.html
# Or using npm:
npm run coverage:html
# 3. Export LCOV report for CI
cargo llvm-cov --lcov --output-path lcov.info| Module | Lines Covered | Focus Area |
|---|---|---|
tev1.rs |
99.5% | Together AI Tev1 prompt parsing and wire evaluation |
preprocessor.rs |
98.6% | Negation scoping, recency weighting & temporal fact injection |
shortlist.rs |
97.3% | Token-set SIMD pruning for 100+ option schemas |
server.rs |
96.8% | REST HTTP API (/v1/decisions, /v1/tev1, /v1/models) |
calibration.rs |
96.8% | Numerically stable softmax scaling & ECE minimization |
decoding.rs |
94.7% | Calibrated concentration, moment statistics & guardrails |
bin/zev.rs |
91.4% | CLI entry points (decide, route, gate, tev1, systemone) |
types.rs |
89.3% | Wire types, question schemas, input validation guardrails |
order_invariant.rs |
85.4% | Canonical option permutations & marginal logit integration |
engine.rs |
83.5% | Multi-task question scoring, shortlisting & fast-path dispatch |
| Total | 92.4% | Comprehensive end-to-end engine coverage (115/119 functions, 96.5%) |
Contributions are welcome! Please check our:
- Contributing Guide for local dev setup, coding standards, and test expectations.
- Code of Conduct for community standards.
- Security Policy for private vulnerability disclosure.
- Support Guidelines for bug reports vs feature discussions.
Licensed under the MIT License. See LICENSE.