Lurker News
A year ago, my co-founder launched Desktop Docs here on HN. It's a Mac app we built with Electron that uses CLIP embeddings to search photos and videos locally with natural language. We got positive feedback from HN and our first paying customers, but the app was almost 1GB and clunky to use.

TLDR; rebuilding in Rust was the right move.
So we rewrote the app with Rust and Tauri and here are the results:
- App size is 83% smaller: 1GB → 172MB - DMG Installer is 70% smaller: 232MB → 69.5MB - Indexing files is faster: A 38-minute video now indexes in ~3 minutes instead of 10-14 minutes - Overall more stability (old app used to randomly crash)
The original version worked, but it didn't perform well when you tried indexing thousands of images or large videos. We lost a lot of time struggling to optimize Electron’s main-renderer process communication and ended up with a complex worker system to process large batches of media files.
For months we wrestled with indecision about continuing to optimize the Electron app vs. starting a full rebuild in Swift or Rust. The main thing holding us back was that we hadn’t coded in Swift in almost 10 years and we didn’t know Rust very well.
What finally broke us was when users complained the app crashed their video calls just running in background. I guess that’s what happens when you ship an app with Chromium that takes up 200mb before any application code.
Today the app still uses CLIP for embeddings and Redis for vector storage and search, except Rust now handles the image and video processing pipeline and all the file I/O to let users browse their entire machine, not just indexed files.
For the UI, we decided to rebuild it from scratch instead of porting over the old UI. This turned out well because it resulted in a cleaner, simpler UI after living with the complexity of the old version.
The trickiest part of the migration was learning Rust. LLMs definitely help, but the Rust/Tauri community just isn’t as mature compared to Electron. Bundling Redis into the app was a permissioning nightmare, but I think our solution with Rust handles this better than what we had with Electron.
All in, the rebuild took about two months and still needs some more work to be at total parity with its Electron version, but the core functionality of indexing and searching files is way more performant than before and that made it worth the time. Sometimes you gotta throw away working code to build the right thing.
AMA about Rust/Tauri migration, Redis bundling nightmares, how CLIP embeddings work for local semantic search, or why Electron isn't always the answer.

Comments (443) 84 threads

Earlier comments
kunley#
Any effort to get rid of the Electron bloat is great.
capyba#
I’ve been trying to build a desktop app in Rust+egui but as a Rust newbie (and desktop app newbie in general) I’ve found it really difficult to learn so many concepts at once. My work centers around mechanical engineering analysis tools which require high perf backend and data visualization on the front end. With Tauri did you find it difficult to maintain multiple stacks (rust, js, html, etc)?
minimaxir1 reply#
> Today the app still uses CLIP for embeddings

Have you investigated multimodal embeddings from other models? CLIP is out of date, to put it mildly.

correa_brian1 reply#
For sure. We've been prototyping embedding a vision model in desktop docs, but just needs more dev time to be stable. Went with CLIP for parity, but we are looking to upgrade soon. I tried Siglip and wasn't impressed. Do you know other open-source image embedding models you'd recommend?
minimaxir1 reply#
nomic-embed-vision-1.5 (https://huggingface.co/nomic-ai/nomic-embed-vision-v1.5) is alignable with nomic-embed-text-1.5 for multimodal retrieval and implements some more modern LLM improvements, although it doesn't solve some of the problems CLIP has.

Given the importance to your business, it may be worthwhile into finetuning a modern native multimodal model like Gemma 3 to output aligned embeddings, albeit model size is a concern.

correa_brian#
I love Gemma. I use it on LM studio and am working on getting it into Desktop Docs. Thats for the nomic link. I'll do some testing...
joshterrill1 reply#
I'm curious how you're implementing the image similarity matching. I recently reverse engineered the Apple Neural Hash model and wrote an API to use it in my app for doing image similarity calculations. I found it to be extremely quick compared to some of the other more computationally intensive methods that I was trying to use before.
correa_brian1 reply#
We're using redis vector modules for cosine similarity. I'm sure there's more to optimize there. Your project sounds cool. How'd you reverse engineer apple's model?
joshterrill#
I extracted the espresso model files from a recent iOS build and then wrote a python script to unpack the weights and save them in an open source format that is easier to work with, in my case it was onnx. Through many rounds of iteration, I converted each neural network layer from espresso to its onnx equivalent and eventually got something that works, then turned it into an API. If you want me to send it to you, let me know! My GitHub username is the same username I have on here, and on my GitHub you’ll find my email.

Load more comments