Repository navigation
[Feature] AMD NPU: open the Hugging Face model card for NPU models in the Hub - #17514
Conversation
FastFlowLM's model_list.json names each model's Hugging Face repo (and, for some, a pinned revision). The NPU catalog now carries it as hf_repo / hf_revision, and the Hub's NPU list opens the same split detail pane GGUF models get: repo link, base model, size, capabilities, max context, the row's Download/Run/Delete, and the README at that revision.
|
Screenshots of this PR's change: Hub, NPU filter, qwen3.5-9b-FLM selected: the Hugging Face card for FastFlowLM/Qwen3.5-9B-NPU2 with NPU, Vision, Reasoning, Tools and the base model.
|
… one encode of a pinned revision
…nk-and-revision [skip ci]
…play-names # Conflicts: # studio/frontend/src/features/hub/catalog/npu-catalog-list.tsx # studio/frontend/src/features/hub/hub-page.tsx
|
@codex review |
1 similar comment
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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: 3869eb6049
ℹ️ 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".
| if (!urlNpu || selectedNpu || npuStatus === null || npuListing) return; | ||
| void navigate({ | ||
| to: "/hub", | ||
| search: (prev) => ({ ...prev, npu: undefined }), |
There was a problem hiding this comment.
Restore the NPU format before clearing a URL selection
When a valid /hub?npu=<model-id> URL is reloaded or opened directly, discoverFormat initializes to recommended and downloadedFormat to all; neither is restored from hubSearch.npu. Consequently, showNpuCatalog is false even on a supported, ready machine, and this effect deletes the selection as soon as NPU status resolves. The new URL-backed model-card selection therefore cannot survive a reload or reopen from a saved link. Restore the appropriate NPU format from the URL before treating the missing selection as evidence that the user left the NPU list.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Restoring the NPU format from ?npu is #17525's scope, which stacks on this PR and switches the format before deciding the selection is gone; this PR only makes the card selection URL-backed.
|
Codex Review: Didn't find any major issues. 👍 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". |
…ormat filter is already NPU, and the card's README can be newer than the installed files (unslothai#17525) Stacks on unslothai#17514 (merge that first; this branch includes its commit). A `?npu=<id>` Hub link only opened its model card when the Hub's format filter was already NPU. On any other filter the row was never selected and the cleanup effect dropped the param, so a shared link just landed on the normal Hub. The link now switches the current tab (Discover or On Device) to NPU once, before the param can be cleared. Closing the pane resets this, so the same link works again, and the link survives while the NPU runtime is still being set up. FastFlowLM's `model_list.json` pins repos by branch (`main`, or a named branch), and `model_info.json` only holds per-file blob hashes, not a commit. So the README fetched from Hugging Face can be newer than the hash-checked files on disk. Unless the revision is a full commit SHA, the card now says "Latest on Hugging Face (may be newer than the installed files)". ## Tests `hub-npu-format.test.ts`: the link-to-NPU switch helper, plus the effect ordering in `hub-page.tsx`. `npu-api.test.ts`: the README note for `main`, a named branch, a commit SHA and no repo. Both fail on unslothai#17514's head without this. Tested on Windows 11, Ryzen 9 9950X + 2x R9700, no NPU: frontend unit tests and typecheck. Not run on a Ryzen AI NPU. ## Screenshots NPU spoofed: fake Lemonade/FastFlowLM on a Windows 11 PC with no NPU; no speed numbers. Before | after: fork phase stack, phase 2 `945ba98` | phase 3 `3669e68`. This PR's head `ba683c6` is part of `3669e68`. Light mode, mint theme, glass on, same on both sides. Before | after: `hub?npu=qwen3.5-9b-FLM` opened on the Recommended filter switches to NPU and opens that card, with the "Latest on Hugging Face (may be newer than the installed files)" note; before, the link landed on the normal Hub.  Also checked by building Unsloth Studio from this PR's merge base (left) and head (right), on the same spoofed AMD NPU: Opening /hub?npu=qwen3.5-9b-FLM: the Hub switches to the NPU format and opens that model's card. Before (unslothai#17514 head), the link landed on the normal Hub.  --------- Co-authored-by: Daniel Han <[email protected]> Co-authored-by: Daniel Han <[email protected]>
… of the Lemonade ID (unslothai#17610) NPU models showed up under their Lemonade ID, e.g. `qwen3.6-moe-35b-a3b-FLM`, a name nobody searches for and that doesn't match anything on Hugging Face. They now show as their Hugging Face repo, `Qwen3.6-35B-A3B-NPU2`, the same name as on [FastFlowLM's HF page](https://huggingface.co/FastFlowLM). **Display only.** Model IDs, API calls, saved run settings and loaded-model state all still use the Lemonade ID. Searching the picker by the old ID still finds the model. Where the new name shows: - Model picker, NPU section, and the selected-model chip - Run settings header - Hub NPU list - Loaded-models list **Depends on unslothai#17514.** The HF repo comes from the `hf_repo` field that unslothai#17514 adds to the NPU catalog. Without it, every NPU model keeps its Lemonade ID, so this PR merges safely in either order. If listing the NPU catalog fails, names fall back to the Lemonade ID, and the lookup tries again after 30 s instead of staying stuck for the rest of the session. **Tests:** `npu-display-name.test.ts` (new) covers the name mapping, the fallback and the retry. `npu-api` and `npu-catalog-store` tests updated. `tsc --noEmit` clean. **Not tested here:** no Ryzen AI NPU on this machine. The new names on a real NPU get checked in the blog stills rerun on the AMD DevLab Strix Halo runner, once this is in the NPU stack. Screenshots will be added after that. ## Screenshots Before (left) and after (right), Unsloth Studio built from each side on the same spoofed AMD NPU. Model Hub, format NPU: rows read the Hugging Face model names with the FastFlowLM owner instead of Lemonade ids. Before is unslothai#17514 head.  --------- Co-authored-by: Daniel Han <[email protected]> Co-authored-by: Daniel Han <[email protected]>

In the Model Hub with the format set to NPU, FastFlowLM models were plain rows with no detail view, while GGUF models open a pane with the repo, base model, stats and README. Lemonade's
/v1/modelsdoesn't say which Hugging Face repo a model comes from, so the Hub had nothing to open.FastFlowLM's
model_list.json(beside theflmbinary, already read for resumable downloads) names each model's Hugging Face repo, and for some a pinned revision such asflm_q4k_high_precision. The NPU catalog now returnshf_repoandhf_revision, and clicking an NPU row opens the same split pane GGUF models use: the FastFlowLM repo with copy and open links, the base model from the card's metadata, size, Vision/Reasoning/Tools, max context, the row's Download / Run / Delete with progress, and the README at that revision. A model with no Hugging Face repo shows "No model card for this model." The selection lives in?npu=and closes when you leave the NPU list. GGUF behavior is unchanged.Not in scope: Q4NX exports made locally, which Unsloth Studio can't load yet.
Tests: URL parsing in
test_flm_files.py(bare repo,/resolve/<rev>, non-HF URL, missing file), catalog rows carrying the repo intest_npu_backend.py(run under WSL), API typing and helpers innpu-api.test.ts, README revision fetching inhub-readme-revision.test.ts. Typecheck clean.Screenshots were taken on a spoofed NPU on a Windows desktop, not real Ryzen AI hardware.
Screenshots
NPU spoofed: fake Lemonade/FastFlowLM on a Windows 11 PC with no NPU; no speed numbers. Before | after: fork phase stack, phase 2
945ba98| phase 33669e68. This PR's head0b15229is part of3669e68. Light mode, mint theme, glass on, same on both sides.Before | after: clicking an NPU model in the Hub opens its Hugging Face model card (FastFlowLM/Qwen3.5-4B-NPU2, base Qwen/Qwen3.5-4B); before, nothing opened. The "Latest on Hugging Face" note above the README is #17525.

Also checked by building Unsloth Studio from this PR's merge base (left) and head (right), on the same spoofed AMD NPU:
Model Hub, format NPU, clicking qwen3.5-9b-FLM: a detail pane opens with the FastFlowLM repo, base model, size, context and README. Before, the row opened nothing.