From 057dee956a6b5e8d90e5d9dd0f728996c9921019 Mon Sep 17 00:00:00 2001 From: Tai An Date: Tue, 30 Jun 2026 13:14:59 -0700 Subject: [PATCH] fix(launcher): keep data/config under ~/.localai (#10610) (#10613) The launcher starts the server with run --models-path/--backends-path but leaves --data-path and the dynamic config dir unset, so the server falls back to its /data and /configuration defaults. is kong.ExpandPath("."), i.e. the launcher process CWD (commonly the user's home root), producing ~/data and ~/configuration outside ~/.localai and an agent-pool stateDir under ~/data. Pass --data-path and --localai-config-dir explicitly, rooted at the launcher's own data directory (GetDataPath() -> ~/.localai), so data and config stay consistent with --models-path/--backends-path. --- cmd/launcher/internal/launcher.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/launcher/internal/launcher.go b/cmd/launcher/internal/launcher.go index b7776acb5..ba4427a1f 100644 --- a/cmd/launcher/internal/launcher.go +++ b/cmd/launcher/internal/launcher.go @@ -207,12 +207,20 @@ func (l *Launcher) StartLocalAI() error { } // Build command arguments + dataPath := l.GetDataPath() args := []string{ "run", "--models-path", l.config.ModelsPath, "--backends-path", l.config.BackendsPath, "--address", l.config.Address, "--log-level", l.config.LogLevel, + // Keep persistent data and dynamic config under the launcher's data + // directory (~/.localai) rather than letting the server resolve them + // to ${basepath}/{data,configuration}. ${basepath} expands to the + // launcher process's CWD (often the user's home root), which puts + // ~/data and ~/configuration outside ~/.localai. See #10610. + "--data-path", filepath.Join(dataPath, "data"), + "--localai-config-dir", filepath.Join(dataPath, "configuration"), } l.localaiCmd = exec.CommandContext(l.ctx, binaryPath, args...)