pub struct LmCliArgs {Show 18 fields
pub weights: PathBuf,
pub device: String,
pub format: Option<WeightFormat>,
pub config: Option<PathBuf>,
pub prompt: Option<String>,
pub prompt_ids: Option<Vec<u32>>,
pub tokenizer: Option<PathBuf>,
pub max_tokens: usize,
pub max_seq: usize,
pub max_memory_gb: Option<f32>,
pub no_stream: bool,
pub packed: bool,
pub no_packed: bool,
pub temperature: f32,
pub top_p: f32,
pub top_k: Option<u32>,
pub repetition_penalty: f32,
pub prefer_gguf: Option<String>,
}Expand description
Canonical LM CLI flags.
Fields§
§weights: PathBufWeights file (.safetensors / .gguf) or directory.
device: StringInference device.
format: Option<WeightFormat>Override the auto-detected weight format.
config: Option<PathBuf>Path to a HF config.json (default: sibling of --weights).
prompt: Option<String>Prompt text (tokenized via --tokenizer).
prompt_ids: Option<Vec<u32>>Pre-tokenized comma-separated u32 ids.
tokenizer: Option<PathBuf>Tokenizer file (tokenizer.json) for --prompt / decode.
max_tokens: usizeTokens to generate.
max_seq: usizeMaximum prefill sequence length.
max_memory_gb: Option<f32>Refuse to load if F32-dequant estimate exceeds this many GB.
no_stream: boolDisable streaming (print only the final string).
packed: boolForce packed GGUF loading (Op::DequantMatMul).
no_packed: boolDisable packed GGUF loading (overrides auto-detection).
temperature: f32Sampling temperature. 0 = greedy.
top_p: f32Nucleus sampling top-p.
top_k: Option<u32>Top-k sampling cutoff.
repetition_penalty: f32Repetition penalty.
prefer_gguf: Option<String>GGUF quant preference (e.g. Q4_K_M) when --weights is a directory.
Implementations§
Source§impl LmCliArgs
impl LmCliArgs
Sourcepub fn device(&self) -> Result<Device>
pub fn device(&self) -> Result<Device>
Parse a Device from the --device string using the upstream
FromStr for Device impl.
Sourcepub fn sample_opts(&self) -> SampleOpts
pub fn sample_opts(&self) -> SampleOpts
Build a sampling option set from the relevant flags.
Sourcepub fn into_builder<Cfg>(self) -> Result<LmRunnerBuilder<Cfg>>
pub fn into_builder<Cfg>(self) -> Result<LmRunnerBuilder<Cfg>>
Construct an LmRunnerBuilder pre-populated from the flags.
Per-family runners that wrap LmRunnerBuilder can call this
once and then layer family-specific options on top.
Trait Implementations§
Source§impl Args for LmCliArgs
impl Args for LmCliArgs
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for LmCliArgs
impl CommandFactory for LmCliArgs
Source§impl FromArgMatches for LmCliArgs
impl FromArgMatches for LmCliArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Parser for LmCliArgs
impl Parser for LmCliArgs
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for LmCliArgs
impl RefUnwindSafe for LmCliArgs
impl Send for LmCliArgs
impl Sync for LmCliArgs
impl Unpin for LmCliArgs
impl UnsafeUnpin for LmCliArgs
impl UnwindSafe for LmCliArgs
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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