Skip to content

Studio Hub: On Device filters and sort, Exports & Fine-tunes, unsloth.ai links - #14083

Merged
shimmyshimmer merged 8 commits into
mainfrom
studio-hub-on-device-toolbar
Oct 17, 2026
Merged

shimmyshimmer merged 8 commits into
mainfrom
studio-hub-on-device-toolbar

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

What changed

Model hub, On Device tab:

  1. Add folder and Free up space are icon buttons, with their tooltips and aria-labels.
  2. Capabilities move into the Discover filter panel. The same tiles as Discover (Text only, Reasoning, Vision, Audio, Embeddings, Image gen, Video gen), multi-select, first pick isolates, matched with Discover's own matchesHubCapability. This replaces the single-select type pill in the list header. On Device picks are kept apart from Discover's.
  3. Format and sort are toolbar dropdowns, as on Discover. Format: All formats, GGUF, Safetensors, MLX (new on this tab), Exports & Fine-tunes (new; training runs and exports, including exports of base models that were never fine-tuned), and NPU when available. Sort: Recent, Name, Size, Format (new: GGUF, Safetensors, MLX, then adapters), moved out of the list header. Size now uses the size the local scan measures, so folder-based models sort by their real size instead of 0; ties fall back to name.
  4. Studio's own fine-tunes and exports are listed on device. A new GET /api/hub/unsloth-models returns the training outputs and exports the Library already finds (scan_trained_models / scan_exported_models), classified like any local folder, with source unsloth. Only the Hub asks for it, so the chat picker, agents tab and recipe selectors, which list fine-tunes their own way, are unchanged. The Exports & Fine-tunes format option shows just these rows. Their host paths are redacted for API-key callers like other local sources.
  5. External links to unsloth.ai open directly. confirmExternalLink skips the warning for unsloth.ai and its subdomains over http(s), parsed with URL so look-alikes (unsloth.ai.evil.example, evil.example/unsloth.ai, [email protected]) still ask. Those links open through the same openLink the dialog uses, so Desktop still hands them to the system browser.
  6. The external link dialog is rebalanced: a small icon beside the title instead of a 64 px circle beside three lines of text, the description at full width, and two equal-width buttons.

How it was verified

  • npm run typecheck, npm test (12535 pass, 0 fail), npm run build, npm run bundle:check in studio/frontend.
  • New tests/hub-external-link-unsloth-site.test.ts (unsloth.ai and subdomains trusted, look-alikes and other schemes not).
  • New tests/hub-on-device-filters.test.ts (capability matching on inventory rows, icon buttons, dropdowns with MLX and Exports & Fine-tunes, the source-based filter) and studio/backend/tests/test_hub_unsloth_models.py (an adapter run and a GGUF export come back as unsloth, nothing trained lists nothing, the source is redacted).
  • Backend tests touching local inventory and host-path redaction pass, except two failures in test_openai_auto_switch.py that fail the same way on main.
  • Isolated Studio from this branch with a seeded LoRA run in outputs/ and a GGUF export in exports/: both list on device, the Exports & Fine-tunes option shows only them, and the sort dropdown and capability panel work.

Screenshots

Format dropdown on On Device, with MLX and Exports & Fine-tunes:

Format dropdown

Exports & Fine-tunes picked: only the seeded LoRA run and GGUF export remain:

Exports and Fine-tunes filter

Sort dropdown:

Sort dropdown

Filter panel with Discover's capability tiles, next to the icon-only Add folder and Free up space buttons:

Filter panel

External link dialog after the change (a Hugging Face link; unsloth.ai README links now open with no dialog):

External link dialog

Not tested here

Training a real model on this CPU-only host; the seeded outputs stand in for one.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 17, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T21:38:35.864013Z 13cffe6 Manual request
🔒 Security Review ✅ Completed 2026-10-17T21:44:15.527863Z 13cffe6 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 17, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 17, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 17, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 480c81c13d

ℹ️ 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".

tab === "discover",
option.value === "unsloth"
? tab === "downloaded"
: option.value !== "recommended" || tab === "discover",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Match MLX inventory rows using their metadata

Selecting the newly exposed MLX option on On Device hides even installed MLX models. Both cached and local inventory builders normalize modelFormat to a union that excludes mlx, while matchesFormat(..., "mlx") only accepts that exact value. MLX rows instead carry library/tag metadata or the omlx source, which inventoryItemFormatRank already checks. Use those signals for inventory filtering as well, so this option can actually display MLX models.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 13cffe6: inventory rows go through inventoryRowFormat, which reads MLX from the library name, tags or oMLX source, so the MLX option lists them and Safetensors leaves them out.

Comment on lines +1476 to +1477
classified = _classify_local_path(path, "unsloth", display_name = name, updated_at = updated_at)
rows.extend(_apply_payload_partial(path, classified))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve all quantizations when listing GGUF exports

When a Studio export contains multiple GGUF quantizations, scan_exported_models returns only gguf_files[0], so classifying that file here produces one row with requires_variant=False and silently omits its siblings. Multiple quantizations are explicitly supported by ExportBackend.export_gguf, and local-on-device-card.tsx disables variant fetching for file paths, leaving the other exported quants inaccessible from this list. Scan the containing export directory or enumerate all its main GGUF variants rather than treating the Library's representative file as the complete inventory.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 13cffe6: a GGUF export is listed by its folder, so the row needs a variant pick and the card offers every quant in it.

Comment on lines +1492 to +1494
for model in models:
task, audio_type = catalog_classification._local_model_classification(model)
classified.append(model.model_copy(update = {"task": task, "audio_type": audio_type}))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Run export task classification off the event loop

When exported models need uncached metadata reads, this loop performs synchronous filesystem work directly in the async route: _local_model_classification reaches _gguf_path_task and the GGUF header reader for each exported GGUF. On slow storage or with many exports, the entire loop blocks other requests and streaming handled by the same event loop. The existing list_local_models_response explicitly offloads its classification with asyncio.to_thread for this reason; include this classification in the worker scan or offload the loop similarly.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 13cffe6: classification runs inside the to_thread scan.

Comment on lines +326 to +331
const unslothModelInventory = useDeviceInventorySources(
UNSLOTH_MODEL_INVENTORY_SOURCE,
{
hfToken,
enabled:
enabled && !isDatasetMode && includeLocal && includeUnslothModels,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Invalidate the new inventory source after training and export

If a user visits the Hub, then completes training or a local export and returns, this source reuses its previous rows rather than discovering the new model. fetchInventorySource returns cached rows indefinitely for an unchanged inventory-version key, and neither the training completion handlers nor the success path in export-runtime-store.ts bumps that version. With other installed models present, the empty-inventory refresh does not run either, so navigating back or selecting Exports & Fine-tunes leaves the new artifact absent until a reload or unrelated inventory mutation. Invalidate this source on training/export completion or explicitly revalidate it when entering the Hub.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 13cffe6: the Hub force-refreshes this source on each visit, so a finished run or export shows without a reload.

shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 17, 2026
@shimmyshimmer shimmyshimmer changed the title Studio Hub: On Device filters, sort and Exports & Fine-tunes Studio Hub: On Device filters and sort, Exports & Fine-tunes, unsloth.ai links Oct 17, 2026
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 17, 2026
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 8e800a50f3

ℹ️ 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".

…lassification, rescan on visit; natural-width dialog buttons
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 17, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 13cffe69a5

ℹ️ 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

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 13cffe69a5

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@shimmyshimmer
shimmyshimmer merged commit 2b0ad0c into main Oct 17, 2026
@shimmyshimmer
shimmyshimmer deleted the studio-hub-on-device-toolbar branch October 17, 2026 21:46
danielhanchen added a commit that referenced this pull request Oct 18, 2026
…pability picks (#14138)

## Summary

`Repo tests (CPU, studio)` fails on every PR whose base includes #14083,
with the same single test:

```
tests/studio/test_model_picker_contracts.py::test_diffusion_capability_labeled_image_video_gen
    assert '{ value: "diffusion", label: "Image/video gen" }' in _read("features/hub/lib/model-type-filter.ts")
```

Seen on #14097, #14106, #14112, #14115, #14122 and #14125 (bases
`72d0d2db`, `b4a4855e`, `4c5fb400`), and it reproduces on main at
`1e2cedde`.

## Cause

#14083 (Studio Hub: On Device filters and sort) moved the On Device list
onto Discover's capability picks, on purpose. `model-type-filter.ts` no
longer keeps its own `MODEL_TYPE_FILTER_OPTIONS` (which held `{ value:
"diffusion", label: "Image/video gen" }`). Its
`matchesInventoryCapabilities` now takes `HubCapabilityFilter` picks and
matches them with Discover's own `matchesHubCapability`, so the On
Device panel shows Discover's "Image gen" and "Video gen" tiles. The PR
describes this as change 2.

The product is right and the test is stale. What the test protects
(#11681) is that the diffusion capability is never presented as "Image
to text". That still holds: the only names now shown for it are
Discover's "Image gen" / "Video gen" options and the capability badge's
"Image gen" / "Video gen".

## Change

Test only, `test_diffusion_capability_labeled_image_video_gen`:

- **Kept as before:**
  - "Image to text" must not appear in the three hub files.
- Discover's options must be `{ value: "image-gen", label: "Image gen"
}` and `{ value: "video-gen", label: "Video gen" }`.
- **New:** the capability badge in `model-capabilities.ts` must name the
same two kinds.
- **Replaced** the literal from the deleted On Device list. Now, if
`model-type-filter.ts` has a `diffusion` option, it must still be
labeled "Image/video gen". Otherwise the file must match through
`matchesHubCapability`, so On Device cannot quietly grow a second,
unchecked set of names.

## Testing

- **This change:** `tests/studio/test_model_picker_contracts.py` gives
201 passed.
- **Before (main `1e2cedde`):** the same file gives 1 failed, 200
passed, the failure CI shows.
- **Each of these makes the test fail:**
  - Relabeling Discover's `image-gen` option "Image to text".
- Renaming `matchesHubCapability` out of `model-type-filter.ts`, so On
Device no longer shares Discover's matcher.
- Adding back an On Device `{ value: "diffusion", label: "Image to text"
}` option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant