Skip to main content

LmRunnerBuilder

Struct LmRunnerBuilder 

Source
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>

Source

pub fn new() -> Self

Source

pub fn weights<P: Into<PathBuf>>(self, p: P) -> Self

Source

pub fn config(self, src: ConfigSource<Cfg>) -> Self

Source

pub fn config_value(self, cfg: Cfg) -> Self

Source

pub fn device(self, d: Device) -> Self

Source

pub fn max_seq(self, n: usize) -> Self

Source

pub fn max_memory_gb(self, gb: f32) -> Self

Source

pub fn stream(self, on: bool) -> Self

Source

pub fn sample(self, s: SampleOpts) -> Self

Source

pub fn format(self, fmt: WeightFormat) -> Self

Source

pub fn packed_weights(self, on: bool) -> Self

Source

pub fn prefer_gguf<S: Into<String>>(self, q: S) -> Self

Source

pub fn resolved_format(&self) -> Result<WeightFormat>

Resolve the format using the explicit override or the file extension.

Source

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>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<Cfg: Debug> Debug for LmRunnerBuilder<Cfg>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Cfg> Default for LmRunnerBuilder<Cfg>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,