Skip to content

Studio: show why the NPU model list failed in the chat model picker - #18528

Merged
danielhanchen merged 6 commits into
unslothai:mainfrom
oobabooga:studio-npu-list-error
Nov 20, 2026
Merged

danielhanchen merged 6 commits into
unslothai:mainfrom
oobabooga:studio-npu-list-error

Conversation

@oobabooga

Copy link
Copy Markdown
Member

Problem: When the NPU model list fails, the chat model picker hides the whole NPU section and shows no message. A user with a working NPU just sees no NPU models. This happened on a Windows laptop where Smart App Control blocked lemond.exe.

Change: The picker keeps the NPU section and shows why the list failed. The backend no longer answers a bare "Internal Server Error" for three failures. When lemond cannot start or stops answering, it returns a readable error. An unreadable folder of converted models is skipped, and the list loads.

Status: Tested live on the AMD DevLab Strix Halo runners, Linux and Windows, against main.

Before and after

Why it happens

When GET /api/npu/models fails, the error is stored in listError. The Hub shows it, but the composer picker only draws the NPU notice before the runtime is ready. With no rows, the NPU section is dropped.

Three backend failures also reached the route as unhandled exceptions (HTTP 500):

Fix

  • composer-model-picker.tsx, npu-rows.ts: Discover shows the NPU notice when the runtime is not ready or the list failed (npuNoticeShown). The notice already renders listError.
  • npu_backend.py: both lemond failures become NpuError, so the route answers 409 with the message. A Windows code integrity refusal gets the existing code_integrity_user_message that llama-server uses, which names Smart App Control. An exit status of 0xC0000602 alone is reported as a crash, since an ordinary crash can also exit with it.
  • lemonade_server.py: keeps the exit status of a lemond that died during startup, read before Studio's own kill. One still running at the deadline is reported as a health check timeout.
  • npu_local_models.py: an unreadable folder is skipped with a warning. Files are checked with lstat(), so on Python 3.14 a denied file is not mistaken for a missing one.

Not changed

  • The On Device tab still shows no NPU notice when the list fails.
  • Smart App Control still blocks lemond.exe. This PR shows the block and names the fix.

Testing

Live on DevLab Strix Halo: main and main plus this PR side by side, NPU enabled on both.

Case main PR
Healthy list (Linux, Windows) 50 models 50 models
Unreadable scan folder (Linux) HTTP 500 50 models
lemond cannot be spawned (Linux, Windows) HTTP 500 HTTP 409, "Lemonade could not start (...): Permission denied / Access is denied"
lemond killed, list requested while it exits (Linux) HTTP 500 HTTP 409, "Listing NPU models failed: ... Connection refused"

The DevLab Windows runner has Smart App Control off, so the real refusal (winerror 4551, exit status 0xC0E90002) is covered by unit tests only.

New unit tests in test_npu_backend.py, test_npu_local_models.py and composer-npu-rows.test.ts cover each case above, the code integrity messages and the startup timeout. The backend tests fail on main. NPU backend tests: 554 passed, 1 skipped on Python 3.13; the two changed test files also pass on Python 3.14. Frontend typecheck and picker tests pass.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T14:24:36.593491Z ddb1611 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.

@oobabooga

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: 20b98cd44f

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

@LeoBorcherding

LeoBorcherding commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Tested on Strix Halo (Ubuntu 24.04, FastFlowLM 1.0.12, Lemonade 2026.44.1) at 20b98cd, with lemond made non-executable so the NPU model list fails (run).

  • Discover now shows the reason ("Lemonade could not start ... Permission denied"). On main it shows nothing.
  • On Device still says "No models on this device" with three NPU models downloaded. Could the notice show there too?

Picker with the NPU list failing (left: main, then this PR on Discover and On Device):

picker

How this relates to #18549. Both PRs show the NPU list error in the picker on Discover. They cover different backend failures:

Picking and loading an NPU model still works on this PR at 20b98cd: 4/4 entry points (new-chat picker, in-chat switch, fresh download from Discover, Hub Run) loaded the model, same as main (run).

Not tested on a real Windows Smart App Control block.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: ddb1611706

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

[skip ci]
@danielhanchen
danielhanchen merged commit 83822e4 into unslothai:main Nov 20, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

3 similar comments
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

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