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

PathSizeRole
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
Reading the source: clicking the links above opens the .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

MIT License Copyright (c) 2026 JAVATEL Inc. <https://javatel.co.jp/> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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.

SignatureReturnsDescription
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

  1. Drop the 3 files (index.html + slimetree-rlm-mock.js + LICENSE.txt) on any static host.
  2. (optional) Replace the __JAVATEL_META_APP_ID__ in index.html with your own Meta App ID → activates Facebook login.
  3. (optional) Tune KNOWN_FACTS and MUTE_TRIGGERS (in slimetree-rlm-mock.js) to your business domain.
  4. 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

← Back to Gateway demo Commercial license · custom integration