Skip to main content

StreamingInference

Trait StreamingInference 

Source
pub trait StreamingInference: Inference {
    // Required method
    fn predict_stream<'life0, 'async_trait>(
        &'life0 self,
        request: PredictRequest,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = StreamEventRef> + Send + Unpin>, InferenceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Implemented by serving runtimes that emit incremental output (vLLM, TGI).

Required Methods§

Source

fn predict_stream<'life0, 'async_trait>( &'life0 self, request: PredictRequest, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = StreamEventRef> + Send + Unpin>, InferenceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute a prediction request and stream incremental output events.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§