Ternlight – 7 MB embedding model that runs in browser (WASM)
51–60 of 82 posts
Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#52Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#53So I pull ONNX weights from HuggingFace (MPNet, MiniLM), use Transformers.js to embed, and use a clusterer from scikit-learn (running on pyiodide - it was a surprise to me that this worked flawlessly) on the page - all client-side.
Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#54This would be a pretty cool addition to the duckdb HNSW search project I found on here some time ago: https://github.com/jasonjmcghee/portable-hnsw What I think is really cool is that the search happens using http range queries across statically hosted parquet files. I think things like this could bloom into a relatively open and distributed search ecosystem that isn’t controlled by major corporations.
Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#55Hobby 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…
Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#56Hobby 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…
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.
Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#57This is cool! but also maybe you could put a button on the landing page to trigger the demo because it's a bit startling to hear my fans go crazy when opening a webpage.
Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#58This would be a pretty cool addition to the duckdb HNSW search project I found on here some time ago: https://github.com/jasonjmcghee/portable-hnsw What I think is really cool is that the search happens using http range queries across statically hosted parquet files. I think things like this could bloom into a relatively open and distributed search ecosystem that isn’t controlled by major corporations.
Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#59Re: Ternlight – 7 MB embedding model that runs in browser (WASM)
#60Hobby 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…
We've just used it to embed the entire django doc + our private knowledge base, allowing us to search in the 2 sources instantly!