pub struct AdapterClient { /* private fields */ }Expand description
Scoped client for adapter operations (transport-agnostic).
Implementations§
Source§impl AdapterClient
impl AdapterClient
Sourcepub async fn call(&self, payload: Vec<u8>) -> Result<Vec<u8>>
pub async fn call(&self, payload: Vec<u8>) -> Result<Vec<u8>>
Send a raw request and return the raw response bytes.
Sourcepub async fn call_streaming(
&self,
payload: Vec<u8>,
ephemeral_pubkey: [u8; 32],
) -> Result<Vec<u8>>
pub async fn call_streaming( &self, payload: Vec<u8>, ephemeral_pubkey: [u8; 32], ) -> Result<Vec<u8>>
Send a streaming request with ephemeral DH pubkey.
Sourcepub fn parse_scoped_response(
bytes: &[u8],
) -> Result<AdapterClientResponseVariant>
pub fn parse_scoped_response( bytes: &[u8], ) -> Result<AdapterClientResponseVariant>
Parse a scoped response from raw bytes.
Sourcepub async fn load(&self, value: &str) -> Result<()>
pub async fn load(&self, value: &str) -> Result<()>
Load a PEFT adapter from disk into the base_delta register. Applied to all inference until unloaded. Path is relative within the model worktree (e.g. ‘adapters/my-adapter’).
Scope: write
Sourcepub async fn unload(&self) -> Result<()>
pub async fn unload(&self) -> Result<()>
Clear the base_delta register, removing the loaded adapter from GPU/CPU memory.
Scope: write
Sourcepub async fn status(&self) -> Result<bool>
pub async fn status(&self) -> Result<bool>
Check if a LoRA adapter is currently loaded in the base_delta register.
Scope: query
Sourcepub async fn inspect(&self, value: &str) -> Result<AdapterInfo>
pub async fn inspect(&self, value: &str) -> Result<AdapterInfo>
Validate an on-disk PEFT adapter directory and return its metadata (rank, alpha, target modules, base model). Does not load anything into memory.
Scope: query
Sourcepub async fn merge(&self, __request: &MergeLoraRequest) -> Result<()>
pub async fn merge(&self, __request: &MergeLoraRequest) -> Result<()>
Read a PEFT adapter from disk and merge it into the currently loaded base_delta register using a configurable merge strategy (replace/additive/do_merge). Requires an adapter already loaded via adapter.load.
Scope: write
Source§impl AdapterClient
impl AdapterClient
Source§impl AdapterClient
impl AdapterClient
Trait Implementations§
Source§impl AdapterRpc for AdapterClient
impl AdapterRpc for AdapterClient
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
value: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unload<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn inspect<'life0, 'life1, 'async_trait>(
&'life0 self,
value: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AdapterInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn merge<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 MergeLoraRequest,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl Clone for AdapterClient
impl Clone for AdapterClient
Source§fn clone(&self) -> AdapterClient
fn clone(&self) -> AdapterClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AdapterClient
impl !RefUnwindSafe for AdapterClient
impl Send for AdapterClient
impl Sync for AdapterClient
impl Unpin for AdapterClient
impl UnsafeUnpin for AdapterClient
impl !UnwindSafe for AdapterClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more