pub enum CtxSizeArg {
Max,
Value(u64),
}Expand description
A parsed --ctx-size CLI flag, before it is resolved against model
metadata.
CLI argument parsing happens before the model is fetched from the
database, so the raw flag cannot be resolved to a concrete value at parse
time. CtxSizeArg::parse only validates the shape of the flag
(numeric or the literal max); callers must call CtxSizeArg::resolve
once the model (and its GGUF context_length) is available.
Variants§
Max
User passed max — resolve against the model’s GGUF context length.
Value(u64)
User passed an explicit numeric value.
Implementations§
Source§impl CtxSizeArg
impl CtxSizeArg
Sourcepub fn parse(raw: &str) -> Result<Self>
pub fn parse(raw: &str) -> Result<Self>
Parse a raw --ctx-size flag value.
Accepts a positive integer or the case-insensitive literal max.
Anything else is a hard error — invalid input must never be
silently ignored.
Sourcepub const fn resolve(self, model_max_ctx: Option<u64>) -> Option<u64>
pub const fn resolve(self, model_max_ctx: Option<u64>) -> Option<u64>
Resolve this flag into a concrete context size, now that the model’s GGUF metadata is available.
Maxresolves tomodel_max_ctx(Noneif the model has no recorded context length — falls through to the next tier).Value(n)always resolves toSome(n).
Trait Implementations§
Source§impl Clone for CtxSizeArg
impl Clone for CtxSizeArg
Source§fn clone(&self) -> CtxSizeArg
fn clone(&self) -> CtxSizeArg
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CtxSizeArg
impl Debug for CtxSizeArg
Source§impl PartialEq for CtxSizeArg
impl PartialEq for CtxSizeArg
Source§fn eq(&self, other: &CtxSizeArg) -> bool
fn eq(&self, other: &CtxSizeArg) -> bool
self and other values to be equal, and is used by ==.