Transformers.js documentation
backends/onnx
Get started
Tutorials
Building a Vanilla JS ApplicationBuilding a React ApplicationBuilding a Next.js ApplicationBuilding a Browser ExtensionBuilding an Electron ApplicationServer-side Inference in Node.jsBuilding a Next.js AI Chatbot with Vercel AI SDK
Developer Guides
Running models on WebGPUUsing quantized models (dtypes)Accessing Private/Gated ModelsServer-side Audio Processing
Integrations
API Reference
You are viewing main version, which requires installation from source. If you'd like
regular npm install, checkout the latest stable version (v3.8.1).
backends/onnx
Handler file for choosing the correct version of ONNX Runtime, based on the environment:
- When running in node, we use
onnxruntime-node(onnxruntime-webis not bundled). - When running in the browser, we use
onnxruntime-web(onnxruntime-nodeis not bundled).
This module is not directly exported, but can be accessed through the environment variables:
import { env } from '@huggingface/transformers';
console.log(env.backends.onnx);Type Definitions
ONNXExecutionProviders
Type: InferenceSession.ExecutionProviderConfig