pub struct HooshClient { /* private fields */ }Expand description
HTTP client for the hoosh inference gateway.
Implementations§
Source§impl HooshClient
impl HooshClient
Sourcepub fn new(base_url: impl Into<String>) -> Self
pub fn new(base_url: impl Into<String>) -> Self
Create a new client pointing at the given hoosh server.
The client is tuned for low-latency local connections:
- TCP_NODELAY disables Nagle’s algorithm (avoids 40ms batching delay)
- Connection pooling keeps TCP connections alive across requests
- HTTP/2 adaptive window for multiplexed requests
Sourcepub async fn infer(
&self,
request: &InferenceRequest,
) -> Result<InferenceResponse>
pub async fn infer( &self, request: &InferenceRequest, ) -> Result<InferenceResponse>
Run inference via the hoosh server.
Sourcepub async fn infer_stream(
&self,
request: &InferenceRequest,
) -> Result<Receiver<Result<String, HooshError>>>
pub async fn infer_stream( &self, request: &InferenceRequest, ) -> Result<Receiver<Result<String, HooshError>>>
Stream inference results token by token.
Sourcepub async fn list_models(&self) -> Result<Vec<ModelInfo>>
pub async fn list_models(&self) -> Result<Vec<ModelInfo>>
List available models.
Trait Implementations§
Source§impl Clone for HooshClient
impl Clone for HooshClient
Source§fn clone(&self) -> HooshClient
fn clone(&self) -> HooshClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HooshClient
impl !RefUnwindSafe for HooshClient
impl Send for HooshClient
impl Sync for HooshClient
impl Unpin for HooshClient
impl UnsafeUnpin for HooshClient
impl !UnwindSafe for HooshClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more