█

AI/TLDR

मुझे पिलाएं कॉफ़ी
मुझे एक कॉफ़ी पिलाएँ

ort

ONNX Runtime के लिए एक Rust बाइंडिंग, जो ONNX मॉडल पर hardware-accelerated inference और training चलाती है, चाहे डिवाइस पर हो या datacenter में

Local Runtimesओपन सोर्स
ताज़ा
v2.0.0-rc.13
अपडेट किया गया
28 जुल॰ 2026
भाषा
Rust
लाइसेंस
MIT OR Apache-2.0

नया क्या है

v2.0.0-rc.1328 जुल॰ 2026

Moves to ONNX Runtime 1.28, gates execution-provider structs behind their Cargo features at compile time, adds lax-feature-matching, ships only CUDA 13 binaries and reworks the custom-operator API.

संक्षेप में

ort क्या है?

ort ONNX Runtime के लिए एक Rust बाइंडिंग, जो ONNX मॉडल पर hardware-accelerated inference और training चलाती है, चाहे डिवाइस पर हो या datacenter में. यह Models & Inference टूल्स की Local Runtimes श्रेणी में आता है; ओपन सोर्स है, Rust में लिखा गया है और MIT OR Apache-2.0 लाइसेंस के तहत है।

अपडेट किया गया Markdown वर्शन ↗

सारांश

ort, Open Neural Network Exchange (ONNX) फ़ॉर्मेट के machine learning मॉडल पर hardware-accelerated inference और training चलाने के लिए एक Rust इंटरफ़ेस है। यह मुख्य रूप से Microsoft के C++ inference engine ONNX Runtime का wrapper है, और अब बंद हो चुके onnxruntime-rs crate के काम को आगे बढ़ाने के रूप में शुरू हुआ था। इस प्रोजेक्ट को pyke मेंटेन करता है और इसे crates.io पर ort नाम से प्रकाशित किया गया है, जो MIT या Apache-2.0 दोहरे लाइसेंस के तहत उपलब्ध है।

वर्कफ़्लो Rust के बाहर शुरू होता है: आपका पसंदीदा framework (PyTorch, TensorFlow, Keras, scikit-learn, PaddlePaddle) मॉडल को MatMul, Conv या Add जैसे बुनियादी operations से बने ONNX graph में export करता है। ort उस graph को session में लोड करता है और उसे ONNX Runtime के ज़रिए चलाता है, जो graph optimizations लागू करता है और काम को NVIDIA CUDA और TensorRT, Intel OpenVINO, Qualcomm QNN, Apple CoreML, DirectML तथा अन्य accelerators के execution providers को सौंप सकता है।

An ONNX model graph in which an input tensor passes through Transpose, Conv, Relu, Add, Pad and MaxPool nodes, each labelled with its attributes.
An ONNX model is a graph of basic operations like these; ort loads the graph and runs it through ONNX Runtime.ort docs ↗

चूँकि ONNX Runtime C++ में है, इसे कुछ targets (खासकर WebAssembly) में link करना मुश्किल होता है, इसलिए ort ऐसे वैकल्पिक backends भी सपोर्ट करता है जो वही ONNX Runtime C API दूसरे engines के ऊपर लागू करते हैं: pure Rust में ort-tract (Sonos tract) और ort-candle (Hugging Face candle), और ort-web, जो browser में पूरा ONNX Runtime चलाता है। README और docs में Hugging Face Text Embeddings Inference, Google के Magika, Wasmtime की WASI-NN implementation, SurrealDB और Supabase edge functions को इसके उपयोगकर्ताओं में सूचीबद्ध किया गया है।

यह क्या करता है

  • ONNX Runtime के ऊपर सुरक्षित और सुविधाजनक Rust API: Environment और Session बनाएं, inputs! macro से inputs दें, और outputs को ndarray arrays के रूप में निकालें
  • Execution providers को Cargo feature (cuda, tensorrt, coreml, directml और अन्य) से सक्षम किया जाता है, प्राथमिकता क्रम में रजिस्टर होते हैं, और विफल होने पर अपने-आप अगले provider या CPU पर fallback होता है
  • डिफ़ॉल्ट रूप से pyke के CDN से prebuilt ONNX Runtime binaries डाउनलोड होते हैं; source से build के लिए load-dynamic, pkg-config और custom linking उपलब्ध हैं
  • वैकल्पिक backends — ort-tract, ort-candle और ort-web — जब ONNX Runtime link नहीं हो सकता, जिसमें WebAssembly targets भी शामिल हैं, तब एक set_api call से चुने जाते हैं
  • Multiversioning: api-* Cargo features से एक ही ort release ONNX Runtime के minor versions की एक श्रृंखला को लक्षित कर सकती है
  • सादे inference से आगे की सुविधाएँ: training feature, IoBinding जिससे नियंत्रित होता है कि inputs और outputs कहाँ रहें, custom operators, half के ज़रिए float16/bfloat16 tensors, और alloc के साथ no_std सपोर्ट

शुरू करें

ये चरण ort गाइड के Getting started सेक्शन का पालन करते हैं। पहले आपके पास ONNX में export किया हुआ मॉडल होना चाहिए; conversion के लिए गाइड Hugging Face Optimum, torch.onnx, sklearn-onnx, tf2onnx और Paddle2ONNX की सुझाव देती है।

Cargo.toml में ort जोड़ें

किसी समर्थित platform पर डिफ़ॉल्ट download-binaries feature आपके लिए prebuilt ONNX Runtime डाउनलोड कर देता है, इसलिए बस यही setup चाहिए। गाइड release-candidate version को सटीक रूप से pin करती है।

tomltoml
[dependencies]
ort = "=2.0.0-rc.13"

अपना मॉडल लोड करें

एक environment बनाएं, फिर graph optimizations और thread count के साथ session बनाएं और .onnx फ़ाइल से उसे लोड करें।

rustrust
use ort::session::{builder::GraphOptimizationLevel, Session};

let env = ort::init().build()?;
let mut model = Session::builder(&env)?
    .with_optimization_level(GraphOptimizationLevel::Level3)?
    .with_intra_threads(4)?
    .commit_from_file("yolov8m.onnx")?;

Inference चलाएं

run() को named inputs दें और जिस output tensor की आपको ज़रूरत है उसे निकालें।

rustrust
let outputs = model.run(ort::inputs!["image" => image])?;
let predictions = outputs["output0"].try_extract_array::<f32>()?;

GPU acceleration चालू करें

execution provider का Cargo feature चालू करें (उदाहरण के लिए features = ["cuda"]) और उसे session builder पर रजिस्टर करें। अगर वह रजिस्टर होने में विफल रहता है, तो .error_on_failure() जोड़े बिना ort CPU पर fallback कर देता है।

rustrust
use ort::{ep, session::Session};

fn main() -> anyhow::Result<()> {
    let env = ort::init().build()?;
    let session = Session::builder(&env)?
        .with_execution_providers([
            #[cfg(feature = "cuda")]
            ep::CUDA::default().build()
        ])?
        .commit_from_file("model.onnx")?;

    Ok(())
}

कमांड और कोड प्रोजेक्ट के अपने दस्तावेज़ों से लिए गए हैं — हमेशा जांचें आधिकारिक repo ताज़ा जानकारी के लिए।

कब इस्तेमाल करें

  • PyTorch या TensorFlow मॉडल को ONNX में export करके और ort के ज़रिए चलाकर, उसे Python runtime के बिना Rust service या CLI में शिप करें
  • README में सूचीबद्ध कई प्रोजेक्टों की तरह, embedding, OCR, speech-to-text या YOLO detection मॉडल को Rust desktop या mobile ऐप में स्थानीय रूप से चलाएं
  • execution providers बदलकर वही मॉडल अलग hardware पर तेज़ करें — सर्वरों पर CUDA या TensorRT, Apple डिवाइस पर CoreML, Windows पर DirectML
  • WebAssembly या असामान्य platforms को लक्षित करें, जहाँ ONNX Runtime link नहीं होता, वहाँ उसी API के पीछे ort-web, ort-tract या ort-candle backend का उपयोग करके

वर्शन इतिहास

Every verified update to ort that AI/TLDR tracked, newest first — each links to our coverage and the official changeset.

  1. 28 जुल॰ 2026v2.0.0-rc.13

    Moves to ONNX Runtime 1.28, gates execution-provider structs behind their Cargo features at compile time, adds lax-feature-matching, ships only CUDA 13 binaries and reworks the custom-operator API.

  2. 5 मार्च 2026v2.0.0-rc.12

    Adds multiversioning via api-* features (ONNX Runtime 1.17 to 1.24), automatic device selection that prefers an available NPU, CUDA 13 builds alongside CUDA 12, and build attestations.

  3. 7 जन॰ 2026v2.0.0-rc.11

    Introduces ort-web, which runs the full ONNX Runtime on the web with WebNN and WASM execution providers, plus configurable TLS backends and static linking to iOS frameworks.

How ort compares

ort alongside other open-source local runtimes tools AI/TLDR tracks, ranked by GitHub stars.

टूलस्टारयह क्या करता है
Ollama★ 189kटर्मिनल से ही open LLMs को अपनी मशीन पर डाउनलोड करें और चलाएं
llama.cpp★ 137kकम मेमोरी के साथ CPU, Apple Silicon और GPU पर C/C++ में LLM चलाएँ
GPT4All★ 77.3kबड़े भाषा मॉडल (LLM) को रोज़मर्रा के लैपटॉप और डेस्कटॉप पर निजी तौर पर चलाएं
Colibrì★ 54.3kएक pure-C inference इंजन, जो Mixture-of-Experts वज़न को डिस्क से स्ट्रीम करता है, ताकि फ़्रंटियर-साइज़ मॉडल आम हार्डवेयर पर चल सकें
LocalAI★ 50.7kसेल्फ़-होस्टेड, OpenAI-compatible API, जो LLM, विज़न, वॉइस और इमेज मॉडल को लोकल रूप से चलाने देता है
Strata★ 50kएक क्लिक वाला लोकल inference engine, जो 12 GB ग्राफ़िक्स कार्ड वाले गेमिंग PC पर 125B Qwen3.8-Flash-Next चलाता है
Jan★ 46.3kअपने कंप्यूटर पर ओपन सोर्स LLM को ऑफ़लाइन चलाएँ, निजी ChatGPT की तरह
ort★ 2.6kONNX Runtime के लिए एक Rust बाइंडिंग, जो ONNX मॉडल पर hardware-accelerated inference और training चलाती है, चाहे डिवाइस पर हो या datacenter में