pub const fn resolve_context_size(opts: &ServerConfigOptions) -> u64Expand description
Resolve context size using the 5-level fallback chain.
- Runtime request / CLI flag (
opts.context_size) — highest priority - Per-model server defaults (
opts.model_server_ctx) — from DB - Global app setting (
opts.global_default_ctx) — only when the user set one - Fitted to this machine (
opts.fitted_ctx) - Hardcoded default (
DEFAULT_CONTEXT_SIZE= 4096) — lowest priority
The fitted value sits below the global default deliberately: a number the user typed outranks one gglib computed. It sits above the built-in floor for the same reason — 4096 is what you serve when you know nothing, and by this rung something is known.