Skip to content

Commit 057dee9

Browse files
authored
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.
1 parent 4ec39bb commit 057dee9

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

cmd/launcher/internal/launcher.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,20 @@ func (l *Launcher) StartLocalAI() error {
207207
}
208208

209209
// Build command arguments
210+
dataPath := l.GetDataPath()
210211
args := []string{
211212
"run",
212213
"--models-path", l.config.ModelsPath,
213214
"--backends-path", l.config.BackendsPath,
214215
"--address", l.config.Address,
215216
"--log-level", l.config.LogLevel,
217+
// Keep persistent data and dynamic config under the launcher's data
218+
// directory (~/.localai) rather than letting the server resolve them
219+
// to ${basepath}/{data,configuration}. ${basepath} expands to the
220+
// launcher process's CWD (often the user's home root), which puts
221+
// ~/data and ~/configuration outside ~/.localai. See #10610.
222+
"--data-path", filepath.Join(dataPath, "data"),
223+
"--localai-config-dir", filepath.Join(dataPath, "configuration"),
216224
}
217225

218226
l.localaiCmd = exec.CommandContext(l.ctx, binaryPath, args...)

0 commit comments

Comments
 (0)