Ternlight packs a text-embedding model into a 7 MB browser-ready WASM bundle
Ternlight is a compact text-embedding model that runs entirely client-side in the browser via WebAssembly, with no server calls or API keys. The full engine plus weights ship as a single 7 MB npm package (@ternlight/base), with a smaller 5 MB ‘mini’ tier available. There’s no separate model download step — installing the package is all that’s needed, and inference runs on the CPU without requiring a GPU.
The pitch is speed and simplicity for semantic search and similarity ranking: the demo advertises embeddings in roughly 5 milliseconds and exposes a minimal API (embed and similar functions) for tasks like ranking a set of documents against a query. A live demo lets users search React’s documentation locally in the browser, chunking the docs and computing embeddings on-device.
The significance is mainly about moving embedding workloads off the network and onto the edge. By keeping everything in the browser, Ternlight eliminates per-query latency, ongoing API costs, and the privacy exposure of sending user text to a third-party service — a practical fit for in-app search, on-device retrieval, and offline-capable tools, at the cost of the accuracy tradeoffs inherent in a heavily size-constrained model.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.