@@ -197,7 +197,7 @@ func (s *ServerHandler) PreLoadModels(ctx context.Context) {
197197
198198 s .preloadModelStatus = InProgress
199199
200- slog .Info (fmt .Sprintf ("Loading %d models..." , len (s .preloadModels )))
200+ slog .Info (fmt .Sprintf ("Preloading %d models..." , len (s .preloadModels )))
201201 client := api .NewClient (s .upstreamBaseURL , http .DefaultClient )
202202 for _ , model := range s .preloadModels {
203203 pullRequest := & api.PullRequest {
@@ -228,7 +228,21 @@ func (s *ServerHandler) PreLoadModels(ctx context.Context) {
228228 }
229229
230230 s .preloadModelStatus = Preloaded
231- slog .Info (fmt .Sprintf ("Loaded %d models..." , len (s .preloadModels )))
231+ slog .Info (fmt .Sprintf ("Preloaded %d models" , len (s .preloadModels )))
232+
233+ listResponse , err := client .List (ctx )
234+ if err != nil {
235+ slog .Error ("Failed to list current models" , "error" , err )
236+ } else {
237+ var totalSize int64 = 0
238+ for _ , model := range listResponse .Models {
239+ totalSize += model .Size
240+ sizeGB := float64 (model .Size ) / 1024.0 / 1024.0 / 1024.0
241+ slog .Info (fmt .Sprintf ("Found model %s, size %0.1fGB" , model .Name , sizeGB ))
242+ }
243+ totalSizeGB := float64 (totalSize ) / 1024.0 / 1024.0 / 1024.0
244+ slog .Info (fmt .Sprintf ("Found %d loaded models with total size %0.1fGB" , len (listResponse .Models ), totalSizeGB ))
245+ }
232246}
233247
234248// forwardUserModelMetrics forwards the give ollama usage metrics to selected webhook.
0 commit comments