From e3ade453a8f96a5534ae804e32a44aeb0159befa Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Mon, 18 Aug 2025 13:52:07 -0700 Subject: [PATCH] llm: Check for nil memory data before printing We dump out our best memory estimate after we complete processing for any reason, including errors. This is helpful for finding what what stopped us in error conditions but in some cases we might not have gotten even the first result yet. Fixes #11957 --- llm/server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llm/server.go b/llm/server.go index 01224a166f..ecdaa90e99 100644 --- a/llm/server.go +++ b/llm/server.go @@ -651,7 +651,9 @@ func (s *ollamaServer) Load(ctx context.Context, gpus discover.GpuInfoList, requ if !success { s.initModel(ctx, LoadRequest{}, LoadOperationClose) } - s.mem.Log(slog.LevelInfo) + if s.mem != nil { + s.mem.Log(slog.LevelInfo) + } }() slog.Info("loading model", "model layers", s.totalLayers, "requested", s.options.NumGPU)