Skip to content

fix: preserve HF namespace in pulled user model names#2058

Draft
fl0rianr wants to merge 1 commit into
mainfrom
fl0rianr/fix_model_name_registry_collision
Draft

fix: preserve HF namespace in pulled user model names#2058
fl0rianr wants to merge 1 commit into
mainfrom
fl0rianr/fix_model_name_registry_collision

Conversation

@fl0rianr
Copy link
Copy Markdown
Collaborator

@fl0rianr fl0rianr commented Jun 1, 2026

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:

  • LiquidAI/LFM2.5-8B-A1B-GGUF:Q8_0
  • unsloth/LFM2.5-8B-A1B-GGUF:Q8_0

both registered as the same user.LFM2.5-8B-A1B-GGUF-Q8_0 model and overwrote each other in user_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

cmake --build . --target lemond lemonade -j"$(nproc)"
./lemond

./lemonade pull LiquidAI/LFM2.5-8B-A1B-GGUF:Q8_0
./lemonade pull unsloth/LFM2.5-8B-A1B-GGUF:Q8_0
./lemonade list --downloaded | grep -i LFM

Confirmed both models are listed separately with distinct checkpoints.

closes #2053

@@ -257,13 +257,15 @@ nlohmann::json fetch_pull_variants(const std::string& checkpoint, bool& not_foun
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Image

Copy link
Copy Markdown
Member

@jeremyfowers jeremyfowers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@fl0rianr
Copy link
Copy Markdown
Collaborator Author

fl0rianr commented Jun 2, 2026

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-LFM2.5-8B-A1B-GGUF-Q8_0, while still allowing the user to choose a custom name.

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.

@fl0rianr fl0rianr marked this pull request as draft June 3, 2026 11:31
@github-actions github-actions Bot added bug Something isn't working area::cli lemonade CLI client (src/cpp/cli) labels Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area::cli lemonade CLI client (src/cpp/cli) bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lemonade does not distinguish between same name models in different namespace

2 participants