From 0e4347037fdb3d9f685ced9dc8c55c5a8f8a7d27 Mon Sep 17 00:00:00 2001 From: leilei3167 Date: Mon, 28 Sep 2026 10:49:32 +0800 Subject: [PATCH] fix: point docker-compose default at gallery phi-2-chat (#11987) The quickstart compose file still requested phi-2, which is no longer in the gallery. Use phi-2-chat instead and fix model preload error wrapping so discover/install failures report the real error instead of %!w(). Keep earlier model failures when discovery fails for another model. Document the Compose gallery default. Fixes #11974 Signed-off-by: lei_lei --- core/startup/model_preload.go | 4 ++-- docker-compose.yaml | 2 +- docs/content/getting-started/containers.md | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/startup/model_preload.go b/core/startup/model_preload.go index 4f3bb1683..8dd167828 100644 --- a/core/startup/model_preload.go +++ b/core/startup/model_preload.go @@ -41,7 +41,7 @@ func InstallModelsWithOptions(ctx context.Context, galleryService *galleryop.Gal // Check if it's a model gallery, or print a warning e, found := installModel(ctx, galleries, backendGalleries, url, systemState, modelLoader, downloadStatus, enforceScan, autoloadBackendGalleries, requireBackendIntegrity, installOptions...) if e != nil && found { - xlog.Error("[startup] failed installing model", "error", err, "model", url) + xlog.Error("[startup] failed installing model", "error", e, "model", url) err = errors.Join(err, e) } else if !found { xlog.Debug("[startup] model not found in the gallery", "model", url) @@ -54,7 +54,7 @@ func InstallModelsWithOptions(ctx context.Context, galleryService *galleryop.Gal modelConfig, discoverErr := importers.DiscoverModelConfig(url, json.RawMessage{}) if discoverErr != nil { xlog.Error("[startup] failed to discover model config", "error", discoverErr, "model", url) - err = errors.Join(discoverErr, fmt.Errorf("failed to discover model config: %w", err)) + err = errors.Join(err, fmt.Errorf("failed to discover model config: %w", discoverErr)) continue } diff --git a/docker-compose.yaml b/docker-compose.yaml index 82b3c18b6..50eccaaf4 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -41,7 +41,7 @@ services: # Here we can specify a list of models to run (see quickstart https://localai.io/basics/getting_started/#running-models ) # or an URL pointing to a YAML configuration file, for example: # - https://gist.githubusercontent.com/mudler/ad601a0488b497b69ec549150d9edd18/raw/a8a8869ef1bb7e3830bf5c0bae29a0cce991ff8d/phi-2.yaml - - phi-2 + - phi-2-chat # For NVIDIA GPU support with CDI (recommended for NVIDIA Container Toolkit 1.14+): # Uncomment the following deploy section and use driver: nvidia.com/gpu. # Include `utility` in capabilities so nvidia-smi / NVML are available — diff --git a/docs/content/getting-started/containers.md b/docs/content/getting-started/containers.md index 6e6ca9526..d5616b201 100644 --- a/docs/content/getting-started/containers.md +++ b/docs/content/getting-started/containers.md @@ -108,6 +108,8 @@ docker run -ti --name local-ai -p 8080:8080 --runtime nvidia --gpus all localai/ ## Using Compose +The repository's `docker-compose.yaml` installs `phi-2-chat` from the model gallery by default. Change its `command` list to select a different gallery model. + For a more manageable setup, especially with persistent volumes, use Docker Compose or Podman Compose: ### Using CDI (Container Device Interface) - Recommended for NVIDIA Container Toolkit 1.14+