logoalt Hacker News

gitgudlast Sunday at 12:32 AM2 repliesview on HN

So at that tiny 500kb size I imagine it could be compiled to web assembly, and run entirely in the browser right?

Couldn’t find a link, is that hard to do?


Replies

hahahaalast Sunday at 12:53 AM

500k memory but not sure about disk.

scoriiulast Sunday at 8:41 AM

Should be very doable. I ship a small CNN in a browser extension via onnxruntime-web and the model weights were never the bottleneck, the runtime was. The wasm backend adds a few MB of runtime before your first inference, so a 500kb model with a lean hand-rolled wasm build would actually beat most "tiny" browser ML deployments in total download.

One gotcha if anyone wants this in a Chrome extension: MV3 requires 'wasm-unsafe-eval' in the CSP for any wasm at all, which surprised me the first time a build that worked fine as a web page died silently as an extension.

show 1 reply