Skip to content
Kotoshu Kotoshu 言修
News

2026-09-06 release. 6 September 2026

Semantic reranking in the browser with @kotoshu/wasm 0.2.0

The wasm engine gains the semantic path with loadModel and rerank over the int8 tiers, and CORS-open mirrors put all 55 languages within reach of a browser tab.

  1. loadModel(model_bytes, vocab_bytes) loads an int8-per-row embedding tier — mini ~3 MB, fluency ~15 MB — from ONNX bytes plus its .vocab.json sibling, returning a KotoshuModel that is the wasm twin of the gem’s ONNX provider, scored in pure Rust. rerank(model, word, context) returns the mean-cosine context score in [-1, 1] — 0.0 when the word or every token is out of vocabulary — so suggestion lists can be reordered in the browser the way the server does it. TypeScript declarations ship in the package.
  2. The mirrors make that fetchable: registry mirror URLs send Access-Control-Allow-Origin: * while GitHub release assets send no CORS header at all, so a browser tab can resolve a model tier for any of the 55 languages and pull it without a server in between. Version 0.2.0 was built and signed by the kotoshu-rs release workflow with a provenance attestation and zero dependencies.
  3. The Ruby API got its hosted reference the same morning: the YARD documentation is live at kotoshu.github.io/kotoshu/ — served from the site domain, deployed from the gem repository’s main branch — and already covers the 0.8.0 surfaces: model tiers and the confidence cascade, inline ignores, CI baselines, and the pre-commit hook.

see also @kotoshu/wasm on npm kotoshu-rs YARD API reference