pub struct RunningTarget {
pub base_url: String,
pub port: u16,
pub model_id: u32,
pub model_name: String,
pub effective_ctx: u64,
pub just_started: bool,
pub slot_restore_supported: bool,
pub cache_ram_health: CacheRamHealth,
pub narration: Option<LaunchNarration>,
}Expand description
Target information for a running model instance.
This struct contains all information needed to route requests to a running llama-server instance.
Fields§
§base_url: StringFull URL to the server (e.g., http://127.0.0.1:5500). Future-proof for non-localhost deployments.
port: u16Port the server is listening on.
model_id: u32Database ID of the model.
model_name: StringHuman-readable model name (for logging/headers).
effective_ctx: u64Actual context size being used.
just_started: boolTrue when this instance was freshly spawned (restart or cold start).
slot_restore_supported: boolWhether llama-server’s disk slot save/restore can actually resume this model, i.e. its KV memory retains the full token history.
False for sliding-window, hybrid, and recurrent architectures (see
crate::domain::kv_memory_is_partial): the slot file carries KV
state and tokens but not the server’s context checkpoints, so a
restore leaves the slot unable to resume and llama-server re-prefills
the whole prompt. Callers skip the disk slot layer when this is false
and let the in-RAM prompt cache — which does keep checkpoints — handle
conversation switching.
cache_ram_health: CacheRamHealthHow healthy the host-RAM prompt cache budget (--cache-ram) resolved
for this launch is.
Classified once at spawn (where the budget arithmetic and the
auto-vs-explicit distinction are both in scope) and carried here so
user-facing surfaces can report it without re-deriving thresholds. See
crate::domain::classify_cache_ram.
narration: Option<LaunchNarration>What this launch decided, and why (see
crate::domain::LaunchNarration).
Carried on the target for the same reason as
Self::cache_ram_health: the resolutions and their provenance exist
only at spawn, so anything downstream that wants to explain the
running model has no way to recover them otherwise. None for targets
that did not come from a gglib launch.
Implementations§
Source§impl RunningTarget
impl RunningTarget
Sourcepub fn local(
port: u16,
model_id: u32,
model_name: String,
effective_ctx: u64,
just_started: bool,
) -> Self
pub fn local( port: u16, model_id: u32, model_name: String, effective_ctx: u64, just_started: bool, ) -> Self
Create a new RunningTarget for a local server.
slot_restore_supported defaults to true (the full-attention case)
and cache_ram_health to CacheRamHealth::LlamaDefault (no flag
emitted); callers that know the launch’s actual resolution narrow them
with Self::with_slot_restore_supported and
Self::with_cache_ram_health.
Sourcepub fn with_narration(self, narration: LaunchNarration) -> Self
pub fn with_narration(self, narration: LaunchNarration) -> Self
Attach the narration of the launch that produced this target.
Sourcepub const fn with_slot_restore_supported(self, supported: bool) -> Self
pub const fn with_slot_restore_supported(self, supported: bool) -> Self
Set whether disk slot restore can resume this model.
Sourcepub const fn with_cache_ram_health(self, health: CacheRamHealth) -> Self
pub const fn with_cache_ram_health(self, health: CacheRamHealth) -> Self
Set the resolved host-RAM prompt cache health for this launch.
Trait Implementations§
Source§impl Clone for RunningTarget
impl Clone for RunningTarget
Source§fn clone(&self) -> RunningTarget
fn clone(&self) -> RunningTarget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more