Runtime & engines
How Transformers.js, ONNX Runtime, WebGPU, WASM and WebNN divide the work in a browser.
2 posts
The demos here run on several stacks at once: Transformers.js pipelines, raw onnxruntime-web sessions, MediaPipe Tasks and a few libraries that compile a whole task to WASM. One page can use three of them together. Here is which layer does what, and how we pick a stack for a new task.
WebNN is the only web API that can reach an NPU, and outside Chromium it has not landed yet. It takes existing ONNX weights with no conversion.