ort

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

Library
Cargo
v2.0.0-rc.13
2,458stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
87/100Excellent
Development Activity96
Maintenance92
Community68
Maturity52
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture85
Code Quality82
Innovation78
Learning Curve65

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

TypeScript
51%
MIT

Anarlog

Note Taking · AI Assistants · Productivity

9,087

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
69
Dependency
Built with
TypeScript51%
Rust38%
Updated today
Python
80%
Apache 2.0

headroom

AI Development · Developer Tools

66,835

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
84
Repo Health
86
Technical
73
Dependency
Built with
Python80%
Rust14%
Updated today
TypeScript
69%
Apache 2.0

Laminar

AI Development · Monitoring

3,180

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
85
Repo Health
76
Technical
70
Dependency
Built with
TypeScript69%
Rust29%
Updated yesterday
Python
33%
Apache 2.0

magika

Developer Tools · Security

17,958

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

View details
75
Repo Health
85
Technical
77
Dependency
Built with
Python33%
Rust26%
TypeScript18%
Updated today
Rust
46%
MIT

Meetily

Productivity · AI Assistants

29,484

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

View details
70
Repo Health
72
Technical
71
Dependency
Built with
Rust46%
TypeScript30%
Updated 2 months ago
Rust
71%
MIT

Trieve

AI Development · Search · Developer Tools

2,715

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

View details
43
Repo Health
74
Technical
66
Dependency
Built with
Rust71%
Updated 6 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

Search