Skip to content

Clean up Hub runtime/config coupling - #9886

Merged
shimmyshimmer merged 27 commits into
unslothai:mainfrom
Sneakr:split/pr9599-01-hub-cleanup-scoped
Sep 8, 2026
Merged

shimmyshimmer merged 27 commits into
unslothai:mainfrom
Sneakr:split/pr9599-01-hub-cleanup-scoped

Conversation

@Sneakr

@Sneakr Sneakr commented Aug 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR separates Hub model and dataset discovery, downloads, local inventory, and file management from shared runtime and configuration logic.

It:

  • Routes Hub Run through the shared model-picker configuration handoff.
  • Preserves public repository IDs and exact snapshot load paths, so running cached models from settings still updates the last-used-model record.
  • Removes the Hub-owned Eject, Train, Loaded, and duplicated per-model configuration surfaces.
  • Removes duplicated runtime/config identity helpers, feature gates, and stale wiring that intertwined Hub with chat and inference.
  • Preserves discovery, downloads, resume/cancel, updates, deletion, pinning, local folders, and On Device workflows.
  • Keeps the minimal residency synchronization required for safe cache updates and deletion.
  • Updates focused tests to match the cleaned Hub boundary.

Blank GGUF selection candidates and defaults are ignored during resolution and sorting, preserving explicit selection, active variant, default variant, and ranked fallback precedence. Regression tests cover the combined sorting and selection path.

Six configuration Run regression cases execute the shipped settings callback and loader persistence guard. They cover secondary GGUF and safetensors caches, Windows paths, normal Hub selections, indexed local files, and native file-picker selections. The three secondary-cache cases fail before the identity fix and pass afterward.

Local validation

  • 7,009 frontend tests passed.
  • Typecheck passed.
  • Production build passed.
  • Bundle budget check passed.

Sneakr added 9 commits August 26, 2026 18:27
Remove Hub Run, Eject, Train, Loaded, and per-model settings UI along with the unused runtime wiring and tests.

Keep residency and loading checks where they prevent unsafe cache updates or deletion.

Preserve discovery, downloads, updates, deletion, pinning, local folders, hidden-model filtering, and backend behavior.
Keep the cached load ID in the selected Hub model so resident and loading checks can match pinned snapshot paths.

Cover inactive cache paths and the selected-view mapping with focused regression tests.

Refresh cleanup comments that still referred to removed settings actions.
Remove references to the deleted settings identity helper while preserving the existing standalone GGUF rules.
Preserve upstream speech-only residency and model-memory updates while retaining the scoped Hub cleanup.
Keep cached and local HF-cache identities resolvable while resume and cancellation swap the inventory row source. Canonicalize optimistic IDs, preserve legacy raw-ID links, and keep On Device details attached to the current row.
@Sneakr
Sneakr requested a review from danielhanchen as a code owner August 27, 2026 20:30
@shimmyshimmer

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 92db722e48

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen

Copy link
Copy Markdown
Member

The direction on the On Device selection and deletion fixes looks right, and I confirmed they land on the id mapping in selection-resolution.ts that main still has. Could you split those out from the removal of the Hub Run, Eject, Train and per-model configuration UI so the two can be reviewed separately?

Remove the selection identity and inventory-row transition fixes from the Hub cleanup diff so they can be reviewed independently. Keep the Run and per-model configuration cleanup unchanged.
@Sneakr

Sneakr commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

@danielhanchen per your request fab8251 removes the bug fixes and made a new PR into #9922 as well as one additional fix.

@Sneakr

Sneakr commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: fab8251c04

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen

Copy link
Copy Markdown
Member

Thanks for splitting the On Device fixes out into #9922, that makes both reviewable. As it stands this drops the Hub Run, Eject, Train and per-model configuration surfaces with nothing taking their place in tree, so could the replacement shared identity and configuration path land in the same branch rather than as a follow-up?

…-cleanup-scoped

# Conflicts:
#	studio/frontend/src/features/hub/catalog/gguf-download-card.tsx
#	studio/frontend/src/features/hub/catalog/hub-model-settings-view.tsx
#	studio/frontend/src/features/hub/hub-page.tsx
#	studio/frontend/src/features/hub/inventory/index.ts
#	tests/studio/test_model_picker_contracts.py
Load inactive cached Hub models from their resolved snapshot path while keeping the public repository ID as the configuration key, which avoids remote token validation for offline runs.

Route complete Hub-backed image and video models to their dedicated pages while preserving selected GGUF filenames and quantization variants.

Allow supported adapter models through Hub Run and mark their configuration handoff as LoRA so the loader keeps the correct model intent.

Add regression coverage for cached snapshot identity, media route eligibility, and adapter handoff metadata.
…-cleanup-scoped

# Conflicts:
#	studio/frontend/src/features/hub/lib/gguf-variant-sort.ts
#	studio/frontend/src/features/model-picker/components/model-selector.tsx
#	studio/frontend/src/features/model-picker/components/model-selector/model-row-menu.tsx
#	studio/frontend/src/features/model-picker/components/sidebar-model-config.tsx
@Sneakr

Sneakr commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for splitting the On Device fixes out into #9922, that makes both reviewable. As it stands this drops the Hub Run, Eject, Train and per-model configuration surfaces with nothing taking their place in tree, so could the replacement shared identity and configuration path land in the same branch rather than as a follow-up?

The Hub Run has been reintroduced with new code as requested.

@Sneakr

Sneakr commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

This comment was marked as resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 3e127344c6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…-cleanup-scoped

# Conflicts:
#	tests/studio/test_model_picker_contracts.py
@Sneakr Sneakr changed the title Clean up Hub runtime/config coupling and fix On Device partial-download state Clean up Hub runtime/config coupling Sep 7, 2026
resolveLocalGgufVariant walks selected -> active -> default with
ggufVariantsMatch. An absent candidate and an unparsed quant both
normalize to "", so they compare equal, and the find() returned the
quant-less file instead of the documented first-variant fallback
whenever nothing was selected, resident, or default.

Skip absent candidates so the fallback is reached. Previously this
predicate only ordered a list, where the case was harmless; it now
decides which artifact loads.
@shimmyshimmer

shimmyshimmer commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Updated in 72abd39 on top of ab88c05f1.

Fix

Blank preferences and blank GGUF variant keys compare equal in ggufVariantsMatch. The original resolver guard correctly skips blank preferences, but sortLocalGgufVariants could still promote a blank-key row when no default was set. Since the UI sorts before resolving, the resolver guard alone did not fix that path.

Sorting now prioritizes a default only when its key is nonblank. Resolution keeps the existing precedence: explicit selection, active variant, default variant, then the first ranked row. Blank-key rows remain eligible when they rank first on fit and size.

Scope

The current backend normally assigns unparsed filenames a nonempty key, such as unparsed for unparsed.gguf. These blank-key fixtures exercise defensive handling; they do not demonstrate that an ordinary unparsed filename currently produces an empty key. My earlier explanation overstated that production scenario.

Coverage

  • Combined sorting and selection with absent, null, blank, whitespace-only, and unmatched defaults.
  • Blank or unmatched selections preserving active and default preferences.
  • A blank-key row remaining eligible for the ranked fallback.
  • The new sorting regression fails before this follow-up and passes after it.

Verification

  • All 7,003 frontend tests pass.
  • npm run typecheck passes.
  • npm run build passes.
  • npm run bundle:check passes.

The PR description now reflects that Hub Run uses the shared model-picker configuration handoff.

@shimmyshimmer

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: ab88c05f15

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Only prioritize nonblank defaults so sorting and resolution use the same preference rules. Cover the combined sorting and selection path, resident and default precedence, and blank-key fallback eligibility.
@shimmyshimmer

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@shimmyshimmer

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 72abd39c46

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@shimmyshimmer shimmyshimmer left a comment

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.

Reviewed 72abd39 against merge base 132f115. I found one regression in the existing Chat picker that should be fixed before merging.

Validation: 34 focused tests passed. A separate source-level regression probe executed the base and head settings callbacks and the loader's persistence guard: the base records the cached repository as the last-used model; the head skips the record. This was not a live GPU inference test.

@shimmyshimmer shimmyshimmer left a comment

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.

The requested cached-model identity fix is addressed in 719f650. The settings callback preserves the public repository ID and exact snapshot load path. Six regression cases cover the callback and loader persistence guard. Local validation passed: 7,009 frontend tests, typecheck, production build, and bundle budget check.

@shimmyshimmer shimmyshimmer left a comment

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.

Second review completed at 719f650. I found no additional actionable regressions.

I rechecked the public ID versus snapshot-path handoff, remembered settings and last-used-model persistence, GGUF selection precedence, partial-download gates, cancellation and superseded status refreshes, configuration adoption, and Images/Video routing. The identity fix retains the exact loader path while restoring the public selection ID.

All 91 focused tests passed in this pass. The earlier 7,009-test run, typecheck, production build, and bundle budget check apply to this same unchanged commit. CI for this head is still running. No live GPU performance benchmark was performed.

@shimmyshimmer
shimmyshimmer merged commit 9dfb407 into unslothai:main Sep 8, 2026
36 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.

3 participants