TermPrism v4
TermPrism Spectral Aperture Logo
TermPrism v4 · 2.88 MB Local WASM · Zero Cloud

Refract raw terminal chaos
into structured UI.

A 2.88 MB non-autoregressive neural compiler running 100% client-side in WebAssembly. Unwraps hard-wrapped PTY lines, prunes overwritten \r progress spam, splits mid-line collisions, and compiles logs into a typed Intermediate Representation (Structured IR) — with zero LLM hallucinations.

Explore Live Playground ↓
2.88 MB Distilled INT8+FP16 ONNX
33 ms 1-Thread WASM SIMD
1.000 F1 Zero-Shot CR-Prune
0 Hallucinations 100% Verbatim Lossless
Infer —
CR Pruned —
Merged —
Windows —
Raw Streams
Output View
What's Happening Loading real terminal presets...
LIVE STRUCTURED IR ROLE COLORS
STAGE A · Raw wrapped ANSI stream
Click A / B / C to jump · Space to pause
A Raw Terminal
— lines
B Structured IR
awaiting scan
Awaiting Prism Scan Scanned raw lines detach from Col A and morph into typed Structured IR blocks here.
C Rendered · Feed
awaiting IR
Awaiting UI Synthesis Structured IR blocks detach from Col B and materialize into live UI components here.
01 Raw Terminal Text

          
        
Editable · Paste any terminal log — tokens
02 Structured IR
Booting ONNX Runtime Web (WASM SIMD)...
Hover any line or block to 3-way highlight ↔ — spans
03 Rendered · Feed
Waiting for WASM model...
Lossless character-preserving render — blocks
How It Works

Three deterministic stages. Zero generative guesswork.

LLMs take seconds, cost tokens, and quietly hallucinate URLs or run IDs. Regexes shatter on the first unseen CLI. TermPrism runs a 2.88 MB encoder locally in WebAssembly to emit strict structural annotations while keeping every character verbatim.

STAGE A · 01

Ingest raw terminal chaos

Accepts live PTY streams, copy-pasted scrollback, 256-color/truecolor ANSI escapes, smashed carriage-return progress frames, and hard-wrapped paths or URLs.

Loading pipeline... 29%|██| 2/7\r100%|██████| 7/7 GET /api/health -> 200 OK (66.4 ms) GET /api/health -> 200 OK (63.0 ms)
STAGE B · 02

Compile to Structured IR

Like a compiler's Intermediate Representation (IR), one non-autoregressive pass emits typed semantic blocks, CR pruning, splits, folding, and exact spans — decoupled from any UI.

@progress pruned_cr=5 pct=100% Loading pipeline... 7/7 · 1.84it/s @http_log coalesced=×2 GET /api/health -> 200 OK · 63.0–66.4 ms
STAGE C · 03

Render into any UI surface

Drive a mobile/chat Feed, dense Ops Table, enhanced Clean TUI, or portable Markdown from the same lossless Structured IR — with 100% verbatim inspection.

● Loading pipeline... 100% ██████████████████████ 7/7 · 1.84it/s ● GET /api/health -> 200 OK ×2 · 63–66 ms
Structured IR · Intermediate Representation

TermPrism Primitives

5 Neural Heads + Exact Spans → Structured IR
Every terminal stream compiles into 8 structural primitives and 12 semantic @roles in one pass. Click any card or role below to inspect live Before → IR examples right here (without jumping your scroll).
12 Semantic Block Roles (@role) — Click any role to inspect live blocks inline — active in stream
Verified Benchmarks & SDK

Fast enough for live streams. Small enough for mobile web.

Evaluated zero-shot across 20 held-out real terminal & interactive TUI captures (Gate-0, Gate-2, Gate-3) with zero Python↔JS WASM parity drift across 16,074 tokens.

Blind Gate-4 & Zero-Shot Model Comparison (1-Thread WASM SIMD) 0/40,460 Parity Drift
Metric v4-Tiny Hardened (4L) v3-Tiny Distilled (4L)
ONNX Footprint (FP16+INT8) 2.88 MB 2.88 MB
WASM Median Latency (Gate-3 / Stream Tail) 33.7 / 32.1 ms 33.3 / 34.4 ms
Blind Gate-4 Raw NL / Role F1 (32–240+ cols) 0.959 / 0.894 0.630 / 0.526
Gate-4 False Widgets / 100 Prose Bullets 0.0 (0/41) 12.2 (5/41)
Gate-4 Sibling List-Boundary F1 1.000 (41/41) 0.815
Gate-3 Interactive NL / Role F1 0.855 / 0.985 0.814 / 0.972
Composer Rail Leaks & Destructive Strips 0 / 0 0 / 0
Drop-In Incremental Streaming API
import * as ort from "onnxruntime-web";
import { TermPrismEngineV2, TermPrismStream } from "termprism-runtime";

// 1. Load 2.88 MB hardened v4 ONNX once in the browser
const sess = await ort.InferenceSession.create("./termprism_v4_tiny_int8.onnx");
const engine = new TermPrismEngineV2(ort, sess, tokenizerJson);

// 2. Incremental tail-only inference (~32 ms tail, bit-exact on redraw/resize)
const stream = new TermPrismStream(engine);
const { blocks, irText, inferMs } = await stream.setText(rawPtyOutput);

// blocks[] → typed @roles, progress gauges, tables, exact spans
Architecture
5-Head Neural IR + Exact Spans
Jointly predicts newline unwrapping, per-token roles, CR pruning & collision splits, auto-folding, and live coalescing in one pass — paired with <0.5 ms exact-boundary span tagging.
Browser Footprint
2.88 MB v4-Tiny · 32–240+ Cols
Hardened 4L Tiny ONNX (FP16 emb + INT8 MatMul) in 1-thread WASM SIMD (33.7 ms Gate-3 median, 32.1 ms incremental tail, bit-exact across append, style redraw & resize).
Blind Gate-4 Eval
0.0 False Widgets · 1.000 List F1
Verified zero-shot across 20 held-out real interactive sessions (Gate-4, 32–240+ cols) + Gate-0/2/3: 0 composer rail leaks, 0 false widgets / 100 prose bullets, 1.000 sibling list-boundary F1, 0 destructive false strips.
Lossless Guarantee
Zero LLM Hallucinations
Every run ID, file path, URL, metric, and collapsed carriage-return frame stays 100% verbatim and inspectable — never rewritten by a generative model.