Skip to content

Studio: point compressed-tensors, AWQ and GPTQ models to the vLLM engine - #13043

Merged
danielhanchen merged 9 commits into
mainfrom
studio-vllm-hint-compressed-tensors
Oct 8, 2026
Merged

danielhanchen merged 9 commits into
mainfrom
studio-vllm-hint-compressed-tensors

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Fixes #11728.

unsloth/Qwen3.8-27B-NVFP4 is a compressed-tensors checkpoint (NVFP4 MLP weights, FP8 attention and lm_head). Studio's Default engine cannot load it, but the optional vLLM engine added in #11491 (Windows via WSL2 in #12024 and #12750) loads and runs it. I checked this end to end on a B200 with Studio main: Run settings > Inference engine > vLLM > Install and load, then chat answers correctly.

The problem is that Studio never tells the user this:

  1. Loading on the Default engine fails with "Try a GGUF or a bitsandbytes 4-bit build of this model instead." and never mentions vLLM.
  2. The Model hub marks compressed-tensors, AWQ and GPTQ repos "May not be supported", even on a machine that can run vLLM.

Changes

Both changes only apply where the backend's own support_reason("vllm") says this machine can run vLLM (installed or not). Everywhere else (Mac, CPU, AMD, older NVIDIA, a pending GPU probe, or any failure reading engine status) the text and labels are exactly as before.

Backend (studio/backend/routes/inference.py)

  • The compressed-tensors refusal from the Default engine gains one sentence: "Or run it with vLLM: open this model's run settings and set Inference engine to vLLM."
  • No hint when the request already chose vLLM or SGLang. support_reason(..., wait = False) never probes the GPU inline, so the error path does not block.

Frontend

  • classifyUnslothSupport takes an optional vllmAvailable (default false, so every existing caller is unchanged). When set, compressed-tensors, AWQ and GPTQ (by quant_method, tag or repo name) return supportedIn: "vllm" for chat repos only (text-generation, image-text-to-text, or no pipeline tag), since Studio's vLLM path refuses audio, embedding and other non-chat models. status stays "unsupported", so the chat picker, the training picker and training validation behave exactly as before. Task, library and other format rejections (Images/Video pipelines, EXL2, MLX, ONNX, ...) still win.
  • useVllmAvailable(): one shared /api/engines read for the whole hub (not a poller per row), re-read each time the hub opens and on studio-engines-changed, and re-asked for about two minutes while the backend's first GPU probe is pending or a read fails (the last answer is kept on failure).
  • The hub card, row, table and inspector pass it in. They already hide the red label when supportedIn is set. The model page shows a "Requires vLLM" chip (in place of the red label and the "GGUF only" chip) whose tooltip gives the path: download, open it from the chat model picker, choose vLLM as the Inference engine in its run settings.

Not changed: no automatic engine switching, no install prompts, no change to which models the chat picker lists, and no change to training.

Testing

  • studio/backend/tests/test_compressed_tensors_load_error_message.py: 45 passed, including new cases for a vLLM-capable host (load and validate, Hub and native), a pending probe, an unsupported host, a failing check, and a request that already chose vLLM or SGLang. The new cases fail on main. The suite now pins the host to "no vLLM", so it no longer depends on the test machine's GPU.
  • studio/frontend/tests/unsloth-support-vllm.test.ts plus the existing support, training-support and engine-readiness suites: all pass. With vllmAvailable omitted the classifier output is identical to main.
  • Full frontend suite (npm test): 11021 passed, 0 failed. tsc -b passes; eslint reports no new problems on the touched files.
  • Classifier enumerated over 25,872 input combinations (quant method x tags x repo name x pipeline x device) against the merge base: identical in every cell without vLLM; with vLLM, 1,566 cells move and every one is a compressed-tensors, AWQ or GPTQ chat repo going from unsupported to unsupported plus supportedIn: "vllm" with the same reason. A repo rejected for anything else (image, video, audio or embedding task, diffusers, EXL2, ONNX, MLX, a GGUF repo named AWQ) keeps exactly its old answer, whatever order its tags come in.
  • Studio regression switchboard (auth, settings, model picker, upstream CI, inference settings, parallel chats, image generation, page crawl) on this head vs the merge base: no functional regression (62 same, 2 DOM-only, 2 screenshot diffs in the parallel-chat journeys where both sides got their replies).
  • Staging CI on this head: cross-platform (Linux, macOS, Windows) green.
  • Isolated Studio on a B200, base (8e2ab33) vs this branch, frontend rebuilt for each side:

Model page for unsloth/Qwen3.8-27B-NVFP4: the red "May not be supported" label (and the red dot on the result row) becomes "Requires vLLM".

NVFP4 model page, before and after

Same for an AWQ repo, Qwen/Qwen2.5-7B-Instruct-AWQ:

AWQ model page, before and after

Control: a plain safetensors checkpoint and the GGUF repo look identical on both sides:

Plain checkpoint control, before and after

Loading unsloth/Qwen3.8-27B-NVFP4 on the Default engine:

Default engine error, before and after

Choosing vLLM in the run settings then loads the model and answers correctly (checked before this change; this PR does not touch the vLLM load path).

The Default engine cannot load compressed-tensors checkpoints such as
unsloth/Qwen3.8-27B-NVFP4, but the optional vLLM engine can. On a host
that can run vLLM:

- The Default-engine refusal now says to set Inference engine to vLLM in
  the model's run settings. Hosts without vLLM support keep the same text.
- The model hub no longer labels compressed-tensors, AWQ and GPTQ repos
  "May not be supported"; the model page shows "Requires vLLM" instead.

Status stays unsupported, so chat pickers, training and engine selection
behave as before. Fixes #11728.
@danielhanchen danielhanchen self-assigned this Oct 8, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T14:41:49.739103Z 1c2a6a7 Manual request
🔒 Security Review ⚠️ Failed 2026-10-08T10:59:20.482474Z 4f9104f PR opened
ℹ️ 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.

A repo the hub rejects for another reason (an image or video task, a
library such as diffusers, an EXL2 or ONNX format) keeps exactly the
answer it had before; vLLM only excuses the quantization itself.
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 8, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 8, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 8, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 8, 2026
- Keep re-asking /api/engines for about two minutes while the backend's
  first GPU probe runs (it can take up to a minute), and keep the last
  answer when a read fails instead of dropping to false.
- AWQ / GPTQ found by tag or name only gets the vLLM label when no other
  format objection applies (so tag order no longer decides it) and never
  for a GGUF repo.
- The Requires vLLM tooltip names the real path: download, open it from
  the chat model picker, choose vLLM in its run settings.
The engine status was read once per session. Read it again whenever the
hub mounts its first subscriber, and drop a read that finishes after a
newer one.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@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: b8b9d204c6

ℹ️ 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 VLLM_QUANT_METHODS: ReadonlySet<string> = new Set([
"compressed-tensors",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Check the compression scheme before promising vLLM

On a host where the generic vLLM check passes, this treats every compressed-tensors checkpoint as runnable, but that quantization method is a container for schemes with different hardware requirements: for example, W8A8-FP8 requires compute capability 8.9 and W4A4 NVFP4 requires 10.0 in the official scheme matrix, while Studio declares vLLM host-supported starting at 8.0. Consequently, an A100 host will hide the unsupported warning for such models and the analogous backend hint will direct the user to vLLM, only for the model load to fail. Parse the checkpoint's compression scheme and compare its requirement with the selected GPU before setting supportedIn or emitting the hint.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not reproducible with the vLLM versions Studio installs (0.26.0 and 0.30.0): CompressedTensorsW4A4Fp4 (NVFP4) has get_min_capability 75, and W8A8 FP8 below 8.9 is served by CompressedTensorsW8A16Fp8 (min 75) in compressed_tensors.py, so NVFP4 and FP8 compressed-tensors load on compute capability 8.0 and up, which is the floor Studio already checks. Only W4A8-FP8 (min 90) needs more, and that scheme is rare enough to leave to vLLM's own load error.

Studio's vLLM engine refuses audio models, so a quantized speech
recognition or TTS repo keeps its old label.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 8, 2026

@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: 2a9e8dbe26

ℹ️ 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 library = libraryName?.toLowerCase().trim() || null;
const formatTags = excludedFormatTagsForDevice(deviceType);
const normalizedQuant = normalizeQuantMethod(quantMethod);
const vllmRuns = vllmAvailable && !(pipeline && AUDIO_TASK.test(pipeline));

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 Exclude LoRA adapters from vLLM relabeling

When a LoRA/QLoRA repository name contains an AWQ or GPTQ base marker (for example, owner/base-AWQ-LoRA), this gate permits the later format check to return supportedIn: "vllm" without considering the adapter kind. Studio's managed-engine path unconditionally rejects config.is_lora in _reject_unsupported_managed_kind (studio/backend/routes/inference.py:17890-17902), so the Hub hides the unsupported warning and recommends an engine that always returns 400 for that selection. Include adapter metadata/tags in the vLLM-specific gate before applying this relabeling.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Adapter repos carry no quantization_config, so this needs an adapter whose repo name happens to contain AWQ or GPTQ; picking vLLM there returns Studio's explicit LoRA refusal. Leaving that naming corner as is.

Comment on lines +44 to +45
const vllm = engines.find((engine) => engine.engine === "vllm");
return vllm !== undefined && vllm.unsupported_reason === null;

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 Require a usable engine for non-owner vLLM labels

For a non-owner on a capable host where vLLM is uninstalled, outdated, or currently being installed, this returns true solely because unsupported_reason is null, even though isEngineReady is false and the install/update controls are disabled for non-owners (inference-engines.tsx:90-138). The Hub therefore removes the unsupported warning and instructs that user to choose vLLM, but they cannot make the engine usable. Account ownership needs to be considered, or non-owners should receive the label only when vLLM is already ready.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The chip says the model requires vLLM, which stays true for a non-owner; choosing vLLM in run settings then shows them Ask the Studio owner to install this engine, which is the right next step. The label does not claim the engine is ready.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 8, 2026

@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: c611bc94df

ℹ️ 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 library = libraryName?.toLowerCase().trim() || null;
const formatTags = excludedFormatTagsForDevice(deviceType);
const normalizedQuant = normalizeQuantMethod(quantMethod);
const vllmRuns = vllmAvailable && !(pipeline && AUDIO_TASK.test(pipeline));

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 Use detected audio type when suppressing the vLLM label

The audio follow-up only checks pipelineTag, but cached/local inventory models independently carry audioType and may have a null or generic pipeline tag. For an AWQ/GPTQ/compressed-tensors TTS checkpoint in that state, this sets supportedIn: "vllm", hides the unsupported warning, and shows “Requires vLLM,” while _reject_unsupported_managed_kind rejects the same checkpoint from its detected config.is_audio with a 400. The fresh evidence after the prior fix is that the new gate never consumes the audioType already exposed by inventory, so it should also exclude detected non-audio_vlm audio models.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Needs a quantized speech checkpoint sitting in the local cache with no pipeline tag; Hub repos carry the task tag the gate reads, and picking vLLM for such a cached model still returns Studio's explicit audio refusal. Leaving that corner.

/** The backend says this host can run vLLM, installed or not. */
export function vllmHostSupported(engines: readonly EngineStatus[]): boolean {
const vllm = engines.find((engine) => engine.engine === "vllm");
return vllm !== undefined && vllm.unsupported_reason === null;

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 Respect GPU visibility before advertising vLLM

On a host where CUDA_VISIBLE_DEVICES is empty or exposes only unsupported GPUs while another physical NVIDIA GPU meets the requirement, /api/engines still reports unsupported_reason: null: engine_install.status calls support_reason without a GPU id, so it accepts any physical nvidia-smi row. This function consequently enables the vLLM relabeling even though managed_engine.validate_load resolves the parent-visible GPU set and either reports that no GPU can be assigned or rejects every visible GPU. Base availability on a GPU Studio can actually assign, otherwise the Hub hides the accurate unsupported warning and recommends an unusable engine.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The label deliberately follows the same /api/engines answer the run-settings engine picker already uses, so the hub and the picker agree. A host whose visible GPUs are masked away from the qualifying card gets validate_load's explicit GPU refusal when it picks vLLM. Not changing the engine status semantics in this PR.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Replace the audio exclusion with an allow list: untagged repos,
text-generation and image-text-to-text. Embedding, classification and
audio checkpoints keep their old label.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 8, 2026

@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: 1c2a6a7147

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

return _NVFP4_INFERENCE_UNSUPPORTED_MESSAGE
if _is_missing_compressed_tensors_error(msg):
return _COMPRESSED_TENSORS_INFERENCE_UNSUPPORTED_MESSAGE
return _COMPRESSED_TENSORS_INFERENCE_UNSUPPORTED_MESSAGE + _vllm_engine_hint(engine)

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 Gate the backend vLLM hint on the model kind

When a compressed-tensors TTS/audio checkpoint fails on the Default engine with one of these matched import errors, this unconditionally appends the vLLM instruction on every vLLM-capable host. Following that instruction cannot work because _reject_unsupported_managed_kind rejects every config.is_audio checkpoint before managed-engine loading. The frontend task allow-list does not cover this independent backend error path, so the hint should be suppressed when the failed model is a kind the managed engine refuses.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This refusal is raised while transformers builds the config (ModelConfig.from_identifier), before Studio knows whether the checkpoint is audio, so there is no model kind to gate on at that point. Compressed-tensors speech checkpoints are rare, and choosing vLLM for one returns Studio's explicit audio refusal. Leaving it.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 8, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 8, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 8, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@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: 1c2a6a7147

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

/** The backend says this host can run vLLM, installed or not. */
export function vllmHostSupported(engines: readonly EngineStatus[]): boolean {
const vllm = engines.find((engine) => engine.engine === "vllm");
return vllm !== undefined && vllm.unsupported_reason === null;

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 Keep vLLM models selectable on chat-only hosts

On a host with a supported NVIDIA GPU/driver but no usable Studio PyTorch installation, /api/engines can report vLLM as supported while the platform is in chat-only mode, so this enables the “Requires vLLM” label. However, the chat picker unconditionally removes every cached non-GGUF model in that mode (pickers.tsx:4705-4707), and the Hub's own Run action is also disabled for unsupported models, leaving no way to follow the tooltip's instruction to select vLLM after downloading an AWQ/GPTQ/compressed-tensors checkpoint. Either keep these vLLM-capable cached models visible in the picker or suppress the relabeling when the only advertised workflow is unreachable.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Chat-only mode on an NVIDIA host means Studio was installed GGUF-only (no PyTorch) or its PyTorch is broken; that is a rare, explicit setup, and the label stays accurate (the model does need vLLM). Not adding a separate path for it here.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@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: 1c2a6a7147

ℹ️ 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 VLLM_FORMAT_KEYS: ReadonlySet<string> = new Set(["awq", "gptq"]);
// Chat tasks only: Studio's vLLM engine refuses audio (_reject_unsupported_managed_kind) and
// embeddings are not served through it. Untagged repos (unsloth/Qwen3.8-27B-NVFP4) are chat.
const VLLM_CHAT_TASKS: ReadonlySet<string> = new Set(["text-generation", "image-text-to-text"]);

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 Admit the other vision pipeline tags to vLLM

For quantized vision repositories whose Hugging Face task is image-to-text or visual-question-answering, this allow-list makes vllmRuns false, so AWQ/GPTQ/compressed-tensors models remain labeled “May not be supported” even on a vLLM-capable host. Both tasks are recognized as authoritative vision tasks elsewhere (features/model-picker/components/model-selector/model-capabilities.ts:17-26), and the managed engine explicitly supports vision checkpoints (studio/backend/routes/inference.py:17890-17901), so these pure vision tasks should receive the same supportedIn: "vllm" treatment as image-text-to-text.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The allow list is deliberately conservative: a repo outside it keeps exactly the label it has on main today, so nothing regresses. Widening it to image-to-text and visual-question-answering can come separately once those are checked against the managed engine.

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.

Qwen3.8-27B-NVFP4 Safetensors cannot be loaded in Unsloth Desktop

1 participant