From 6888688fb09ba5ad0b0beb14ed9569f01014611e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Sat, 4 Apr 2026 04:56:13 +0000 Subject: [PATCH] common : respect specified tag, only fallback when tag is empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- common/download.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/download.cpp b/common/download.cpp index ad720f977b43..9d7995c9d237 100644 --- a/common/download.cpp +++ b/common/download.cpp @@ -596,9 +596,12 @@ static hf_cache::hf_file find_best_model(const hf_cache::hf_files & files, } } - for (const auto & f : files) { - if (gguf_filename_is_model(f.path)) { - return f; + // fallback to first available model only if tag is empty + if (tag.empty()) { + for (const auto & f : files) { + if (gguf_filename_is_model(f.path)) { + return f; + } } }