Skip to main content

Crate rightkit_ort

Crate rightkit_ort 

Source
Expand description

Product-neutral ONNX Runtime dynamic-library resolution, environment and session setup for Right Suite apps.

Merged from ScrapeRight ort_common (installed-bundle layout, system-DLL hazard) and HeardRight heardright-onnx-asr (environment, execution providers, session builder). Product environment variables and data roots stay in app adapters.

Re-exports§

pub use environment::cpu_thread_budget;
pub use environment::init_environment;
pub use environment::init_environment_with_options;
pub use environment::shared_pool_active;
pub use environment::EnvironmentInitOptions;
pub use environment::EnvironmentInitReport;
pub use environment::EnvironmentOptions;
pub use environment::EnvironmentReport;
pub use environment::EnvironmentStatus;
pub use environment::GlobalPool;
pub use probe::probe_providers;
pub use probe::ProviderDiagnostic;
pub use probe::ProviderKind;
pub use session::BuiltSession;
pub use session::ExecutionProvider;
pub use session::SessionError;
pub use session::SessionOptions;
pub use ort;

Modules§

environment
Process-wide ORT environment initialisation (merged from HeardRight heardright-onnx-asr/environment.rs, product experiment switches removed).
probe
Execution-provider availability probe against the loaded runtime.
session
Session construction and execution-provider selection (merged from HeardRight heardright-onnx-asr/session.rs; HR_ONNX_*_EXPERIMENT environment switches dropped as product policy).

Structs§

CandidateDiagnostic
RuntimeBinding
RuntimeBindingOptions
Binding policy; defaults retain strict file validation & conflict refusal.
RuntimeCandidate
RuntimeSelection

Enums§

CandidateSource
RuntimeBindingStatus
RuntimeError

Functions§

clear_inherited_runtime_for_release
Clear inherited ORT_DYLIB_PATH in release builds; no-op in debug builds. This keeps shell-exported development paths from steering shipped apps, consistent with the policy that inherited ORT_DYLIB_PATH fails closed.
configure_runtime
Configure ORT only after resolving a caller-supplied, absolute regular file. Existing configuration is preserved and must canonicalize to the same file.
configure_runtime_with_options
Bind explicit candidates under caller-selected policy. Available regular files win in caller order; missing mode falls back to the first absent path only when no file resolves. Missing paths retain their supplied absolute spelling because they cannot be canonicalized.
configured_runtime
Return the last path successfully bound by this crate for this process, falling back to a non-empty ORT_DYLIB_PATH when no binding is recorded. Read-only: no resolution, file check, environment mutation or ORT loading. Missing-mode bindings are included; this is not proof of a loaded library.
developer_override_candidate
Read a caller-named development override as an explicit runtime candidate. Unset or empty values return None; release builds always return None without reading the variable. Path validation remains in runtime resolution.
inspect_candidate
installed_resource_dir
Resources directory of an installed application bundle, derived from its executable only (no checkout or working-directory fallback): macOS Foo.app/Contents/MacOS/foo -> Contents/Resources; Windows the executable directory; elsewhere <exe dir>/resources.
installed_runtime_candidate
Bundled-runtime candidate for an installed app: <resources>/<subdir>/<runtime file>. Apps pass their own subdir (ScrapeRight/HeardRight/CodeRight all use runtime).
is_system_runtime
True when the path sits under a Windows System32/SysWOW64 directory. The OS copy of onnxruntime.dll (Windows ML) hangs at session init, so it is never an acceptable candidate (ScrapeRight ort_common finding).
legacy_runtime_candidate
Explicit legacy candidate; never searched unless the caller supplies it. Relative roots are rejected rather than resolved against process cwd.
resolve_runtime
runtime_filename