Skip to content

fix(studio): keep distinct symlink aliases for per-model settings - #10644

Merged
danielhanchen merged 14 commits into
unslothai:mainfrom
Souravrajvi0:feat/symlink-per-model-settings-a4e7
Oct 2, 2026
Merged

danielhanchen merged 14 commits into
unslothai:mainfrom
Souravrajvi0:feat/symlink-per-model-settings-a4e7

Conversation

@Souravrajvi0

@Souravrajvi0 Souravrajvi0 commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #10605

Problem

When a local model in Unsloth Studio is reached through a symlink, per-model settings saved with "Remember for this model" did not reliably restore after reload. A common workaround — creating multiple symlinks to the same on-disk model so each Hub entry can carry its own settings — also failed because the inventory deduplicated symlink aliases by physical inode identity, leaving only one row.

Solution

Custom-model dedup in local_inventory.py now keeps one Hub row per symlink path when several symlinks in a scan folder point at the same model. Settings stay keyed by the path shown in the UI (load_id), so each alias can remember independent load settings.

Existing collapse rules are preserved:

  • Symlink + canonical on-disk path → one row (prefers the real path)
  • Loose file + symlink to the same file → one row
  • GGUF + safetensors at the same path → two rows (unchanged)
  • Overlapping scan roots (symlinked folder + real folder) → one row

Tests

  • test_two_symlink_aliases_to_one_model_stay_distinct (backend)
  • symlink alias paths keep independent remembered settings (frontend)

Before / after

A scan folder holding two symlinks (alias-a, alias-b) to one model folder with two GGUF quants. Before (merge base c0a60448e) the On Device list shows one row; after (d73032f26) it shows both aliases, so each keeps its own remembered settings.

On Device list before and after: one row vs alias-a and alias-b

When several symlinks in a custom scan folder point at the same on-disk
model, the Hub inventory now keeps one row per symlink path instead of
collapsing them by physical identity. That lets each alias remember its
own load settings after reload, which addresses unslothai#10605.

Symlink plus canonical path, or symlink plus real file, still dedupe to
one row. Mixed GGUF and safetensors rows at the same path are unchanged.
chatgpt-codex-connector[bot]

This comment was marked as outdated.

Assert identical symlink rows collapse once while distinct aliases stay separate.
@Souravrajvi0

This comment has been minimized.

pre-commit-ci Bot and others added 4 commits September 16, 2026 05:10
Custom-folder dedupe kept every scanner row when multiple symlinks
shared one physical model, so duplicate paths from _scan_models_dir and
_scan_lmstudio_dir could appear twice in the Hub. Collapse duplicate
paths first, then preserve distinct symlink aliases.
Walk parents for is_symlink so distinct symlink roots keep separate
custom inventory rows when the discovered path is a weight file.
@danielhanchen danielhanchen self-assigned this Oct 1, 2026
danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 1, 2026
@shimmyshimmer

Copy link
Copy Markdown
Member

Review record for #10644, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#289.

Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found.

Round 1: reviewed mirror 35ce9764eb (this PR's 6de7a6797)

chatgpt-codex-connector[bot] (on the mirror)

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 35ce9764eb

No triage reaction was recorded on the mirror

Verdict

The round converged at mirror 35ce9764eb (this PR's 6de7a6797).

This is the review as it stood at that commit. Anything pushed to this PR afterwards was not part of it.

danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 1, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 1, 2026
@danielhanchen
danielhanchen merged commit fc55566 into unslothai:main Oct 2, 2026
6 of 51 checks passed
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.

[Bug] When local model is a link on linux settings per model are not saved

3 participants