Skip to main content

Module launch_narration

Module launch_narration 

Source
Expand description

What the runtime decided for one llama-server launch, and why.

§Why this type exists

gglib makes a series of non-obvious choices every time it launches a model: it sizes the host-RAM prompt cache against free memory, quantizes the KV cache, enables speculative decoding from the model’s own metadata, picks a tool-call dialect parser, and resolves the context size through a four-level fallback chain. Every one of those values already existed at launch — but only in a debug! line or a local variable, so the user’s evidence that any of it happened was a 1,000-line README.

LaunchNarration is the record of those decisions, captured once at spawn where each resolver’s *Source enum is still in scope. It carries provenance, not just values: “32768” is a number, “32768 (model server_defaults)” is an explanation, and the second is the one that makes the runtime’s behaviour auditable rather than magical.

§One record, three surfaces

The same narration is rendered by the CLI banner at startup, served on GET /v1/proxy/status, and displayed in the GUI dashboard. It lives in gglib-core so all three can name the type without any of them depending on the runtime that produces it.

§Presentation, not computation

Nothing here re-derives a value. Every field is assigned from a resolution the launch already performed; a decision gglib does not actually make has no business appearing in this struct. Notably absent is the GPU layer split: gglib never emits -ngl, so how many layers get offloaded is llama.cpp’s decision and is not gglib’s to report. See [Self::backend] for what is known.

Structs§

LaunchDecision
One resolved launch decision, paired with the reason it was chosen.
LaunchNarration
Everything the runtime decided for one llama-server launch.

Functions§

format_gib
Format a byte count as GiB with one decimal, e.g. 17.2 GB.
format_mib_as_gib
Format a MiB count as GiB with one decimal, for the RAM cache budget.