diff --git a/core/cli/run.go b/core/cli/run.go index 491c429d4..211c2efa7 100644 --- a/core/cli/run.go +++ b/core/cli/run.go @@ -382,7 +382,10 @@ func (r *RunCMD) Run(ctx *cliContext.Context) (result error) { config.WithMLXTunnelCallback(func(tunnels []string) { hostfile := filepath.Join(os.TempDir(), "localai_mlx_hostfile.json") data, _ := json.Marshal(tunnels) - os.WriteFile(hostfile, data, 0600) + if err := os.WriteFile(hostfile, data, 0600); err != nil { + xlog.Error("failed to write MLX hostfile", "path", hostfile, "error", err) + return + } os.Setenv("MLX_DISTRIBUTED_HOSTFILE", hostfile) xlog.Debug("setting MLX_DISTRIBUTED_HOSTFILE", "value", hostfile, "tunnels", tunnels) }),