mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-05 16:44:22 +00:00
Ensure local node is defined in LoadConfig by adding default config if missing
This commit is contained in:
@@ -150,9 +150,7 @@ func LoadConfig(configPath string) (AppConfig, error) {
|
|||||||
EnableSwagger: false,
|
EnableSwagger: false,
|
||||||
},
|
},
|
||||||
LocalNode: "main",
|
LocalNode: "main",
|
||||||
Nodes: map[string]NodeConfig{
|
Nodes: map[string]NodeConfig{},
|
||||||
"main": {}, // Local node with empty config
|
|
||||||
},
|
|
||||||
Backends: BackendConfig{
|
Backends: BackendConfig{
|
||||||
LlamaCpp: BackendSettings{
|
LlamaCpp: BackendSettings{
|
||||||
Command: "llama-server",
|
Command: "llama-server",
|
||||||
@@ -217,6 +215,11 @@ func LoadConfig(configPath string) (AppConfig, error) {
|
|||||||
return cfg, err
|
return cfg, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If local node is not defined in nodes, add it with default config
|
||||||
|
if _, ok := cfg.Nodes[cfg.LocalNode]; !ok {
|
||||||
|
cfg.Nodes[cfg.LocalNode] = NodeConfig{}
|
||||||
|
}
|
||||||
|
|
||||||
// 3. Override with environment variables
|
// 3. Override with environment variables
|
||||||
loadEnvVars(&cfg)
|
loadEnvVars(&cfg)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user