Skip to main content
ONNX Runtime for Node.js provides server-side machine learning capabilities with support for CPU and GPU acceleration.

Installation

CPU Version

GPU Version (CUDA)

Importing

CommonJS

ES Modules

Loading Models

From File Path

From Buffer

Async File Loading

Execution Providers

CPU Provider

CUDA Provider

TensorRT Provider

CoreML Provider (macOS)

DirectML Provider (Windows)

Session Configuration

Thread Configuration

Graph Optimization

Memory Configuration

Complete Node.js Server Example

Express API Server

Batch Processing Script

Worker Threads for Parallel Processing

File System Integration

Processing Directory of Files

Environment Variables

Performance Monitoring

Error Handling

See Also