Skip to content

fix(studio): dedupe custom-folder GGUF entries by directory index - #9306

Closed
Souravrajvi0 wants to merge 3 commits into
unslothai:mainfrom
Souravrajvi0:feat/fix-embedding-model-id-dedup-27d3
Closed

Souravrajvi0 wants to merge 3 commits into
unslothai:mainfrom
Souravrajvi0:feat/fix-embedding-model-id-dedup-27d3

Conversation

@Souravrajvi0

@Souravrajvi0 Souravrajvi0 commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #9128 / #9149.

Problem

@3-ark reported redundant model IDs in custom folders: the picker listed both bge-m3/ (directory) and bge-m3-q8_0.gguf for the same weights.

Changes

  • routes/models.py: _dedupe_sibling_gguf_folder_entries() drops standalone .gguf rows only when a directory entry actually indexes that file — the file lives inside the directory, or a same-named sibling copy sits beside a directory that contains it. Name-prefix matching is gone.

Split out

The embeddings/completions monitor-id normalization lives in #9346.

Test plan

  • Unit tests: indexed sibling dropped; in-dir file dropped; prefix-similar but unindexed kept; unrelated kept
  • Integration: custom-folder scan keeps only the directory row

@danielhanchen

Copy link
Copy Markdown
Member

Confirmed the custom-folder scan in studio/backend/routes/models.py lists the directory and the sibling .gguf as separate rows, and that the embeddings monitor still echoes the raw request model instead of _monitor_active_model(). Could you split the monitor-id change out and replace the prefix match in _dedupe_sibling_gguf_folder_entries with a check that the file is actually indexed by that directory, plus a real behaviour test instead of the inspect.getsource assertion?

@Souravrajvi0 Souravrajvi0 changed the title fix(studio): dedupe custom-folder GGUF entries and normalize API monitor ids fix(studio): dedupe custom-folder GGUF entries by directory index Aug 20, 2026
@Souravrajvi0

Copy link
Copy Markdown
Contributor Author

Addressed review feedback:

  1. Split monitor-id out → fix(studio): use resolved public id in embeddings/completions monitor #9346 (with a real embeddings monitor behaviour test instead of inspect.getsource).
  2. Dedupe by directory index — removed the prefix match. A standalone .gguf is dropped only when a directory entry indexes it (file is inside the dir, or a same-named sibling exists beside a dir that contains that filename).
  3. Tests — added coverage for the prefix-similar-but-unindexed keep case and the in-directory duplicate row case; custom-folder scan integration test still passes.

@danielhanchen

Copy link
Copy Markdown
Member

Thanks, the monitor-id change is out in #9346 and the dedupe now checks the directory actually indexes the file rather than matching on name prefix, with the behaviour tests replacing the getsource assertion. Will get this reviewed.

Souravrajvi0 and others added 3 commits August 22, 2026 08:02
…tor ids

Custom-folder scans listed both a model directory (bge-m3/) and a sibling
standalone .gguf (bge-m3-q8_0.gguf), producing duplicate picker rows (unslothai#9128).

Also show the loaded public model id in the API monitor for /embeddings and
/v1/completions instead of echoing the raw client-supplied alias.
Drop standalone .gguf picker rows only when a directory entry actually
indexes that file (file lives in the dir, or a same-named sibling copy
exists beside a dir that contains it). Remove the name-prefix match.

Split the embeddings/completions monitor-id change out of this PR.
@Souravrajvi0
Souravrajvi0 force-pushed the feat/fix-embedding-model-id-dedup-27d3 branch from 76719cd to 09572cb Compare August 22, 2026 08:03
@Souravrajvi0

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main (Aug 22).

This branch is dedupe-only now — monitor-id change remains in #9346 per review.

  • studio/backend/routes/models.py — _dedupe_sibling_gguf_folder_entries() drops standalone .gguf rows only when a sibling directory actually indexes that file (no prefix matching)
  • studio/backend/tests/test_scan_folder_health.py — 5 behaviour tests for dedupe paths

Suggest merging #9346 first, then this one. Ready when you have a moment.

@Souravrajvi0

Copy link
Copy Markdown
Contributor Author

Closing as superseded by merged #9975 (Imagineer99, 2026-08-30): dedupe_custom_gguf_rows + suppress_grouped_gguf_file_rows in hub/utils/gguf.py, wired through routes/models.py, local_inventory.py, and local_model_resolver.py, with regression coverage in test_custom_gguf_discovery.py.

That covers the same bge-m3 directory + sibling .gguf duplicate-picker case this PR targeted. Monitor alias fix remains in #9346.

@Souravrajvi0
Souravrajvi0 deleted the feat/fix-embedding-model-id-dedup-27d3 branch September 4, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants