]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
common : add a WARNING for HF cache migration (#20935)
authorAdrien Gallouët <redacted>
Tue, 24 Mar 2026 08:24:39 +0000 (09:24 +0100)
committerGitHub <redacted>
Tue, 24 Mar 2026 08:24:39 +0000 (09:24 +0100)
Signed-off-by: Adrien Gallouët <redacted>
README.md
common/hf-cache.cpp

index 83391051003441722c4b9fec23fa140b7460f123..7d3ae6b7c275f9d75af87296ca5882a068ebb3a9 100644 (file)
--- a/README.md
+++ b/README.md
@@ -17,6 +17,7 @@ LLM inference in C/C++
 
 ## Hot topics
 
+- **HuggingFace cache migration: models downloaded with `-hf` are now stored in the standard HuggingFace cache directory, enabling sharing with other HF tools.**
 - **[guide : using the new WebUI of llama.cpp](https://github.com/ggml-org/llama.cpp/discussions/16938)**
 - [guide : running gpt-oss with llama.cpp](https://github.com/ggml-org/llama.cpp/discussions/15396)
 - [[FEEDBACK] Better packaging for llama.cpp to support downstream consumers 🤗](https://github.com/ggml-org/llama.cpp/discussions/15313)
index ad68c5567419a3b9082ca6c8166a4c83bcd57200..ce66f64679a342fc34ace32180b709b42439e488 100644 (file)
@@ -590,6 +590,8 @@ void migrate_old_cache_to_hf_cache(const std::string & token, bool offline) {
         return; // -hf is not going to work
     }
 
+    bool warned = false;
+
     for (const auto & entry : fs::directory_iterator(old_cache)) {
         if (!entry.is_regular_file()) {
             continue;
@@ -601,6 +603,19 @@ void migrate_old_cache_to_hf_cache(const std::string & token, bool offline) {
             continue;
         }
 
+        if (!warned) {
+            warned = true;
+            LOG_WRN("================================================================================\n"
+                    "WARNING: Migrating cache to HuggingFace cache directory\n"
+                    "  Old cache: %s\n"
+                    "  New cache: %s\n"
+                    "This one-time migration moves models previously downloaded with -hf\n"
+                    "from the legacy llama.cpp cache to the standard HuggingFace cache.\n"
+                    "Models downloaded with --model-url are not affected.\n"
+                    "================================================================================\n",
+                    old_cache.string().c_str(), get_cache_directory().string().c_str());
+        }
+
         auto repo_id = owner + "/" + repo;
         auto files = get_repo_files(repo_id, token);