Skip to main content

ModelHost

Trait ModelHost 

Source
pub trait ModelHost: Send + Sync {
    // Required methods
    fn capabilities(&self) -> HostCapabilities;
    fn name(&self) -> &str;
    fn first_token<'life0, 'async_trait>(
        &'life0 self,
        req: FirstTokenRequest,
    ) -> Pin<Box<dyn Future<Output = Result<FirstTokenDistribution, HostError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn capabilities(&self) -> HostCapabilities

Source

fn name(&self) -> &str

A human-readable name for the host, used in logs and diagnostics.

Source

fn first_token<'life0, 'async_trait>( &'life0 self, req: FirstTokenRequest, ) -> Pin<Box<dyn Future<Output = Result<FirstTokenDistribution, HostError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§