pub struct LmRunnerBuilder<Cfg> {
pub weights: Option<PathBuf>,
pub config: ConfigSource<Cfg>,
pub device: Device,
pub max_seq: usize,
pub max_memory_gb: Option<f32>,
pub stream: bool,
pub sample: SampleOpts,
pub format: Option<WeightFormat>,
pub packed_weights: Option<bool>,
pub prefer_gguf: Option<String>,
}Expand description
Builder fields common to every per-family runner.
Per-family runner builders should wrap this and forward the
methods (or use #[rlx_runner] from rlx-macros).
Fields§
§weights: Option<PathBuf>§config: ConfigSource<Cfg>§device: Device§max_seq: usize§max_memory_gb: Option<f32>§stream: bool§sample: SampleOpts§format: Option<WeightFormat>§packed_weights: Option<bool>None = auto-detect (packed when GGUF ≥ 256 MB).
prefer_gguf: Option<String>Substring for picking one GGUF in a directory (default Q4_K_M).
Implementations§
Source§impl<Cfg> LmRunnerBuilder<Cfg>
impl<Cfg> LmRunnerBuilder<Cfg>
pub fn new() -> Self
pub fn weights<P: Into<PathBuf>>(self, p: P) -> Self
pub fn config(self, src: ConfigSource<Cfg>) -> Self
pub fn config_value(self, cfg: Cfg) -> Self
pub fn device(self, d: Device) -> Self
pub fn max_seq(self, n: usize) -> Self
pub fn max_memory_gb(self, gb: f32) -> Self
pub fn stream(self, on: bool) -> Self
pub fn sample(self, s: SampleOpts) -> Self
pub fn format(self, fmt: WeightFormat) -> Self
pub fn packed_weights(self, on: bool) -> Self
pub fn prefer_gguf<S: Into<String>>(self, q: S) -> Self
Sourcepub fn resolved_format(&self) -> Result<WeightFormat>
pub fn resolved_format(&self) -> Result<WeightFormat>
Resolve the format using the explicit override or the file extension.
Sourcepub fn resolved_packed(&self, fmt: WeightFormat) -> bool
pub fn resolved_packed(&self, fmt: WeightFormat) -> bool
Determine whether packed GGUF loading should be used. Honors an
explicit override; otherwise auto-enables for GGUF files at or
above PACKED_GGUF_AUTO_THRESHOLD_BYTES.
Trait Implementations§
Source§impl<Cfg: Clone> Clone for LmRunnerBuilder<Cfg>
impl<Cfg: Clone> Clone for LmRunnerBuilder<Cfg>
Source§fn clone(&self) -> LmRunnerBuilder<Cfg>
fn clone(&self) -> LmRunnerBuilder<Cfg>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Cfg: Debug> Debug for LmRunnerBuilder<Cfg>
impl<Cfg: Debug> Debug for LmRunnerBuilder<Cfg>
Auto Trait Implementations§
impl<Cfg> Freeze for LmRunnerBuilder<Cfg>where
Cfg: Freeze,
impl<Cfg> RefUnwindSafe for LmRunnerBuilder<Cfg>where
Cfg: RefUnwindSafe,
impl<Cfg> Send for LmRunnerBuilder<Cfg>where
Cfg: Send,
impl<Cfg> Sync for LmRunnerBuilder<Cfg>where
Cfg: Sync,
impl<Cfg> Unpin for LmRunnerBuilder<Cfg>where
Cfg: Unpin,
impl<Cfg> UnsafeUnpin for LmRunnerBuilder<Cfg>where
Cfg: UnsafeUnpin,
impl<Cfg> UnwindSafe for LmRunnerBuilder<Cfg>where
Cfg: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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