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-backend —
model:at the top level, plusn_ctx/n_gpu_layers. Implies onekind: "llamacpp"backend. - Multi-backend —
backends: [...]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: boolWhen 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: u32Llama.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: i32Llama.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
impl ConfigFile
Sourcepub fn load(path: &Path) -> Result<Self, ConfigError>
pub fn load(path: &Path) -> Result<Self, ConfigError>
Read + parse + validate a config file at path.
Sourcepub fn resolved_backends(&self) -> Vec<BackendEntry>
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
impl Clone for ConfigFile
Source§fn clone(&self) -> ConfigFile
fn clone(&self) -> ConfigFile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more