pub struct Settings {Show 16 fields
pub default_download_path: Option<String>,
pub default_context_size: Option<u64>,
pub proxy_port: Option<u16>,
pub llama_base_port: Option<u16>,
pub max_download_queue_size: Option<u32>,
pub show_memory_fit_indicators: Option<bool>,
pub max_tool_iterations: Option<u32>,
pub max_stagnation_steps: Option<u32>,
pub default_model_id: Option<i64>,
pub inference_defaults: Option<InferenceConfig>,
pub inference_profiles: Option<Vec<InferenceProfile>>,
pub setup_completed: Option<bool>,
pub title_generation_prompt: Option<String>,
pub bind_host: Option<String>,
pub share_lan: Option<bool>,
pub trust_client_sampling: Option<bool>,
}Expand description
Application settings structure.
All fields are optional to support partial updates and graceful defaults.
Fields§
§default_download_path: Option<String>Default directory for downloading models.
default_context_size: Option<u64>Default context size for models (e.g., 4096, 8192).
proxy_port: Option<u16>Port for the OpenAI-compatible proxy server.
llama_base_port: Option<u16>Base port for llama-server instance allocation (first port in range).
Note: The OpenAI-compatible proxy listens on proxy_port.
max_download_queue_size: Option<u32>Maximum number of downloads that can be queued (1-50).
show_memory_fit_indicators: Option<bool>Whether to show memory fit indicators in HuggingFace browser.
max_tool_iterations: Option<u32>Maximum iterations for tool calling agentic loop.
max_stagnation_steps: Option<u32>Maximum stagnation steps before stopping agent loop.
default_model_id: Option<i64>Default model ID for commands that support a default model.
inference_defaults: Option<InferenceConfig>Global inference parameter defaults.
Applied when neither request nor per-model defaults are specified. If not set, hardcoded defaults are used as final fallback.
inference_profiles: Option<Vec<InferenceProfile>>Named sampling profiles, selectable per request as {model}:{profile}.
Global rather than per-model: one coding profile applies to every
model, and its sparse fields fall through to that model’s own
inference_defaults for anything it does not set. See
crate::domain::inference_profile.
setup_completed: Option<bool>Whether the first-run setup wizard has been completed.
title_generation_prompt: Option<String>Custom prompt template for generating chat titles.
bind_host: Option<String>Override the bind host for gglib web.
None → use the compiled-in default (127.0.0.1). The --host flag
takes precedence for a single run without changing this value.
Whether gglib web binds all LAN interfaces and broadcasts over mDNS.
None/Some(false) → localhost-only. The --share-lan flag can turn
this on for a single run, but cannot turn it off — clear it here.
trust_client_sampling: Option<bool>Whether a client’s own sampling parameters (temperature, top_p,
top_k, presence_penalty, repeat_penalty, min_p) are honoured
by the proxy at all.
None/Some(false) → the client’s sampling opinions are dropped from
the resolution hierarchy entirely; the request falls straight through
to the profile / per-model / global / floor layers as if the client
had sent none of them. max_tokens is unaffected either way — it is
a budget, not a taste, and a client that names one still gets it
honoured; ignoring it would silently truncate that client’s own
turns.
Defaults to distrust because most clients that talk to this proxy
send fixed sampling values with no user-facing control behind them —
boilerplate the client always sends, not a deliberate choice by
whoever is using it (VS Code Copilot’s LLM Gateway hardcodes
temperature: 0 on every request, for one). Letting that boilerplate
silently outrank a model’s own tuned defaults and this server’s
global settings defeats the point of configuring either. Set true
for a client that does expose real sampling controls to its user
(OpenWebUI’s sliders, for instance).
Implementations§
Source§impl Settings
impl Settings
Sourcepub const fn with_defaults() -> Self
pub const fn with_defaults() -> Self
Create settings with sensible defaults.
Sourcepub const fn effective_proxy_port(&self) -> u16
pub const fn effective_proxy_port(&self) -> u16
Get the effective proxy port (with default fallback).
Sourcepub const fn effective_llama_base_port(&self) -> u16
pub const fn effective_llama_base_port(&self) -> u16
Get the effective llama-server base port (with default fallback).
Sourcepub fn merge(&mut self, other: &SettingsUpdate)
pub fn merge(&mut self, other: &SettingsUpdate)
Merge another settings into this one, only updating fields that are Some.