5 ms·
Ask HN: Is It Possible to Embed Text (As Vectors) Using WASM?
I'm currently working on a project that fetches gmail emails and essentially does RAG on them to surface insights from the large number of emails that most people have.
This poses a problem, because each user will onboard with a large amount of data that needs to be processed. I am attempting to do this in the browser using rust and web assembly in order to save on compute costs. I want to ultimately convert the data to vectors and store in qdrant for ease of search, however all of the rust crates I have found for embedding text (fastembed, rust_sentence_transformers etc.) do not work in wasm. I have also seen projects like voy, that handle embeddings in JS, however this would be to slow when running on a user's emails.
Does anyone know of any projects or crates that can embed text in web assembly? Or alternatively, does anyone have any other ideas on how to implement this efficiently?
Thanks!
- inhumantsar 2y agothis might be a good place to start: https://huggingface.co/spaces/radames/Candle-BERT-Semantic-Similarity-Wasm https://huggingface.co/spaces/radames/Candle-BERT-Semantic-S...
- jacobhq 2y agoThank you, this looks amazing! I'll have a poke around and try to implement it my self.