onnx-rust-integration

Load and execute ONNX models in Rust with the ort crate.

8|1|Updated Dec 24, 2025
One-click install
npx skills add https://github.com/HopeArtOrg/hope-re --skill onnx-rust-integration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: onnx-rust-integration
Source: https://github.com/HopeArtOrg/hope-re/tree/main/.gemini/skills/onnx-rust-integration
Command: npx skills add https://github.com/HopeArtOrg/hope-re --skill onnx-rust-integration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ort, and includes scripts (resource) components.

What problem does it solve?

This Skill helps developers load and run ONNX models within Rust applications using the ort crate, enabling the use of pre-trained machine learning models in Rust projects.

Core Features & Use Cases

  • ONNX Model Loading: Load ONNX models into a Rust session for execution.
  • Platform-Specific Execution: Supports CUDA, DirectML, CoreML, XNNPACK, and CPU execution providers.
  • Model Path Resolution: Prioritizes downloaded models, bundled resources, and dev-mode paths.
  • Model Execution: Run inferences on input data with support for extra index inputs.
  • Use Case: A developer can integrate this Skill into a Rust application to utilize pre-trained ONNX models for tasks like image classification or natural language processing.

Quick Start

Load the ONNX model 'noise_algorithm.onnx' and run an inference on the input data 'image.png'.

Frequently Asked Questions about onnx-rust-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I load and run ONNX models in a Rust application?

To load and run ONNX models in Rust, use the ort crate to initialize a session, resolve the model path, and execute inference on input data using platform-specific execution providers.

Does the ort crate support hardware acceleration for ONNX inference?

Yes, the ort crate supports hardware acceleration for ONNX inference through platform-specific execution providers including CUDA, DirectML, CoreML, XNNPACK, and CPU.

What is the best way to resolve ONNX model paths in Rust?

The best way to resolve ONNX model paths in Rust is using a prioritized resolution strategy that checks downloaded models, bundled resources, and dev-mode paths sequentially.

Can I pass extra index inputs when running ONNX inference in Rust?

Yes, you can pass extra index inputs when running ONNX inference in Rust, allowing you to supplement the primary input data with additional tensors required by the model.

Do I need platform-specific execution libraries to use ONNX in Rust?

Yes, you need platform-specific execution libraries to use ONNX in Rust, as the ort crate relies on execution providers like CUDA, DirectML, CoreML, XNNPACK, or CPU to run models.