From 6dbcdb0b9e6f80d15ef2db05ce45d20caa6a1356 Mon Sep 17 00:00:00 2001 From: Yaroslav98214 Date: Thu, 5 Feb 2026 10:17:46 +0100 Subject: [PATCH] fix: filter GGUF and GGML files from model list (#8397) Filter GGUF and GGML files from model list Skip .gguf/.ggml loose files when listing models and add a test for .gguf exclusion. Closes #1077 Signed-off-by: Yaroslav98214 --- pkg/model/loader.go | 2 ++ pkg/model/loader_test.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/pkg/model/loader.go b/pkg/model/loader.go index 27ea78b34..00b452bd7 100644 --- a/pkg/model/loader.go +++ b/pkg/model/loader.go @@ -120,6 +120,8 @@ var knownModelsNameSuffixToSkip []string = []string{ ".", ".safetensors", ".bin", + ".gguf", + ".ggml", ".partial", ".tar.gz", } diff --git a/pkg/model/loader_test.go b/pkg/model/loader_test.go index 2c296c2ea..ec8436203 100644 --- a/pkg/model/loader_test.go +++ b/pkg/model/loader_test.go @@ -61,11 +61,13 @@ var _ = Describe("ModelLoader", func() { Context("ListFilesInModelPath", func() { It("should list all valid model files in the model path", func() { os.Create(filepath.Join(modelPath, "test.model")) + os.Create(filepath.Join(modelPath, "model.gguf")) os.Create(filepath.Join(modelPath, "README.md")) files, err := modelLoader.ListFilesInModelPath() Expect(err).To(BeNil()) Expect(files).To(ContainElement("test.model")) + Expect(files).ToNot(ContainElement("model.gguf")) Expect(files).ToNot(ContainElement("README.md")) }) })