Skip to main content
ONNX Runtime Web provides browser-specific APIs and configurations for running models in web applications.

Environment Configuration

ort.env

Global environment configuration object.

WebAssembly Configuration

WASM Paths

Configure paths to WebAssembly files.

Or specify a base path:

SIMD Support

Enable SIMD for better performance.

Multi-threading

Configure number of threads.

Proxy Mode

Enable proxy for multi-threading.

Complete WASM Configuration

WebGL Configuration

Context Settings

Performance Tuning

Complete WebGL Configuration

WebGPU Configuration

Device Selection

Graph Capture

Feature Detection

Check WebAssembly Support

Check SIMD Support

Check WebGPU Support

Check WebGL Support

Complete Feature Detection

Loading Models

From URL

From Local File

From File Input

From Blob

Session Caching

Cross-Origin Isolation

For multi-threading support, enable cross-origin isolation:

Server Headers

Checking Isolation

Build Configuration

Webpack Configuration

Vite Configuration

Complete Web Application Example

Performance Monitoring

See Also