Ask HN: What's the idea behind the WebNN API?
The WebNN API will make it possible to run AI models in the browser: https://www.w3.org/TR/webnn/
The idea of having AI in browsers (see the "Application Use Cases") seems cool, but on the other hand, the idea of downloading & storing large models for each website/webapp seems terrible.
It seems to me that it would make more sense to have models built into browsers, and to have a web API that provides standardized ways to interact with the underlying models of each browser. From what I have understood from the WebNN spec, though, despite listing out all of the cool use-cases, the API doesn't seem intended to provide higher level functionality than loading, running & performing operations on a model.
Is my understanding of the API right, or is there something else that uses it to make these use-cases available in browsers?
13 comments
[ 4.2 ms ] story [ 39.5 ms ] threadFor example, many chess engines these days are already based on neural networks, and these run pretty well in WASM (for example, Stockfish, one of the strongest engines, has a 7M and a 44M version on lichess.org), but as far as I understand that's mostly because they're optimized for CPU usage.
It would be pretty cool to be able to run similar specialized models on the best execution resources a device has available and not just the CPU (or maybe a GPU via WebGPU).
Do they? At least some of them seem much smaller than Stockfish's NNUE.
If the models were built into the browser, the browser would need to download & store the model data, but that can at least be a lot more efficient than websites doubling up on download & storage of models.
So when you have a webbrowser based photo editor or other tools, you can build things which do not require a backend server.
Not everything has to run remote and without such an API you can't use it locally.
Perhaps this will allow me/us to write a website for a local agent as well or an assitant.
The question is, where are the models coming from? If they're downloaded & stored for each website, that's going to get out of hand very quickly. It seems to make sense for browsers to ship with some useful default models, but that doesn't seem to be what the specification is for.
I would be happily running my custom agent models on my gpu without sharing those models and still being able to use the browser as an interface.
web-safe-models heh.