Skip to main content

ModelRunner

Trait ModelRunner 

Source
pub trait ModelRunner {
    // Required methods
    fn fingerprint(&self) -> &ModelFingerprint;
    fn run(&self, req: &ModelRequest) -> Result<ModelResponse>;
}
Expand description

Anything that can turn a request into a response under a fixed fingerprint.

Required Methods§

Source

fn fingerprint(&self) -> &ModelFingerprint

The pinned identity of this runner (model, params, provider).

Source

fn run(&self, req: &ModelRequest) -> Result<ModelResponse>

Executes one request. Implementations must be deterministic given the same fingerprint.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§