From a9f1c1a619ea5a144fe3fbf0395c3cd35abb30e1 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sat, 30 Aug 2025 22:25:45 +0200 Subject: [PATCH] Add LRU eviction configuration for instances --- pkg/config/config.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/config/config.go b/pkg/config/config.go index 89080ed..5017662 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -58,6 +58,9 @@ type InstancesConfig struct { // Maximum number of instances that can be running at the same time MaxRunningInstances int `yaml:"max_running_instances,omitempty"` + // Enable LRU eviction for instance logs + EnableLRUEviction bool `yaml:"enable_lru_eviction"` + // Path to llama-server executable LlamaExecutable string `yaml:"llama_executable"` @@ -117,6 +120,7 @@ func LoadConfig(configPath string) (AppConfig, error) { AutoCreateDirs: true, MaxInstances: -1, // -1 means unlimited MaxRunningInstances: -1, // -1 means unlimited + EnableLRUEviction: true, LlamaExecutable: "llama-server", DefaultAutoRestart: true, DefaultMaxRestarts: 3, @@ -220,6 +224,11 @@ func loadEnvVars(cfg *AppConfig) { cfg.Instances.MaxRunningInstances = m } } + if enableLRUEviction := os.Getenv("LLAMACTL_ENABLE_LRU_EVICTION"); enableLRUEviction != "" { + if b, err := strconv.ParseBool(enableLRUEviction); err == nil { + cfg.Instances.EnableLRUEviction = b + } + } if llamaExec := os.Getenv("LLAMACTL_LLAMA_EXECUTABLE"); llamaExec != "" { cfg.Instances.LlamaExecutable = llamaExec }