pub trait InferenceProvider: Send + Sync {
// Required methods
fn infer_batch<'life0, 'async_trait>(
&'life0 self,
request: InferenceRequest,
) -> Pin<Box<dyn Future<Output = Result<InferenceResponse, ProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn name(&self) -> &'static str;
// Provided method
fn intrinsic_labels(&self, _model: &str) -> Option<Vec<String>> { ... }
}Expand description
I/O transport over a model backend. Shared as Arc<dyn InferenceProvider>;
driven from Ring 1, never Ring 0.
Required Methods§
Sourcefn infer_batch<'life0, 'async_trait>(
&'life0 self,
request: InferenceRequest,
) -> Pin<Box<dyn Future<Output = Result<InferenceResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn infer_batch<'life0, 'async_trait>(
&'life0 self,
request: InferenceRequest,
) -> Pin<Box<dyn Future<Output = Result<InferenceResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Run one batch of inputs through the model.
§Errors
Returns ProviderError on transport failure, timeout, rate limiting,
a malformed response, or an unsupported task.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".