fix: preserve HF namespace in pulled user model names#2058
Conversation
| @@ -257,13 +257,15 @@ nlohmann::json fetch_pull_variants(const std::string& checkpoint, bool& not_foun | |||
| } | |||
There was a problem hiding this comment.
This change seems to regress the happy path (see https://lemonade-server.ai/docs/dev/philosophy/#prioritize-the-happy-path)
Before: lemonade pull LiquidAI/LFM2.5-8B-A1B-GGUF:Q8_0 would produce LFM2.5-8B-A1B-GGUF-Q8_0, which would match the naming convention of the built-in models and get pulled into the GUI category for LFM2.5 (well, it would if we had one, which we should).
After: the collision case is solved, but the happy path (where someone only downloads one GGUF and not a second nearly-identical one) is regressed.
Also, blocking, this is a breaking change that would impact things like the HF Use This Model menu:
jeremyfowers
left a comment
There was a problem hiding this comment.
My suggestion for an alternative non-breaking solution is to check for naming collisions and prompt the user to pick a different name if and only if there is a collision.
|
Thanks, agreed — this change is too broad as-is. I'll rework it so the happy path stays unchanged: the default model name should still use the repo leaf name, e.g. LFM2.5-8B-A1B-GGUF-Q8_0. Instead of always including the HF namespace, I'll only disambiguate when there is an actual name collision with a different checkpoint. In that case we can offer/use a namespace-qualified fallback such as unsloth That would be a good but more complex fix. I hope it's ok if I prioritize it down a bit to bring it on a later point since the bug is real but maybe not the most critical one IMO. |
Summary
Fixes Hugging Face user model name collisions when two repositories share the same leaf repo name but come from different namespaces.
Previously, pull/variants suggested only the repo leaf name, so pulls like:
both registered as the same
user.LFM2.5-8B-A1B-GGUF-Q8_0model and overwrote each other inuser_models.json.This keeps the HF namespace in the suggested model name, producing distinct user model names.
Risk
Simple and safe fix.
Custom model names will now include the HF namespace as well.
Test
Confirmed both models are listed separately with distinct checkpoints.
closes #2053