Skip to main content

RunningTarget

Struct RunningTarget 

Source
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: String

Full URL to the server (e.g., http://127.0.0.1:5500). Future-proof for non-localhost deployments.

§port: u16

Port the server is listening on.

§model_id: u32

Database ID of the model.

§model_name: String

Human-readable model name (for logging/headers).

§effective_ctx: u64

Actual context size being used.

§just_started: bool

True when this instance was freshly spawned (restart or cold start).

§slot_restore_supported: bool

Whether 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: CacheRamHealth

How 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

Source

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.

Source

pub fn with_narration(self, narration: LaunchNarration) -> Self

Attach the narration of the launch that produced this target.

Source

pub const fn with_slot_restore_supported(self, supported: bool) -> Self

Set whether disk slot restore can resume this model.

Source

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

Source§

fn clone(&self) -> RunningTarget

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RunningTarget

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more