pub struct ResidencyReport {
pub lines: Vec<ResidencyLine>,
pub required_bytes: u64,
pub budget_bytes: u64,
pub usable_bytes: u64,
pub assumptions: ResidencyAssumptions,
pub weights_bytes: u64,
pub kv_shape: KvShape,
}Fields§
§lines: Vec<ResidencyLine>§required_bytes: u64§budget_bytes: u64The ceiling this plan was priced against: a probed
crate::device_budget::DeviceBudget::usable_bytes, or a
hypothetical machine’s size for what-if planning.
usable_bytes: u64budget_bytes minus the headroom fraction.
assumptions: ResidencyAssumptions§weights_bytes: u64Weight bytes the plan charged (dense plus whatever the expert
line resolved to), kept separately from the KV term so
Self::kv_budget can rebuild the inequality exactly.
kv_shape: KvShapeThe KV geometry this checkpoint runs on.
Implementations§
Source§impl ResidencyReport
impl ResidencyReport
Sourcepub fn from_gguf(
path: impl AsRef<Path>,
assumptions: ResidencyAssumptions,
budget_bytes: u64,
) -> Result<Self, LoadError>
pub fn from_gguf( path: impl AsRef<Path>, assumptions: ResidencyAssumptions, budget_bytes: u64, ) -> Result<Self, LoadError>
Computes the plan for the checkpoint at path (any shard of a
split set, or a single file) against budget_bytes (pass a
probed crate::device_budget::DeviceBudget::usable_bytes, or
a hypothetical machine’s size for what-if planning).
pub fn fits(&self) -> bool
Sourcepub fn kv_budget(&self) -> KvBudget
pub fn kv_budget(&self) -> KvBudget
The same plan expressed as the priced inequality, so
--ctx auto and the server’s admission check reuse this
report’s terms instead of recomputing their own.
The headroom fraction becomes the activation_headroom_bytes
term rather than shrinking the budget, which is what makes
kv_budget().check(context_tokens).is_ok() agree with
Self::fits exactly.
Sourcepub fn auto_context(&self, cap: usize) -> ContextFit
pub fn auto_context(&self, cap: usize) -> ContextFit
Largest context that fits this plan, capped at cap (the
model’s own trained context length).
Sourcepub fn check_strict(&self) -> Result<(), String>
pub fn check_strict(&self) -> Result<(), String>
Strict mode: an Err with the full plan text when the plan
overcommits the usable budget. Callers refuse to load on Err.
Trait Implementations§
Source§impl Clone for ResidencyReport
impl Clone for ResidencyReport
Source§fn clone(&self) -> ResidencyReport
fn clone(&self) -> ResidencyReport
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 ResidencyReport
impl Debug for ResidencyReport
Auto Trait Implementations§
impl Freeze for ResidencyReport
impl RefUnwindSafe for ResidencyReport
impl Send for ResidencyReport
impl Sync for ResidencyReport
impl Unpin for ResidencyReport
impl UnsafeUnpin for ResidencyReport
impl UnwindSafe for ResidencyReport
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
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