Skip to main content

ModelInfo

Trait ModelInfo 

Source
pub trait ModelInfo: Send + Sync {
    // Required method
    fn model_id(&self) -> &str;

    // Provided method
    fn active_execution_providers(&self) -> Vec<String> { ... }
}
Expand description

Metadata common to every loaded model handle.

Supertrait of every task trait (EmbeddingModel, RerankerModel, …) so a caller holding any typed handle can identify the model and inspect its requested execution backends uniformly.

Required Methods§

Source

fn model_id(&self) -> &str

The underlying model identifier (e.g. a HuggingFace repo ID or API model name).

Provided Methods§

Source

fn active_execution_providers(&self) -> Vec<String>

Names of the ONNX Runtime execution providers requested for the underlying session, in priority order. Empty for remote and non-ONNX models.

“Requested” is not “attached”: a provider may fall back if a backend is unavailable at session-build time. This reports what was asked for.

Implementors§