pub struct NumCtxInputs {
pub model_max: Option<usize>,
pub dims: Option<ModelDims>,
pub model_weight_bytes: Option<u64>,
pub per_model_override: Option<u32>,
pub global_num_ctx: Option<i32>,
pub allow_ram_offload: bool,
pub vram_bytes: Option<u64>,
pub system_ram_bytes: Option<u64>,
pub max_auto_cap: Option<usize>,
pub is_cloud: bool,
}Expand description
Everything resolve_ollama_num_ctx needs. Built identically at both call
sites so the effective window stays consistent.
Fields§
§model_max: Option<usize>The model’s architectural max window (from /api/show). Without it, auto
can’t run and the resolver returns None (caller omits num_ctx).
dims: Option<ModelDims>Architecture dimensions for the KV-cache estimate.
model_weight_bytes: Option<u64>Model weight bytes (from /api/show size), subtracted from the budget.
per_model_override: Option<u32>Per-model override (/context <n>); highest precedence.
global_num_ctx: Option<i32>Global [ollama] num_ctx; beats auto, loses to the override.
allow_ram_offload: boolWhen true, auto-fit budgets against system RAM (allows the slow GPU/CPU split); when false (default), budgets against VRAM so the model stays on the GPU.
vram_bytes: Option<u64>Total VRAM in bytes (best-effort), used as the budget when offload is off.
system_ram_bytes: Option<u64>Total system RAM in bytes, used as the budget when offload is on.
max_auto_cap: Option<usize>Optional hard cap on the auto value ([ollama] max_auto_num_ctx).
is_cloud: boolTrue for a cloud-served (:cloud) model. These run on Ollama’s servers,
not the local GPU, so they bypass the VRAM auto-fit and use the model’s
full advertised window.
Trait Implementations§
Source§impl Clone for NumCtxInputs
impl Clone for NumCtxInputs
Source§fn clone(&self) -> NumCtxInputs
fn clone(&self) -> NumCtxInputs
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for NumCtxInputs
Source§impl Debug for NumCtxInputs
impl Debug for NumCtxInputs
Source§impl Default for NumCtxInputs
impl Default for NumCtxInputs
Source§fn default() -> NumCtxInputs
fn default() -> NumCtxInputs
Auto Trait Implementations§
impl Freeze for NumCtxInputs
impl RefUnwindSafe for NumCtxInputs
impl Send for NumCtxInputs
impl Sync for NumCtxInputs
impl Unpin for NumCtxInputs
impl UnsafeUnpin for NumCtxInputs
impl UnwindSafe for NumCtxInputs
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for 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> 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