Repository navigation
[Bug] AMD NPU: shared Hub ?npu= links only open their card when the format filter is already NPU, and the card's README can be newer than the installed files - #17525
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.
…d NPU cards A ?npu=<id> link only opened its card when the Hub's format filter was already NPU; on any other filter the row was never selected and the clearing effect dropped the param. The link now switches the current tab to NPU once, before the param can be cleared. FastFlowLM pins most repos by branch, and model_info.json's oids are per-file blob hashes rather than a commit, so a card read from main can be newer than the hash-checked files. Those cards now say so.
… one encode of a pinned revision
…nk-and-revision [skip ci]
|
@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: 4c1e406e48
ℹ️ 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".
| const npuListing = | ||
| showNpuCatalog && (!npuCatalog?.ready || npuModels === null); |
There was a problem hiding this comment.
Wait for catalog refresh before discarding an NPU link
When returning through browser history to an On Device NPU link after the target was downloaded in another client, the cached catalog row can still have downloaded: false. useNpuCatalog starts a refresh on activation but retains the cached array, so this expression reports that listing is finished and selectedNpu remains null. The cleanup effect consequently removes ?npu before the refresh completes; the subsequently updated row never opens its card. Track the active listing request and wait for it to finish before invalidating the link, rather than treating any non-null cached catalog as current.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing this: it needs the model downloaded from another client and then a history navigation back to a stale On Device list. The refresh that activation starts updates the row, and the link can be reopened.
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |
… the Hub (unslothai#17514) 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/models` doesn't say which Hugging Face repo a model comes from, so the Hub had nothing to open. FastFlowLM's `model_list.json` (beside the `flm` binary, already read for resumable downloads) names each model's Hugging Face repo, and for some a pinned revision such as `flm_q4k_high_precision`. The NPU catalog now returns `hf_repo` and `hf_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 in `test_npu_backend.py` (run under WSL), API typing and helpers in `npu-api.test.ts`, README revision fetching in `hub-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 3 `3669e68`. This PR's head `0b15229` is part of `3669e68`. 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 unslothai#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.  --------- Co-authored-by: Daniel Han <[email protected]>
Stacks on #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.jsonpins repos by branch (main, or a named branch), andmodel_info.jsononly 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 inhub-page.tsx.npu-api.test.ts: the README note formain, a named branch, a commit SHA and no repo. Both fail on #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 33669e68. This PR's headba683c6is part of3669e68. Light mode, mint theme, glass on, same on both sides.Before | after:

hub?npu=qwen3.5-9b-FLMopened 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 (#17514 head), the link landed on the normal Hub.