Ternlight – 7 MB embedding model that runs in browser (WASM)(ternlight-demo.vercel.app)
263 points by soycaporal 13 hours ago | 57 comments
tl;dr: Ternlight is a small text embedding model (7 MB base, 5 MB mini variant) that runs entirely in the browser via WASM on CPU, with no API calls or GPU required. It ships as a single npm package (`@ternlight/base`) with no separate model download step, producing embeddings in roughly 5 ms for tasks like semantic search.
HN Discussion:
  • Author explains the project as a distilled ternary-quantized sentence encoder shipped via Rust/WASM
  • Excitement about local, private, CPU-based embedding models enabling new use cases like search
  • Sees potential for integration with distributed/open search ecosystems like DuckDB HNSW
  • Shares related prior work using ONNX/Transformers.js for similar in-browser embedding tasks
  • Concern about websites abusing browser CPU to run models for tracking or profiling users