hjLabs AI Playground
Starting the on-device runtime…
WebAssembly runs ONNX models on the CPU and is supported everywhere; WebGPU hands the same graph to your graphics card and runs several times faster once warm (4.7x per run measured below on a small embedding model), with the gap widening as the model grows. WASM still wins on tiny models where kernel launch overhead dominates, on browsers with no WebGPU, and when you need multi-threading via SharedArrayBuffer. This page lays out the trade-offs — precision support, buffer size limits, load time, and the fp16 trap — and explains how this playground chooses a backend automatically.
Measured with this page's own benchmark: all-MiniLM-L6-v2 (fp32, 22.7M parameters) in Chrome on an NVIDIA RTX 5050 Laptop GPU against the same machine's CPU, both loaded from the browser cache. WebGPU: 532 ms load and compile, 211 ms first run, 17 ms median per run. WebAssembly: 270 ms load, 92 ms first run, 81 ms median. WebGPU was 4.7x faster per run once warm, but slower to start, so WASM wins a single short input and WebGPU wins from roughly the third run onward.
Chrome and Edge 113+ on Windows, macOS, ChromeOS and Linux; Safari 26+; Firefox on Windows with wider platform support rolling out. Where it is missing, the WASM backend still works.
WebGPU exposes half precision through the optional "shader-f16" feature, and plenty of otherwise capable adapters — including NVIDIA GPUs under Linux Chrome — report it as unavailable. Always check adapter.features.has("shader-f16") before selecting an fp16 or q4f16 model.