From a0f0505f0da21fa75d8c3e8cc539d513940626bb Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Fri, 11 Oct 2024 17:30:14 +0200 Subject: [PATCH] fix(welcome): do not list model twice if we have a config (#3790) Signed-off-by: Ettore Di Giacinto --- core/http/endpoints/localai/welcome.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/http/endpoints/localai/welcome.go b/core/http/endpoints/localai/welcome.go index 0518ceac..68f39e39 100644 --- a/core/http/endpoints/localai/welcome.go +++ b/core/http/endpoints/localai/welcome.go @@ -29,13 +29,20 @@ func WelcomeEndpoint(appConfig *config.ApplicationConfig, galleryConfigs[m.Name] = cfg } + modelsWithoutConfig := []string{} + for _, m := range models { + if _, ok := modelsWithBackendConfig[m]; !ok { + modelsWithoutConfig = append(modelsWithoutConfig, m) + } + } + // Get model statuses to display in the UI the operation in progress processingModels, taskTypes := modelStatus() summary := fiber.Map{ "Title": "LocalAI API - " + internal.PrintableVersion(), "Version": internal.PrintableVersion(), - "Models": models, + "Models": modelsWithoutConfig, "ModelsConfig": backendConfigs, "GalleryConfig": galleryConfigs, "IsP2PEnabled": p2p.IsP2PEnabled(),