pub struct ClientBuilder { /* private fields */ }Expand description
Builder for Client.
Construct one with Client::builder, then chain optional setters and
finish with ClientBuilder::build. Every field except model_path
has a sensible default, so the minimal usage is:
let client = rig_llama_cpp::Client::builder("path/to/model.gguf").build()?;The builder shape is forward-compatible: new optional knobs can be added without breaking existing call sites.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn n_ctx(self, n_ctx: u32) -> Self
pub fn n_ctx(self, n_ctx: u32) -> Self
Desired context window size in tokens. Defaults to 4096.
Sourcepub fn sampling(self, sampling: SamplingParams) -> Self
pub fn sampling(self, sampling: SamplingParams) -> Self
Token sampling parameters.
Sourcepub fn fit(self, fit: FitParams) -> Self
pub fn fit(self, fit: FitParams) -> Self
Automatic-fit parameters (per-device memory margins, minimum context).
Sourcepub fn kv_cache(self, kv_cache: KvCacheParams) -> Self
pub fn kv_cache(self, kv_cache: KvCacheParams) -> Self
KV cache data-type configuration. Defaults to F16 / F16.
Sourcepub fn checkpoints(self, checkpoint: CheckpointParams) -> Self
pub fn checkpoints(self, checkpoint: CheckpointParams) -> Self
In-memory state-checkpoint cache tunables (used by hybrid/recurrent models to preserve KV state across turns).
Sourcepub fn mmproj(self, mmproj_path: impl Into<String>) -> Self
pub fn mmproj(self, mmproj_path: impl Into<String>) -> Self
Path to a multimodal projector (mmproj) GGUF file. Setting this
switches the resulting Client into vision mode. Only available
when the mtmd feature is enabled.
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin for ClientBuilder
impl UnwindSafe for ClientBuilder
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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