AI Inference Guide
Web Browser Inference
Browser-Based AI Inference
Supported models can run in a browser through WebGPU or WebAssembly. This can reduce remote data transfer and API cost and can work offline after every required asset is cached, provided telemetry and remote fallbacks are disabled. Device memory, startup time, energy use, and model licences still apply.
Key Features
WebGPU acceleration
OpenAI-compatible API
Runs locally
Benchmark per browser and device
npm install @mlc-ai/web-llmKey Features
Local execution option
WebGPU acceleration
No inference API required
Offline after assets are cached
npm install @browserai/browseraiKey Features
Cross-browser compatible
WebAssembly SIMD
WebWorker support
Hardware-dependent throughput
See the vendor SDK documentation for supported platformsCompatibility is a runtime check
Browser, operating-system, GPU, driver, secure-context, and enterprise-policy support evolves. Do not infer availability from the browser name alone; test the exact device matrix and keep a server or CPU fallback.
WebGPU gate
Check navigator.gpu, request an adapter/device, handle loss, and enforce resource limits.
WebAssembly gate
Feature-detect SIMD and threads; threaded runtimes can also require cross-origin isolation.