ONNX Runtime
Cross-platform, high-performance ML inference and training accelerator for ONNX models
Repository Health
Technical Analysis
ONNX Runtime is a cross-platform machine-learning inference and training accelerator maintained by Microsoft. It executes models exported to the ONNX (Open Neural Network Exchange) format regardless of which framework trained them — PyTorch, TensorFlow/Keras, scikit-learn, LightGBM, XGBoost, and others all export to ONNX and can then be served by the same runtime. Rather than re-implementing a training framework, ONNX Runtime focuses on making inference (and, via ONNX Runtime Training, gradient-based training) fast and portable across wildly different hardware and operating systems.
The engine’s core abstraction is the Execution Provider (EP): a pluggable backend that maps ONNX graph operators onto specific hardware — CUDA and TensorRT for NVIDIA GPUs, DirectML and WinML for Windows, CoreML for Apple hardware, OpenVINO for Intel, QNN for Qualcomm NPUs, WebGPU/WASM for the browser, and a portable CPU fallback. At load time the runtime partitions the model graph across whichever providers are registered, applies graph-level optimizations (operator fusion, constant folding, layout transforms), and dispatches each subgraph to the fastest available provider. Bindings are published for Python, C/C++, C#, Java, JavaScript/TypeScript (Node and browser), Objective-C, and Rust, making it one of the few inference engines usable natively from nearly every major application platform.
What You Get
- A single
InferenceSessionAPI (mirrored across Python, C++, C#, Java, JS, Rust, Objective-C) for loading and running ONNX models - A pluggable Execution Provider architecture spanning CUDA/TensorRT, DirectML, CoreML, OpenVINO, QNN, WebGPU/WASM, and a portable CPU backend
- Graph-level optimizations — operator fusion, constant folding, layout transforms — applied automatically at model load time
- ONNX Runtime Training, adding gradient computation on top of the same graph/EP infrastructure for accelerating PyTorch training loops
- Companion tooling for quantization, model conversion, and packaging, plus dedicated example repos for inferencing and training
Common Use Cases
- Serving a PyTorch or TensorFlow model in production without carrying the full training framework as a runtime dependency
- Deploying the same model consistently across CPU, GPU, mobile, and browser targets by switching Execution Providers rather than rewriting inference code
- Accelerating classical ML pipelines (scikit-learn, LightGBM, XGBoost) exported to ONNX for lower-latency serving
- Speeding up large transformer model training on multi-node NVIDIA GPUs via ONNX Runtime Training with minimal changes to an existing PyTorch script
Under The Hood
Architecture - At the center of the codebase is a graph-based inference engine (onnxruntime/core/) that loads an ONNX protobuf model, builds an in-memory graph representation, and partitions it across one or more registered Execution Providers before running the fused, hardware-specific subgraphs. Each EP (CUDA, TensorRT, DirectML, CoreML, OpenVINO, QNN, WebGPU, and the default CPU provider) implements a common kernel-registration interface so the same graph can be split across heterogeneous hardware transparently to the caller. Language bindings (onnxruntime/python, csharp/, java/, js/, objectivec/, rust/) wrap the C API rather than reimplementing engine logic, keeping behavior consistent across languages. orttraining/ extends the same graph infrastructure with automatic differentiation for training scenarios. Tech Stack - The engine core is C++ (roughly 84% of the codebase) with CUDA/HIP kernels for GPU providers, CMake as the primary build system, and per-language packaging (setuptools/wheel for Python via setup.py, NuGet for C#, npm for JS/TS, Maven-style build for Java, Cargo for Rust). Build scripts (build.sh/build.bat) orchestrate a large, configurable CMake build supporting dozens of hardware/OS/EP combinations from a single source tree. Code Quality - Testing is extensive and organized per surface: onnxruntime/test/ covers the core engine, with parallel test suites in csharp/test, java/testdata, objectivec/test, and winml/test; a dedicated tools/perftest directory covers performance regression testing. Given the C++ core’s scale (950+ contributors, ~15k commits), code quality is enforced through required CI across many hardware targets, CPPLINT.cfg/lintrunner configs, and a documented CODEOWNERS review structure rather than a single style guide. API Design - The public API is deliberately small and uniform across every language binding: construct a session from a model, gather input tensors, call run, and read output tensors — the same four-step shape whether calling from Python, C#, Java, or Rust. This consistency is the project’s main developer-experience achievement, since it lets the same mental model transfer across a dozen deployment targets even though the underlying hardware dispatch is highly complex.
Used by 9 apps in this directory
Agno
Devops · AI Development · Automation
Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.
Banana Slides
AI Design Tools · Productivity
AI-native PPT generator with Vibe editing, multi-LLM support, and fully editable PPTX export
headroom
AI Development · Developer Tools
Compress everything your AI agent reads — tool outputs, logs, RAG chunks, and files — before it reaches the LLM, achieving 60–95% fewer tokens with the same answers.
knowhere
AI Development · Developer Tools
Transform messy, unstructured documents into persistent, navigable memory that AI agents can actually use.
Langflow
AI Agents · AI Development
Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.
LibrePhotos
File Storage
Self-hosted photo library with AI-powered face recognition, semantic search, and automatic event albums — no cloud required.
magika
Developer Tools · Security
AI-powered file type detection that identifies 200+ content types with ~99% accuracy in milliseconds using a compact deep learning model.
MemPalace
AI Agents · AI Development
Local-first AI memory with verbatim storage, pluggable backends, and 96.6% retrieval recall on LongMemEval — no API key required.
Open WebUI
AI Assistants · AI Agents
The extensible, privacy-first AI platform that runs Ollama, OpenAI, and any LLM backend behind a polished, feature-packed web interface.