Skip to main content

Settings

Struct Settings 

Source
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.

§share_lan: Option<bool>

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

Source

pub const fn with_defaults() -> Self

Create settings with sensible defaults.

Source

pub const fn effective_proxy_port(&self) -> u16

Get the effective proxy port (with default fallback).

Source

pub const fn effective_llama_base_port(&self) -> u16

Get the effective llama-server base port (with default fallback).

Source

pub fn merge(&mut self, other: &SettingsUpdate)

Merge another settings into this one, only updating fields that are Some.

Trait Implementations§

Source§

impl Clone for Settings

Source§

fn clone(&self) -> Settings

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 Settings

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Settings

Source§

fn default() -> Settings

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Settings

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Settings

Source§

fn eq(&self, other: &Settings) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Settings

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Settings

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
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,