onnxruntime-node

Microsoft's official Node.js binding for running ONNX model inference in production JavaScript apps

Library
npm
v1.27.0
21,399stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
95/100Excellent
Development Activity100
Maintenance96
Community84
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
86/100Excellent
Architecture92
Code Quality90
Innovation85
Learning Curve78

onnxruntime-node is the official Node.js binding for ONNX Runtime, Microsoft’s cross-platform machine-learning inference and training accelerator. It lets Node.js and Electron applications load ONNX models exported from PyTorch, TensorFlow, scikit-learn, and other frameworks, then run inference locally with native-speed execution.

The package ships prebuilt native binaries for Windows, macOS, and Linux across CPU and GPU execution providers (CUDA, DirectML, CoreML, WebGPU), so most consumers get hardware-accelerated inference with a single npm install and no local build step. It sits underneath higher-level JavaScript AI tooling and is the standard way to serve ONNX models from a Node.js backend.

What You Get

  • Prebuilt native binaries for Windows, macOS, and Linux (x64 and arm64) with no local compilation required
  • Multiple execution providers: CPU by default, plus CUDA, DirectML, WebGPU, and CoreML for hardware acceleration
  • A shared onnxruntime-common TypeScript API surface also used by the browser (onnxruntime-web) and React Native bindings, so model code ports across platforms
  • Support for both the stable release channel and nightly @dev builds for early access to new execution providers
  • Compatibility with Electron apps in addition to plain Node.js runtimes

Common Use Cases

  • Serving a PyTorch or TensorFlow model exported to ONNX from a Node.js API backend without a separate Python inference service
  • Running local, on-device inference in an Electron desktop application
  • GPU-accelerated inference pipelines on Linux/Windows servers via CUDA or DirectML
  • Backing JavaScript AI SDKs and libraries (e.g. embedding or tokenizer pipelines) that need a portable ONNX runtime under the hood

Under The Hood

Architecture: onnxruntime-node is a thin native-addon layer over the shared ONNX Runtime C++ inference engine that lives in the same monorepo. src/inference_session_wrap.cc wraps the core InferenceSession C++ class via node-addon-api, exposing it to JS as binding.ts -> index.ts, which in turn implements the platform-agnostic InferenceSession/Tensor interfaces declared in the shared onnxruntime-common package (also consumed by onnxruntime-web and onnxruntime-react-native). Execution provider selection (CPU/CUDA/DirectML/CoreML/WebGPU) is resolved at session-creation time and dispatches into the corresponding native EP built into the prebuilt binary. Tech Stack: The public surface is TypeScript compiled to both CJS and ESM; the native layer is C++ built with node-addon-api and packaged per-platform via postinstall/script/install, with adm-zip and global-agent handling binary download/proxying. Code Quality: The repo carries an extensive C++/JS test suite (test/test-main, mocha-based JS tests, CI matrices across OS/EP combinations) reflecting Microsoft’s production usage; the JS layer itself is a thin, well-typed wrapper so most correctness risk sits in the native engine, which has its own dedicated test suites. API Design: The InferenceSession.create() -> run() pattern is minimal and consistent across all three JS packages (node/web/react-native), so a model pipeline written once ports with little change between server, browser, and mobile targets; the tradeoff is that platform-specific concerns (execution providers, binary installation) leak into setup/install steps rather than being abstracted away.

Used by 7 apps in this directory

TypeScript
84%
MIT

Amical

Note Taking · AI Assistants

1,495

Local-first AI dictation that understands your active app — private, offline, and built for speed.

View details
79
Repo Health
82
Technical
67
Dependency
Built with
TypeScript84%
Updated 3 weeks ago
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

50,753

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
88
Repo Health
84
Technical
71
Dependency
Built with
TypeScript99%
Updated today
TypeScript
84%
Apache 2.0

Continue

Developer Tools · AI Development · AI Code Assistants

35,532

Open-source coding agent for VS Code, JetBrains, and CLI with support for 30+ LLM providers.

View details
87
Repo Health
88
Technical
65
Dependency
Built with
TypeScript84%
Updated today
TypeScript
89%
Apache 2.0

HyperFrames

AI Development · AI Design Tools

41,625

Turn plain HTML and CSS into deterministic, pixel-perfect MP4 videos — authored by humans or AI agents, rendered by headless Chrome and FFmpeg.

View details
82
Repo Health
83
Technical
65
Dependency
Built with
TypeScript89%
Updated today
TypeScript
76%
Other

Joplin

Note Taking

56,003

The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.

View details
93
Repo Health
87
Technical
62
Dependency
Built with
TypeScript76%
JavaScript15%
Updated yesterday
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

27,294

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
88
Repo Health
73
Technical
66
Dependency
Built with
TypeScript99%
Updated today
JavaScript
57%
MIT

OpenWhispr

Productivity · AI Assistants

5,555

Privacy-first, cross-platform voice-to-text with local AI and cloud options

View details
87
Repo Health
80
Technical
72
Dependency
Built with
JavaScript57%
TypeScript37%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search