First baselines (frozen)
+
+ Quoted verbatim from{" "}
+
+ interscript-rs docs/benchmarks/BASELINES-2026-11.md
+ {" "}
+ (2026-11-21 run): the first measured baselines of the full registry path. One-shot serial
+ run on an otherwise idle machine (Apple M1 Max, 10 cores, 64 GB, macOS 14.1.1) —
+ numbers are single-run baselines, not medians. All four runtimes loaded the same maps
+ corpus pin (9cfbf4cf, 457 maps) and transliterated the same deterministic
+ 200-doc sample. Measure definitions and the runner interface: the{" "}
+
+ full protocol.
+
| Runtime | +Cold load (s) | +Loaded | +RSS @ load (MB) | +Docs/sec | +Chars/sec | +RSS @ throughput (MB) | +Peak doc (ms) | +RSS @ peak (MB) | +
|---|---|---|---|---|---|---|---|---|
| {row.runtime} | +{row.coldLoad} | +{row.loaded} | +{row.rssLoad} | +{row.docsPerSec} | +{row.charsPerSec} | +{row.rssThroughput} | +{row.peakDoc} | +{row.rssPeak} | +
+ Definitions (from the protocol): cold load = a fresh process loading all + 457 maps through the runtime's standard registry path; docs/sec = warm + throughput over the 200-doc set × 5 loops; peak doc = fresh-process load + plus a single transliteration of the largest input doc; RSS = process + resident set of the whole runner, so cross-runtime deltas include each interpreter's own + baseline — per-runtime trends over time are the primary signal. +
+
+ Reading the spread: TypeScript's 0.28 s cold load reads the pre-compiled JSON-IR
+ artifact (deserialise + link, not ISC parsing); Ruby's 137.6 s / 974 MB is
+ per-map parsanol compilation, after which it is the fastest runtime warm (1,976
+ docs/sec); Rust parses .isc at load and cannot load one map whose{" "}
+ rababa funcall needs external ML engines (unsupported in that slice, by
+ design); the Python row is the pre-#49 engine — 22 parser-gap maps did not
+ load.
+
+ Same-day refresh: after py caching (#48) and full parser coverage
+ (#49), py loads 457/457, cold load 7.27 s, and reaches 91.1 docs/sec
+ (2,496 chars/sec) with zero errors — +75% warm throughput while decoding strictly more
+ work (all 200 docs vs the baseline's 193); peak doc unchanged at 42 ms. Per the
+ baselines doc, that refresh number is not directly comparable to the baseline row — the
+ honest statement is more work, fewer errors, on the same machine and corpus pin.
+
Reproduce
@@ -417,6 +547,9 @@ node scripts/benchmarks/generate.mjs font-size: 0.85rem; color: var(--color-stone); } + .table-scroll { + overflow-x: auto; + } td.fine-print { max-width: 22rem; } diff --git a/src/pages/ml.astro b/src/pages/ml.astro index 6dc21a1..c921c60 100644 --- a/src/pages/ml.astro +++ b/src/pages/ml.astro @@ -414,41 +414,84 @@ const modelCount = all.lengthThe crystals
- The neural layer is served by secryst — the same cross-runtime contract as the map - layer. Ruby, Python, and TypeScript resolve a model id against the index, fetch (or reuse the - cache), verify every checksum, and decode with the KV-cache graph. Golden sets pin the three - implementations to each other. + The neural layer is served by the runtimes themselves — the same cross-runtime contract + as the map layer. Ruby, Python, and TypeScript resolve a model id against the index, fetch + (or reuse the cache), verify every checksum, and decode locally — KV-cache streaming for + the seq2seq family, mask-predict passes for the plane family. Golden sets pin the three + implementations to each other; install lines and the three-line recipe are in{" "} + Use the models below.
# Ruby
-gem install secryst
-
-# Python
-pip install secryst
-
-# TypeScript / JavaScript
-npm install secryst
- require "secryst"
-model = Secryst::Model.load("tha-g2p-small-1.0")
-model.translate("สวัสดี")
-# => "sa˨˩.wat̚˨˩.diː˧"
-
- Point deployments at a mirror with SECRYST_INDEX; pin the cache with SECRYST_CACHE. Both are read at call time in all three runtimes.
+ Point deployments at a mirror with INTERSCRIPT_ML_INDEX; pin the cache with{" "}
+ INTERSCRIPT_ML_CACHE (the old SECRYST_* names still work as
+ aliases). Both are read at call time in all three runtimes.
Without installing anything: the same models answer the REST
endpoint POST https://api.interscript.org/v1/infer (open CORS, no key), and run in the
browser at the demo page. In a script with no build step, the map
- layer loads from esm.sh — full recipe in the
+ layer loads from esm.sh — full recipe in the
package's docs/CDN.md.
Getting started
++ A model id resolves against the models.yaml index, downloads once, and is sha256-verified + on every load — then it runs locally, no server involved. Three lines per runtime. The + example restores the nikud a scribe left out; the input and output are a frozen + conformance vector, and all three runtimes are gated to produce it byte-exactly. +
+{`# install — the neural layer ships inside the same package
+npm install interscript # TypeScript / JavaScript
+gem install interscript # Ruby (onnxruntime loads lazily)
+pip install "interscript[ml]" # Python`}
+ {`// TypeScript
+import { imf, PlaneModel } from "interscript/ml"
+
+const model = await PlaneModel.fromZip((await imf.resolve("heb-vocalized-plane-3.0")).bytes)
+await model.transform("ואם הזה, כשר")
+// → "וְאִם הִזָּה, כָּשֵׁר"`}
+ {`# Ruby
+require "interscript/ml"
+
+model = Interscript::ML::PlaneModel.from_zip(
+ File.binread(Interscript::ML::IMF.resolve("heb-vocalized-plane-3.0")))
+model.translate("ואם הזה, כשר")
+# => "וְאִם הִזָּה, כָּשֵׁר"`}
+ {`# Python
+import interscript
+
+interscript.transliterate("heb-vocalized-plane-3.0", "ואם הזה, כשר")
+# → "וְאִם הִזָּה, כָּשֵׁר"`}
+
+ First use downloads the int8 artifact (about 416 MB for this model) and caches it —
+ point the cache at INTERSCRIPT_ML_CACHE (default{" "}
+ ~/.cache/interscript-ml); every later load re-verifies the sha256, the cache is
+ never trusted blindly. Other model kinds share the same three steps: seq2seq ids load
+ through{" "}
+ Interscript::ML::Translator.new(model_file:) in Ruby,{" "}
+ Model.load(id) in Python, imf.IMFModel.load(id) in TypeScript.
+
+ Version note: Python 0.2.1 still pins the previous model index — until its next release
+ ships the index-v16 pin, set INTERSCRIPT_ML_INDEX to the index-v16{" "}
+ models-index.yaml URL (all three runtimes read the variable at call time). The
+ Rust runtime serves the map layer; neural inference ships in the TypeScript, Ruby, and
+ Python runtimes.
+