Skip to main content

ConfigFile

Struct ConfigFile 

Source
pub struct ConfigFile {
    pub auto_pull: bool,
    pub models_home: Option<PathBuf>,
    pub model: Option<ModelConfig>,
    pub n_ctx: u32,
    pub n_gpu_layers: i32,
    pub admin_addr: Option<String>,
    pub backends: Option<Vec<BackendEntry>>,
    pub listen: Option<ListenConfig>,
}
Expand description

Top-level config-file schema.

Two flavours coexist:

  • Legacy single-backendmodel: at the top level, plus n_ctx / n_gpu_layers. Implies one kind: "llamacpp" backend.
  • Multi-backendbackends: [...] carries an ordered list of backend entries. Router walks the list per ADR 0007.

The two are mutually exclusive at parse time: setting both is a validation error. auto_pull and admin_addr apply to both flavours.

Fields§

§auto_pull: bool

When true and a kind: "llamacpp" model file is absent, the daemon downloads it from the entry’s source_url on startup. When false, the daemon refuses to start with a clear error pointing at the operator’s next step. Default: true. Applies to every llamacpp entry in backends:.

§models_home: Option<PathBuf>

Override for the shared model store root. When unset the daemon falls back to MODELS_HOME env, then the platform default. Tilde-expanded on read.

§model: Option<ModelConfig>

Legacy single-backend model spec. Deprecated in favour of backends: but kept for v0.1.x config-file compatibility. Mutually exclusive with backends:.

§n_ctx: u32

Llama.cpp context window in tokens. Default: 8192. Used as the fallback for legacy model: entries; multi-backend entries carry their own n_ctx.

§n_gpu_layers: i32

Llama.cpp GPU layer offload count. 0 = CPU-only. Default: 0. Used as the fallback for legacy model: entries; multi- backend entries carry their own n_gpu_layers.

§admin_addr: Option<String>

Admin socket address. Default: platform-specific path per docs/protocol-v1.md §“Admin endpoint”.

§backends: Option<Vec<BackendEntry>>

Ordered list of backends (multi-backend shape). First entry is highest priority — the router tries it first, then the next, etc. Mutually exclusive with model:.

§listen: Option<ListenConfig>

Optional listener overrides. Default behaviour is unchanged: the operator picks a transport via --tcp / --uds / --pipe on the CLI. When listen: is present and the CLI did not pass a transport flag, the daemon binds the transports declared here. CLI flags always win when both are set. Restart-time only — no config watcher.

Implementations§

Source§

impl ConfigFile

Source

pub fn load(path: &Path) -> Result<Self, ConfigError>

Read + parse + validate a config file at path.

Source

pub fn resolved_backends(&self) -> Vec<BackendEntry>

Canonical multi-backend list. When the operator wrote the legacy single-backend shape (model: at top level), this returns a one-element list with kind: "llamacpp" so the rest of the daemon only ever sees the multi-backend shape.

Trait Implementations§

Source§

impl Clone for ConfigFile

Source§

fn clone(&self) -> ConfigFile

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 ConfigFile

Source§

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

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

impl<'de> Deserialize<'de> for ConfigFile

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 Serialize for ConfigFile

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

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.

Source§

impl<T> Instrument for T

Source§

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

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

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

impl<T> WithSubscriber for T

Source§

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

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>,