Local ONNX model runtime
State: open/building · Kind: module · Audience: system
Summary
Section titled “Summary”- Loads a model from the machine-local pack cache and runs it in-process, passing tensors in and out.
- The interface is tensors, not tasks, so face detection and embedding are built on top elsewhere.
Statement
Section titled “Statement”A Rust library crate that runs a model inside the calling process. A caller resolves a model file
from a cached pack, loads it through a ModelRuntime, and runs forward passes on Tensors. It does not
fetch packs and has no opinion on what a model is for.
The ONNX backend sits behind the onnx feature, so only crates that infer link ONNX Runtime.
Without it, UnavailableRuntime refuses every load with ModelError::NoRuntime.
What it provides
Section titled “What it provides”- Model and ModelRuntime traits: load a model, run one forward pass with outputs in graph order.
- Tensor: shape plus f32 data, with a checked constructor.
- resolve: a pack file path that fails as NotDownloaded when the pack is absent, separate from load failures.
- OnnxRuntime (feature
onnx) and UnavailableRuntime (the stand-in when the feature is off). - ModelError (src/error.rs): typed errors for missing packs, bad tensors and load or run failures.
Underlying implementation
Section titled “Underlying implementation”- solutions/determined/crates/determined-models/src/lib.rs
- solutions/determined/crates/determined-models/src/onnx.rs
- solutions/determined/crates/determined-models/src/unavailable.rs
- solutions/determined/crates/determined-models/src/tensor.rs
Locations
Section titled “Locations”solutions/determined/crates/determined-models/solutions/determined/crates/determined-models/src/lib.rs#ModelRuntimesolutions/determined/crates/determined-models/src/tensor.rs#Tensorsolutions/determined/crates/determined-models/src/onnx.rs#OnnxRuntimesolutions/determined/crates/determined-models/src/unavailable.rs#UnavailableRuntimesolutions/determined/crates/determined-models/src/error.rs#ModelError