| Hobby project, I wanted to "ship a useful model in a web browser". so I distilled a small sentence encoder from MiniLM with ternary quantization-aware training. Also wrote the inference engine from scratch and shipped in Rust → WASM SIMD. It's an embeddings model, not an LLM: text goes in, a 384-dim vector comes out, and cosine similarity between two vectors tells you how related the texts are — regardless of shared words ("reset my password" ↔ "I forgot my password" → 0.88). Used for semantic search, FAQ/intent matching, and clustering. Running it on-device means search-as-you-type semantic search is performant with no API dependencies. Demo (2k React docs, fully on-device): https://ternlight-demo.vercel.app Two tiers on npm:
- @ternlight/base (7 MB, ~5 ms/embed, more capable embedings)
- @ternlight/mini (5 MB wire, ~2.5 ms/embed). Bundled for Node and browsers. Repo - see technical details (MIT, training pipeline included): https://github.com/soycaporal/ternlight Curious if this is something useful, what are the use cases for on-device embeddings. |
Do you think your work could help us let users type "pancake" and get "crêpe" without writing an explicit "pancake = crêpe" dictionary entry ?
In practice : if I understand well, your lib would first need to download 5 Mb, once and for all, and would then be used as we use Fuse.js right now ?
How well does it handle languages other than English ?
Could it be "trained" on the OpenStreetMap tag wiki ?
Thanks a lot for your work.