Repository navigation
Studio Hub: On Device filters and sort, Exports & Fine-tunes, unsloth.ai links - #14083
Conversation
… and cleanup buttons
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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", |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
| classified = _classify_local_path(path, "unsloth", display_name = name, updated_at = updated_at) | ||
| rows.extend(_apply_payload_partial(path, classified)) |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
| 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})) |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
Fixed in 13cffe6: classification runs inside the to_thread scan.
| const unslothModelInventory = useDeviceInventorySources( | ||
| UNSLOTH_MODEL_INVENTORY_SOURCE, | ||
| { | ||
| hfToken, | ||
| enabled: | ||
| enabled && !isDatasetMode && includeLocal && includeUnslothModels, |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
Fixed in 13cffe6: the Hub force-refreshes this source on each visit, so a finished run or export shows without a reload.
…rebalance the dialog
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
…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.
What changed
Model hub, On Device tab:
aria-labels.matchesHubCapability. This replaces the single-select type pill in the list header. On Device picks are kept apart from Discover's.GET /api/hub/unsloth-modelsreturns the training outputs and exports the Library already finds (scan_trained_models/scan_exported_models), classified like any local folder, with sourceunsloth. 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.confirmExternalLinkskips the warning forunsloth.aiand its subdomains over http(s), parsed withURLso look-alikes (unsloth.ai.evil.example,evil.example/unsloth.ai,[email protected]) still ask. Those links open through the sameopenLinkthe dialog uses, so Desktop still hands them to the system browser.How it was verified
npm run typecheck,npm test(12535 pass, 0 fail),npm run build,npm run bundle:checkinstudio/frontend.tests/hub-external-link-unsloth-site.test.ts(unsloth.ai and subdomains trusted, look-alikes and other schemes not).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) andstudio/backend/tests/test_hub_unsloth_models.py(an adapter run and a GGUF export come back asunsloth, nothing trained lists nothing, the source is redacted).test_openai_auto_switch.pythat fail the same way onmain.outputs/and a GGUF export inexports/: 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:
Exports & Fine-tunes picked: only the seeded LoRA run and GGUF export remain:
Sort dropdown:
Filter panel with Discover's capability tiles, next to the icon-only Add folder and Free up space buttons:
External link dialog after the change (a Hugging Face link; unsloth.ai README links now open with no dialog):
Not tested here
Training a real model on this CPU-only host; the seeded outputs stand in for one.