ort

A safe Rust wrapper for ONNX Runtime — fast ML inference and training

Library
Cargo
v2.0.0-rc.15
2,584 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
89 /100 Excellent
Development Activity 100
Maintenance 96
Community 68
Maturity 52
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
78 /100 Good
Architecture 85
Code Quality 82
Innovation 78
Learning Curve 65

ort is a Rust interface for performing hardware-accelerated inference and training on machine learning models in the ONNX format. Built as the spiritual successor to the now-inactive onnxruntime-rs, it is primarily a safe wrapper around Microsoft’s ONNX Runtime library, with additional support for alternative pure-Rust backends.

The library is designed to run models exported from PyTorch, TensorFlow, Keras, scikit-learn, or PaddlePaddle either on-device or in a datacenter, and supports a very wide range of hardware accelerators — CUDA, TensorRT, OpenVINO, DirectML, CoreML, ROCm, and many more — while remaining light enough to ship inside end-user applications.

What You Get

  • A safe Rust API over ONNX Runtime 1.27 for loading and running ONNX models
  • Support for dozens of execution providers/accelerators (CUDA, TensorRT, OpenVINO, DirectML, CoreML, ROCm, XNNPACK, and more)
  • Optional training support in addition to inference-only workloads
  • Integration with ndarray and half-precision types for tensor input/output
  • Alternative pure-Rust backend support beyond the default ONNX Runtime binding
  • fetch-models and load-dynamic features for flexible model/runtime loading

Common Use Cases

  • Deploying PyTorch/TensorFlow/scikit-learn models exported to ONNX for fast on-device inference in Rust applications
  • Running GPU-accelerated inference in datacenter services using CUDA or TensorRT execution providers
  • Shipping ML inference inside lightweight desktop or embedded applications without a Python runtime
  • Fine-tuning or training ONNX models directly from Rust using the training feature

Under The Hood

Architecture - The crate’s src/ is organized around distinct concerns: session/ handles model loading and execution session configuration, value/ implements ONNX tensor/value types, ep/ (execution providers) abstracts over the dozens of supported hardware backends, operator/ exposes custom-operator registration, and training/ layers on gradient-based fine-tuning support. The heavy lifting of actually calling into the C ONNX Runtime library is isolated in a separate ort-sys workspace member, keeping unsafe FFI bindings out of the main safe-Rust crate.

Tech Stack - ort links against ONNX Runtime 1.27 via ort-sys’s FFI bindings and supports optional integrations with ndarray (tensor types), half (fp16/bf16), and num-complex, all gated behind Cargo features so consumers only pull in what they use. The crate targets Rust edition 2024 with MSRV 1.88 and supports feature-gated load-dynamic/fetch-models for choosing how the native runtime is located or downloaded at build/runtime.

Code Quality - The project uses Codecov for coverage tracking, maintains a tests/ directory including a dedicated leak-check workspace member (verifying no native memory leaks across the FFI boundary — critical for a library wrapping a C library), and documents its MSRV via crates.io badges. The AGENTS.md file at the repo root indicates deliberate support for AI coding agents contributing to the project.

API Design - The API centers around a Session builder pattern (configure execution providers, then load a model, then run inputs through it), which keeps the common path relatively concise despite the large surface area of supported accelerators. The main complexity for newcomers is the sheer number of Cargo features controlling which execution providers and native runtime distribution strategy to use, requiring some upfront reading of the docs to pick the right feature set for a target platform.

Used by 6 apps in this directory

Rust
44%
MIT

Anarlog

AI Assistants · Note Taking · Productivity

9,565

Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.

View details
86
Repo Health
77
Technical
65
Dependency
Built with
Rust 44%
TypeScript 41%
Updated 6 days ago
Python
82%
Apache 2.0

headroom

AI Development · Developer Tools

77,676

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.

View details
85
Repo Health
86
Technical
69
Dependency
Built with
Python 82%
Rust 12%
Updated 6 days ago
TypeScript
63%
Apache 2.0

Laminar

AI Development · Monitoring

3,434

Open-source observability platform purpose-built for AI agents — trace, evaluate, debug, and monitor at scale with SQL access and real-time replay.

View details
86
Repo Health
76
Technical
65
Dependency
Built with
TypeScript 63%
Rust 35%
Updated 6 days ago
Rust
59%
Apache 2.0

magika

Developer Tools · Security

18,740

AI-powered file type detection that identifies 200+ content types with ~99% accuracy in milliseconds using a compact deep learning model.

View details
85
Repo Health
85
Technical
74
Dependency
Built with
Rust 59%
YARA 12%
Python 10%
Updated 1 weeks ago
Rust
48%
MIT

Meetily

AI Assistants · Productivity

32,103

Privacy-first AI meeting assistant that transcribes and summarizes your meetings entirely on your local machine — no cloud, no data leakage.

View details
87
Repo Health
72
Technical
67
Dependency
Built with
Rust 48%
TypeScript 29%
Updated 1 weeks ago
Rust
71%
MIT

Trieve

AI Development · Developer Tools · Search

2,721

All-in-one self-hostable platform for hybrid search, RAG, recommendations, and analytics built on Rust and Qdrant.

View details
42
Repo Health
74
Technical
65
Dependency
Built with
Rust 71%
Updated 9 months ago

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