MIT License 2 files / ~40 KB Modify · commercial use OK
SlimeTree-RLM Prompt Gateway ― source release
The full source of the Gateway demo (HTML + mock JS), released under the MIT License. Free to copy, modify, redistribute, and use commercially. Only the real WASM (~272 KB) is under a separate commercial license.
⬇ index.html (33 KB) ⬇ slimetree-rlm-mock.js (7 KB) ⬇ LICENSE.txt (2 KB)
1. File layout
| Path | Size | Role |
|---|---|---|
| index.html | ~ 33 KB | The Gateway itself. Meta login / Claude key management / prompt submission UI / real-time pipeline visualization of the D · μ · R routes / WAL audit UI, all in one file. The only external dependency is the Facebook SDK (optional). |
| slimetree-rlm-mock.js | ~ 7 KB | An ES module that emulates the SlimeTree-RLM public API (init / route / getAudit / exportWAL / rollback). The SHA-256 chain is real (via crypto.subtle); tampering detection actually works. |
| LICENSE.txt | ~ 2 KB | Full MIT License text + scope note |
.txt version (text/plain) or the .js version (application/javascript) directly in your browser. Right-click → "Save" or use the download attribute on each link to save locally.
2. Full license text MIT License
2.1 Scope
This MIT License applies to only the two files index.html and slimetree-rlm-mock.js. The following are out of scope and under separate licenses:
- The real SlimeTree-RLM WASM binary (~272 KB) ― JAVATEL commercial license
- The Rust source crates (slimetree-rlm-core etc.) ― commercial license + NDA
- Patent claims 1-44 ― separate license
The mock in this demo reproduces only the API shape (function names, argument types, return shape); it does not contain the implementation's internal routing / inference / audit logic.
3. Public API surface
The mock and the real WASM expose the same public API. Switching to the real WASM only requires changing one import line.
| Signature | Returns | Description |
|---|---|---|
await init() |
Promise<SlimeTreeRLM> |
Initialization. On the real WASM, this loads the WASM and allocates linear memory. |
await rlm.route(text) |
{ verdict, payload, record_id, wal_head, latency_ms, source, suppress_reason } |
Classifies the input text. verdict is one of 'D' (instant), 'μ' (suppressed), or 'R' (LLM delegation). |
await rlm.getAudit() |
{ verified, record_count, head_hash, broken_at } |
Re-verifies the entire WAL chain with SHA-256. broken_at is the record_id where corruption was detected. |
await rlm.exportWAL() |
string (JSON) |
Serializes the full WAL to JSON (for archiving to S3 etc.). |
await rlm.rollback(ts_unix_ms) |
{ rolled_back_count, new_head, new_count } |
Discards all records newer than the given timestamp. |
4. Swap point ― mock → real WASM
Once you have the real WASM (~272 KB), you can switch by changing just one line in index.html.
// === mock version (current) ===
import { SlimeTreeRLM } from './slimetree-rlm-mock.js';
const rlm = new SlimeTreeRLM();
await rlm.init();
// === real WASM version ===
import init, { SlimeTreeRLM } from './slimetree_rlm.js';
await init({
module_or_path: './slimetree_rlm_bg.wasm',
// For shared memory: memory: new WebAssembly.Memory({ shared: true, ... })
});
const rlm = new SlimeTreeRLM({ capacity: 16 * 1024 * 1024, audit: true });
All subsequent calls (rlm.route(text) onward) are identical. See the Intermediate Tutorial for shared memory + COOP/COEP setup, and the Advanced Tutorial for WebWorker pools + persistence.
5. Usage ― drop it into your site
- Drop the 3 files (
index.html+slimetree-rlm-mock.js+LICENSE.txt) on any static host. - (optional) Replace the
__JAVATEL_META_APP_ID__inindex.htmlwith your own Meta App ID → activates Facebook login. - (optional) Tune
KNOWN_FACTSandMUTE_TRIGGERS(inslimetree-rlm-mock.js) to your business domain. - Host over HTTPS → open in a browser → start with guest login or Meta login.
Works fine as a static HTTP serve (Node / Apache / nginx / GitHub Pages / Cloudflare Pages / Vercel are all fine). No server-side runtime required.
6. Modification ideas
- Industry-specific fact tables: add canned medical / finance / legal Q&A to
KNOWN_FACTS→ D-hit rate goes up and Claude calls drop further. - Send R to a different LLM: replace
callClaude()with calls to Gemini / Llama / your own model. - Persist WAL in IndexedDB / OPFS: store the output of
exportWAL()and restore on startup. - Multi-stage gates: further subdivide
R(R-safe / R-needs-review / R-deny) and insert a human-review stage. - SAB-backed shared memory: on the real WASM, run a WebWorker pool for concurrent routing + concurrent audit.
7. Related
- Running demo: SlimeTree-RLM Prompt Gateway
- Setup guide: Meta App + Claude key + nginx setup
- Product page: SlimeTree-RLM product details
- Primary materials: SlimeTree-RLM primary materials (bench + paper + patents)
- Tutorial: Intro → Intermediate → Advanced
- Categories: DEVICE products / Resource top
← Back to Gateway demo Commercial license · custom integration
