Skip to content

Show concise NVFP4 inference errors - #7145

Merged
shimmyshimmer merged 3 commits into
mainfrom
agent/short-nvfp4-load-error
Jul 15, 2026
Merged

shimmyshimmer merged 3 commits into
mainfrom
agent/short-nvfp4-load-error

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Jul 15, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Replace verbose per-module MLX quantization metadata errors for NVFP4 validation and loading with a concise unsupported inference message.
  • Handle validation before the main chat flow reaches the load endpoint.
  • Handle both serialized backend exceptions and direct ValueError paths.
  • Preserve existing behavior for unrelated validation, load, and GPU-selection failures.
  • Add route-level regression coverage for Hub and native model flows.

Why

NVFP4 checkpoints can reach an unsupported MLX per-module quantization path that returns the full metadata blob to Studio. The chat flow validates a model before loading it, so both endpoints must replace this signature. The metadata is not actionable and overwhelms the error notification.

Before

Studio could display the complete per-module quantization metadata during validation or loading.

After

Failed NVFP4 validation and load requests with this signature show:

We are working on supporting NVFP4 inference. For now it is not supported

Other errors retain their existing status codes and details.

Safety

The replacement requires both nvfp4 and per-module MLX quantization metadata in the error, using case-insensitive matching. Network, authentication, download, disk, GPU-selection, GGUF, and other model errors remain on their existing paths.

Testing

  • Validation and load regression tests on Python 3.10, 3.11, 3.12, 3.13, and 3.14: 22 passed per version
  • Isolated uv matrix on Python 3.10 through 3.14: 40 passed per version
  • Fresh Linux ARM64 container: 40 passed
  • Fresh Linux AMD64 container: 40 passed
  • Existing validation error module: 12 passed
  • Existing chat-load module: 36 passed
  • Full existing GPU-selection module: 58 passed, plus 4 subtests
  • Frontend response contract, type checking, and production build passed
  • Ruff 0.15.12 and Python compilation checks passed

The simulation matrix covers validation and loading, generic exceptions, runtime errors, direct value errors, native and Hub models, mixed casing, long metadata, Windows and POSIX paths, unrelated failure signatures, HTTP response shape, and concurrent matching.

@shimmyshimmer
shimmyshimmer marked this pull request as ready for review July 15, 2026 13:50
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces handling for unsupported NVFP4 inference errors during model loading. It intercepts verbose MLX quantization metadata errors, logs a warning, and returns a user-friendly error message indicating that NVFP4 inference is not yet supported. Additionally, a new test suite has been added to verify this behavior and ensure unrelated load errors remain unaffected. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@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: 46ab34e4f0

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

raise HTTPException(status_code = 409, detail = str(e))
# Friendlier message for models Unsloth cannot load.
redacted_msg = redact_native_paths(str(e))
if _is_unsupported_nvfp4_inference_error(redacted_msg):

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 Handle NVFP4 validation errors too

This rewrite only runs in /load, but the main chat flow validates a selection before loading it (use-chat-model-runtime.ts calls /api/inference/validate before /load). validate_model runs the same ModelConfig.from_identifier(...) call and surfaces RuntimeError/ValueError via _maybe_unsupported_message; because the NVFP4 metadata error does not match the generic unsupported hints, the verbose metadata blob can still be returned during validation and the load path is never reached. Please apply the same NVFP4 rewrite in the validation exception path.

Useful? React with 👍 / 👎.

@shimmyshimmer shimmyshimmer changed the title Show concise NVFP4 inference load error Show concise NVFP4 inference errors Jul 15, 2026
@shimmyshimmer
shimmyshimmer merged commit d76953f into main Jul 15, 2026
47 of 48 checks passed
@shimmyshimmer
shimmyshimmer deleted the agent/short-nvfp4-load-error branch July 15, 2026 14:17
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