HeadlinesBriefing favicon HeadlinesBriefing.com

Ternlight: 7MB Browser Embedding Model

Hacker News •
×

Ternlight delivers a compact, 7MB embedding model designed for in-browser execution via WebAssembly (WASM). This approach eliminates the need for server-side API calls, allowing developers to integrate semantic search and text embedding directly into web applications.

The core engine and weights for the base model occupy just 7MB, with a further optimized "mini" variant available at 5MB. These models operate directly on the user's CPU, achieving embedding speeds of approximately 5 milliseconds without requiring a GPU. This makes it feasible for real-time search functionalities within the browser.

Integration is simplified through a single npm package, removing the need for separate model downloads or server infrastructure. An example demonstrates its use for semantic search, enabling developers to find similar text snippets from a provided dataset with minimal code. The technology powers features like in-browser search for documentation, as seen with a demonstration using React's documentation.