pub struct ServerConfigOptions {Show 16 fields
pub context_size: Option<u64>,
pub model_server_ctx: Option<usize>,
pub global_default_ctx: Option<u64>,
pub fitted_ctx: Option<u64>,
pub port: Option<u16>,
pub jinja: Option<bool>,
pub reasoning_format: Option<String>,
pub mtp_draft_n_max: Option<u32>,
pub mtp_draft_p_min: Option<f32>,
pub slot_save_path: Option<PathBuf>,
pub cache_ram_mb: Option<u64>,
pub cache_reuse: Option<u32>,
pub cache_type_k: Option<KvCacheType>,
pub cache_type_v: Option<KvCacheType>,
pub inference_params: Option<InferenceConfig>,
pub mlock: Option<bool>,
}Expand description
Caller-supplied overrides for resolve_context_size.
All fields default to None, which means “fall through to next tier”.
Serialized as part of the daemon’s HTTP contract: a pinned proxy start
(POST /api/proxy/start) carries the model’s fully-cascaded options in
the request body. #[serde(default)] keeps that contract stable when a
field is added — an older client’s body simply resolves the new field to
None.
Fields§
§context_size: Option<u64>Override the context window size forwarded to llama-server.
None lets llama-server use its built-in default.
model_server_ctx: Option<usize>Per-model server defaults context length (from Model.server_defaults.context_length).
Second tier in fallback chain.
global_default_ctx: Option<u64>Global app setting for default context size (from Settings.default_context_size).
Third tier in fallback chain.
fitted_ctx: Option<u64>Context fitted to this model and this machine, from
crate::domain::fit_context. Fourth tier in the fallback chain.
None when it could not be computed — unknown KV shape, no memory
reading — which is a refusal, not a zero: the chain falls through to the
built-in default rather than launching against a guess.
port: Option<u16>Bind llama-server to a specific port instead of letting the allocator choose.
jinja: Option<bool>Override Jinja template support.
None→ auto-detect:--jinjawhen the model has the"agent"tag, and otherwise no flag at all, which leaves llama-server’s own default (jinja on) in place rather than disabling it.Some(true)→--jinjaregardless of tags.Some(false)→--no-jinjaregardless of tags. The only route to actually turning jinja off; seecrate::ports::JinjaMode.
reasoning_format: Option<String>Override the reasoning format passed to llama-server.
None→ auto-detect from model tags (e.g."reasoning"tag).Some("none")→ explicitly suppress reasoning extraction even if the model has a reasoning tag.Some("deepseek")/Some("deepseek-legacy")→ force a specific format.
mtp_draft_n_max: Option<u32>Override the MTP draft token count.
None→ auto-detect: enabled with defaultn=2when the model has the"mtp"tag.Some(0)→ explicitly disable MTP even if the model has the"mtp"tag.Some(n)→ enable MTP withndraft tokens.
mtp_draft_p_min: Option<f32>Override the MTP acceptance probability threshold.
Only meaningful when MTP is enabled. None uses the default (0.75).
slot_save_path: Option<PathBuf>Directory for llama-server KV cache slot persistence (--slot-save-path).
None— disk slot persistence disabled, no--slot-save-pathflag.Some(dir)— enables slot save/restore. Direct pass-through, no tag-based auto-detection (unlike jinja/MTP/reasoning). Independent ofcache_ram_mb/cache_reusebelow.
cache_ram_mb: Option<u64>RAM budget in MiB for llama-server’s own host-RAM prompt cache
(--cache-ram). None leaves llama-server’s built-in default. Some(0)
disables the cache. Direct pass-through, no tag-based auto-detection.
cache_reuse: Option<u32>Minimum chunk size in tokens for KV-shift cache reuse past the first
prefix divergence point (--cache-reuse). None leaves the feature
off. Direct pass-through, no tag-based auto-detection.
cache_type_k: Option<KvCacheType>Explicit override for the K cache element type (--cache-type-k).
None resolves to the q8_0 default (see
gglib_runtime::llama::args::resolve_kv_cache_types), unless
GGLIB_DISABLE_KV_QUANT=1 is set.
cache_type_v: Option<KvCacheType>Explicit override for the V cache element type (--cache-type-v).
Same resolution as Self::cache_type_k. Quantizing V additionally
requires Flash Attention to be active — see
gglib_runtime::llama::args::kv_cache_type module docs.
inference_params: Option<InferenceConfig>Inference parameter overrides (temperature, top-p, etc.) forwarded directly to llama-server.
mlock: Option<bool>Whether to memory-lock the model into RAM (--mlock).
None defaults to false in build_server_config().
Implementations§
Source§impl ServerConfigOptions
impl ServerConfigOptions
Sourcepub fn overlay(&self, over: &Self) -> Self
pub fn overlay(&self, over: &Self) -> Self
Field-wise merge: every Some in over wins, every None falls
through to self.
This is the single layering primitive behind both places where two sets of options meet:
- the 3-tier cascade in
UnifiedServerConfig::resolved_options, where global defaults are the base and explicit CLI/GUI overrides areover; - per-call launch overrides layered on top of a
ProcessManager’s standing template.
Note that this merges options, not resolved values — the tier chain
baked into resolve_context_size (request → per-model → global →
fitted → hardcoded) still runs afterwards on the merged result, so
overlaying never collapses those tiers early.
over is destructured exhaustively on purpose: adding a field to this
struct then fails to compile until it is given merge semantics here,
rather than being silently dropped.
Trait Implementations§
Source§impl Clone for ServerConfigOptions
impl Clone for ServerConfigOptions
Source§fn clone(&self) -> ServerConfigOptions
fn clone(&self) -> ServerConfigOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more