Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: point compressed-tensors, AWQ and GPTQ models to the vLLM engine (#13043)
Daniel Hand94ca0ee6b54
diff --git a/studio/backend/routes/inference.py b/studio/backend/routes/inference.pyindex 1f5a03899cf..921376ca191 100644--- a/studio/backend/routes/inference.py+++ b/studio/backend/routes/inference.py@@ -16774,6 +16774,22 @@ _COMPRESSED_TENSORS_INFERENCE_UNSUPPORTED_MESSAGE = ("build of this model instead.")+# The optional vLLM engine loads compressed-tensors checkpoints (#11728); said only where it can run.+_COMPRESSED_TENSORS_VLLM_HINT = (+ " Or run it with vLLM: open this model's run settings and set Inference engine to vLLM."+)+++def _vllm_engine_hint(engine: Optional[str]) -> str:+ """Empty unless this host can run vLLM; ``wait = False`` keeps the GPU probe off this path."""+ if engine not in (None, "auto"):+ return ""+ try:+ from core.inference.engine_install import support_reason+ return _COMPRESSED_TENSORS_VLLM_HINT if support_reason("vllm", wait = False) is None else ""+ except Exception:+ return ""+def _diagnosis_text(msg: str) -> str:"""``msg`` up to the startup-diagnostics block, which is not ours to read.@@ -16818,7 +16834,7 @@ def _is_missing_compressed_tensors_error(msg: str) -> bool:return any(sig in lower_msg for sig in _MISSING_COMPRESSED_TENSORS_SIGNATURES)-def _unsupported_quantization_detail(msg: str) -> Optional[str]:+def _unsupported_quantization_detail(msg: str, engine: Optional[str] = None) -> Optional[str]:"""The refusal to show for ``msg``, or None when it is not about quantization.One place to add a signature to, so load, native load and validate cannot drift.@@ -16826,7 +16842,7 @@ def _unsupported_quantization_detail(msg: str) -> Optional[str]:if _is_unsupported_nvfp4_inference_error(msg):return _NVFP4_INFERENCE_UNSUPPORTED_MESSAGEif _is_missing_compressed_tensors_error(msg):- return _COMPRESSED_TENSORS_INFERENCE_UNSUPPORTED_MESSAGE+ return _COMPRESSED_TENSORS_INFERENCE_UNSUPPORTED_MESSAGE + _vllm_engine_hint(engine)return None@@ -19389,7 +19405,9 @@ async def _load_model_impl(raiseexcept ValueError as e:redacted_msg = redact_native_paths(str(e))- _unsupported_quantization = _unsupported_quantization_detail(redacted_msg)+ _unsupported_quantization = _unsupported_quantization_detail(+ redacted_msg, getattr(request, "engine", None)+ )if _unsupported_quantization is not None:logger.warning("Unsupported quantization while loading '%s': %s",@@ -19439,7 +19457,9 @@ async def _load_model_impl(raise HTTPException(status_code = 400, detail = HUB_TOKEN_REJECTED_ERROR)# Friendlier message for models Unsloth cannot load.redacted_msg = redact_native_paths(str(e))- _unsupported_quantization = _unsupported_quantization_detail(redacted_msg)+ _unsupported_quantization = _unsupported_quantization_detail(+ redacted_msg, getattr(request, "engine", None)+ )if _unsupported_quantization is not None:logger.warning("Unsupported quantization while loading '%s': %s",@@ -20093,7 +20113,9 @@ async def validate_model("Check the name, or add a token with access to it in Settings."),)- _unsupported_quantization = _unsupported_quantization_detail(redacted_msg)+ _unsupported_quantization = _unsupported_quantization_detail(+ redacted_msg, getattr(request, "engine", None)+ )if _unsupported_quantization is not None:logger.warning("Unsupported quantization while validating '%s': %s",diff --git a/studio/backend/tests/test_compressed_tensors_load_error_message.py b/studio/backend/tests/test_compressed_tensors_load_error_message.pyindex 68716f1665b..8e324b5b536 100644--- a/studio/backend/tests/test_compressed_tensors_load_error_message.py+++ b/studio/backend/tests/test_compressed_tensors_load_error_message.py@@ -55,6 +55,19 @@ REFUSALS = {}+VLLM_HINT = " Or run it with vLLM: open this model's run settings and set Inference engine to vLLM."++[email protected](autouse = True)+def _host_without_vllm():+ """The hint depends on the GPU; pin "no vLLM" so results do not depend on the machine."""+ with patch(+ "core.inference.engine_install.support_reason",+ return_value = "Requires an NVIDIA GPU with compute capability 8.0 or newer.",+ ):+ yield++def _load_route_module():spec = importlib.util.spec_from_file_location("inference_route_compressed_tensors_error",@@ -318,3 +331,61 @@ def test_the_refusal_names_no_quantization_scheme():assert "bitsandbytes 4-bit" in refusalassert "NVFP4" in inference_route._NVFP4_INFERENCE_UNSUPPORTED_MESSAGE++[email protected]("message", REFUSALS.values(), ids = list(REFUSALS))[email protected]("native", [False, True])+def test_a_host_that_can_run_vllm_is_pointed_at_it(message, native):+ with patch("core.inference.engine_install.support_reason", return_value = None):+ load_error = _load_failure(message, native = native)+ validate_error = _validation_failure(message, native = native)++ assert load_error.status_code == 500+ assert load_error.detail == EXPECTED + VLLM_HINT+ assert validate_error.status_code == 400+ assert validate_error.detail == EXPECTED + VLLM_HINT+ assert "pip install" not in load_error.detail+++ "reason",+ [+ "Checking for a supported NVIDIA GPU.",+ "Managed engines currently require Linux x86_64 or Windows x64.",+ RuntimeError("probe failed"),+ ],+ ids = ["probe-pending", "unsupported-host", "probe-raises"],+)+def test_no_hint_unless_this_host_can_run_vllm(reason):+ inference_route = _load_route_module()+ kwargs = {"side_effect": reason} if isinstance(reason, Exception) else {"return_value": reason}+ with patch("core.inference.engine_install.support_reason", **kwargs):+ assert inference_route._unsupported_quantization_detail(CONFIG_IMPORT_ERROR) == EXPECTED++[email protected]("engine", ["vllm", "sglang"])+def test_no_hint_when_the_request_already_chose_an_optional_engine(engine):+ inference_route = _load_route_module()+ with patch("core.inference.engine_install.support_reason", return_value = None):+ assert (+ inference_route._unsupported_quantization_detail(CONFIG_IMPORT_ERROR, engine)+ == EXPECTED+ )+ assert (+ inference_route._unsupported_quantization_detail(CONFIG_IMPORT_ERROR, "auto")+ == EXPECTED + VLLM_HINT+ )+++def test_the_vllm_hint_never_touches_other_refusals():+ inference_route = _load_route_module()+ with patch("core.inference.engine_install.support_reason", return_value = None):+ assert (+ inference_route._unsupported_quantization_detail(+ "Unsloth: 'x' has per-module MLX quantization metadata {'format': 'nvfp4-pack-quantized'}"+ )+ == inference_route._NVFP4_INFERENCE_UNSUPPORTED_MESSAGE+ )+ assert (+ inference_route._unsupported_quantization_detail("Network connection timed out") is None+ )diff --git a/studio/frontend/src/features/hub/catalog/model-card.tsx b/studio/frontend/src/features/hub/catalog/model-card.tsxindex c10754a1e56..918c7100e0b 100644--- a/studio/frontend/src/features/hub/catalog/model-card.tsx+++ b/studio/frontend/src/features/hub/catalog/model-card.tsx@@ -1,6 +1,7 @@// SPDX-License-Identifier: AGPL-3.0-only// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0+import { useVllmAvailable } from "@/features/model-picker";import {Tooltip,TooltipContent,@@ -239,6 +240,7 @@ export const ModelCard = memo(function ModelCard({isDataset: boolean;onSelect: (id: string) => void;}) {+ const vllmAvailable = useVllmAvailable();const support = useMemo(() =>isDataset@@ -250,8 +252,9 @@ export const ModelCard = memo(function ModelCard({libraryName: row.result.libraryName,deviceType,quantMethod: row.result.quantMethod,+ vllmAvailable,}),- [isDataset, row.id, row.result, deviceType],+ [isDataset, row.id, row.result, deviceType, vllmAvailable],);const unsupported = support?.status === "unsupported" && !support?.supportedIn;const partial = row.isAvailableOnDevice && row.isPartialOnDevice;diff --git a/studio/frontend/src/features/hub/catalog/model-inspector.tsx b/studio/frontend/src/features/hub/catalog/model-inspector.tsxindex fe67d3bdf5c..f894e1eca4d 100644--- a/studio/frontend/src/features/hub/catalog/model-inspector.tsx+++ b/studio/frontend/src/features/hub/catalog/model-inspector.tsx@@ -1,6 +1,7 @@// SPDX-License-Identifier: AGPL-3.0-only// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0+import { useVllmAvailable } from "@/features/model-picker";import { useHfEndpoint, useHubName } from "@/lib/hf-endpoint";import {Tooltip,@@ -289,11 +290,12 @@ function ModelStatusChips({!isDataset &&unslothSupport.status === "unsupported" &&!unslothSupport.supportedIn;+ const showVllm = !isDataset && unslothSupport.supportedIn === "vllm";// The format-unsupported chip already explains itself; this one covers the// supported-format model a chat-only host still can't run.- const showChatOnly = !isDataset && !isGguf && chatOnly && !showUnsupported;+ const showChatOnly = !isDataset && !isGguf && chatOnly && !showUnsupported && !showVllm;const showVram = !isDataset && vramInfo && !isGguf;- if (!showUnsupported && !showChatOnly && !showVram) return null;+ if (!showUnsupported && !showChatOnly && !showVram && !showVllm) return null;const vramTone = vramInfo? vramInfo.status === "exceeds"@@ -343,6 +345,29 @@ function ModelStatusChips({</TooltipContent></Tooltip>)}+ {showVllm && (+ <Tooltip>+ <TooltipTrigger asChild={true}>+ <span tabIndex={0} className="inline-flex outline-none">+ <StatusChip tone="warning" label="Requires vLLM" />+ </span>+ </TooltipTrigger>+ <TooltipContent+ side="bottom"+ sideOffset={6}+ className="tooltip-compact max-w-xs"+ >+ The default engine cannot load this format. After downloading, open+ it from the chat model picker and choose vLLM as the Inference+ engine in its run settings.+ {unslothSupport.reason && (+ <span className="mt-1 block text-ui-10p5 font-normal text-white/75">+ {unslothSupport.reason}+ </span>+ )}+ </TooltipContent>+ </Tooltip>+ )}{showChatOnly && (<Tooltip><TooltipTrigger asChild={true}>@@ -485,6 +510,7 @@ export const ModelInspector = memo(function ModelInspector({const supportTagsKey = model?.tags?.join("\0") ?? "";const supportLibraryName = model?.libraryName;const supportQuantMethod = model?.quantMethod;+ const vllmAvailable = useVllmAvailable();const unslothSupport = useMemo<UnslothSupport>(() => {return classifyUnslothSupport({modelId: supportModelId,@@ -493,8 +519,10 @@ export const ModelInspector = memo(function ModelInspector({libraryName: supportLibraryName,deviceType,quantMethod: supportQuantMethod,+ vllmAvailable,});}, [+ vllmAvailable,deviceType,supportLibraryName,supportModelId,diff --git a/studio/frontend/src/features/hub/catalog/models-catalog-rows.tsx b/studio/frontend/src/features/hub/catalog/models-catalog-rows.tsxindex ea845025c28..6aa080e42a5 100644--- a/studio/frontend/src/features/hub/catalog/models-catalog-rows.tsx+++ b/studio/frontend/src/features/hub/catalog/models-catalog-rows.tsx@@ -1,6 +1,7 @@// SPDX-License-Identifier: AGPL-3.0-only// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0+import { useVllmAvailable } from "@/features/model-picker";import { isChatGgufTask, reconcileGgufPinsAfterDelete } from "@/features/model-picker/components/model-selector/reconcile-gguf-pins";import {@@ -454,6 +455,7 @@ export const DiscoverModelRow = memo(function DiscoverModelRow({isDataset: boolean;onSelect: (id: string) => void;}) {+ const vllmAvailable = useVllmAvailable();const support = useMemo(() =>isDataset@@ -465,8 +467,9 @@ export const DiscoverModelRow = memo(function DiscoverModelRow({libraryName: row.result.libraryName,deviceType,quantMethod: row.result.quantMethod,+ vllmAvailable,}),- [isDataset, row.id, row.result, deviceType],+ [isDataset, row.id, row.result, deviceType, vllmAvailable],);const unsupported = support?.status === "unsupported" && !support?.supportedIn;const handleClick = useCallback(() => onSelect(row.id), [onSelect, row.id]);@@ -585,6 +588,7 @@ export const InventoryRow = memo(function InventoryRow({? row.repoId: (row.repoId ?? row.baseModelHubId ?? row.baseModel ?? row.loadId);const rowTagsSignature = row.tags?.join("\u0001") ?? "";+ const vllmAvailable = useVllmAvailable();const unsupported = useMemo(() => {if (isDataset) return false;const classified = classifyUnslothSupport({@@ -594,6 +598,7 @@ export const InventoryRow = memo(function InventoryRow({libraryName: row.libraryName,quantMethod: row.quantMethod,deviceType,+ vllmAvailable,});// Images/Video run these, so they are not unsupported to a user.return classified.status === "unsupported" && !classified.supportedIn;@@ -605,6 +610,7 @@ export const InventoryRow = memo(function InventoryRow({row.libraryName,row.quantMethod,deviceType,+ vllmAvailable,]);const handleClick = useCallback(() => onSelect(row.id), [onSelect, row.id]);const title = row.kind === "cache" ? row.repo : row.title;diff --git a/studio/frontend/src/features/hub/catalog/models-table.tsx b/studio/frontend/src/features/hub/catalog/models-table.tsxindex fdd2a99c5d8..5917bba9bfa 100644--- a/studio/frontend/src/features/hub/catalog/models-table.tsx+++ b/studio/frontend/src/features/hub/catalog/models-table.tsx@@ -1,6 +1,7 @@// SPDX-License-Identifier: AGPL-3.0-only// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0+import { useVllmAvailable } from "@/features/model-picker";import { useHfEndpoint, useHubName } from "@/lib/hf-endpoint";import {DropdownMenu,@@ -572,6 +573,7 @@ function useResultRowModel(deviceType: string | null,isDataset: boolean,) {+ const vllmAvailable = useVllmAvailable();const support = useMemo(() =>isDataset@@ -583,8 +585,9 @@ function useResultRowModel(libraryName: row.result.libraryName,deviceType,quantMethod: row.result.quantMethod,+ vllmAvailable,}),- [isDataset, row.id, row.result, deviceType],+ [isDataset, row.id, row.result, deviceType, vllmAvailable],);const sizeLabel = formatModelParamLabel(row.repo, row.result.totalParams);const taskLabel = isDatasetdiff --git a/studio/frontend/src/features/hub/lib/unsloth-support.ts b/studio/frontend/src/features/hub/lib/unsloth-support.tsindex 46cfae6c6d4..a74ebe8a676 100644--- a/studio/frontend/src/features/hub/lib/unsloth-support.ts+++ b/studio/frontend/src/features/hub/lib/unsloth-support.ts@@ -125,10 +125,19 @@ export type UnslothSupportStatus = "supported" | "unsupported";export interface UnslothSupport {status: UnslothSupportStatus;reason: string | null;- /** Set when Unsloth runs this model on a dedicated page rather than in chat. The status stays "unsupported" because the chat pickers gate on it, but the UI must not call it unsupported: the Images and Video pages load it. */- supportedIn?: "images" | "video";+ /** Set when Unsloth runs this model on a dedicated page rather than in chat. The status stays "unsupported" because the chat pickers gate on it, but the UI must not call it unsupported: the Images and Video pages load it. "vllm": only the optional vLLM engine can (#11728). */+ supportedIn?: "images" | "video" | "vllm";}+const VLLM_QUANT_METHODS: ReadonlySet<string> = new Set([+ "compressed-tensors",+ "awq",+ "gptq",+]);+const VLLM_FORMAT_KEYS: ReadonlySet<string> = new Set(["awq", "gptq"]);+// Chat only: vLLM refuses audio (_reject_unsupported_managed_kind); untagged repos count as chat.+const VLLM_CHAT_TASKS: ReadonlySet<string> = new Set(["text-generation", "image-text-to-text"]);+// Generation tasks the Images / Video pages handle. Mirrors IMAGE_GEN_TASKS and the video picker's tasks; image-to-video is included for LTX-2.3.const IMAGE_PAGE_TASKS: ReadonlySet<string> = new Set(["text-to-image",@@ -216,6 +225,7 @@ export function classifyUnslothSupport({libraryName,deviceType,quantMethod,+ vllmAvailable = false,}: {modelId?: string | null;pipelineTag?: string | null;@@ -223,6 +233,7 @@ export function classifyUnslothSupport({libraryName?: string | null;deviceType?: string | null;quantMethod?: string | null;+ vllmAvailable?: boolean;}): UnslothSupport {const pipeline = pipelineTag?.toLowerCase().trim() || null;const lowerTags = new Set(@@ -231,6 +242,7 @@ export function classifyUnslothSupport({const library = libraryName?.toLowerCase().trim() || null;const formatTags = excludedFormatTagsForDevice(deviceType);const normalizedQuant = normalizeQuantMethod(quantMethod);+ const vllmRuns = vllmAvailable && (!pipeline || VLLM_CHAT_TASKS.has(pipeline));// GGUF runs through llama.cpp regardless of the base model's quant config, so// the HF quant_method must not disqualify a GGUF repo.@@ -241,10 +253,15 @@ export function classifyUnslothSupport({if (normalizedQuant && !isGguf) {if (Object.hasOwn(UNSUPPORTED_QUANT_METHODS, normalizedQuant)) {- return {- status: "unsupported",- reason: `Detected ${UNSUPPORTED_QUANT_METHODS[normalizedQuant]}.`,- };+ const reason = `Detected ${UNSUPPORTED_QUANT_METHODS[normalizedQuant]}.`;+ // vLLM excuses only the quantization; any other rejection keeps the old answer.+ if (vllmRuns && VLLM_QUANT_METHODS.has(normalizedQuant)) {+ const rest = classifyUnslothSupport({ modelId, pipelineTag, tags, libraryName, deviceType, vllmAvailable });+ if (rest.status === "supported" || rest.supportedIn === "vllm") {+ return { status: "unsupported", reason, supportedIn: "vllm" };+ }+ }+ return { status: "unsupported", reason };}}@@ -273,10 +290,21 @@ export function classifyUnslothSupport({const formatKey = detectUnsupportedFormatKey(modelId, lowerTags, formatTags);if (formatKey) {const label = FORMAT_TAG_LABEL[formatKey] ?? `${formatKey.toUpperCase()} weights`;- return {- status: "unsupported",- reason: `Detected ${label}.`,- };+ const reason = `Detected ${label}.`;+ // AWQ / GPTQ must be the only format objection, else tag order would decide.+ if (+ vllmRuns &&+ !isGguf &&+ VLLM_FORMAT_KEYS.has(formatKey) &&+ !detectUnsupportedFormatKey(+ modelId,+ lowerTags,+ new Set([...formatTags].filter((tag) => !VLLM_FORMAT_KEYS.has(tag))),+ )+ ) {+ return { status: "unsupported", reason, supportedIn: "vllm" };+ }+ return { status: "unsupported", reason };}return { status: "supported", reason: null };}diff --git a/studio/frontend/src/features/model-picker/api/engines.ts b/studio/frontend/src/features/model-picker/api/engines.tsindex dbe2b2f753b..3dd39008865 100644--- a/studio/frontend/src/features/model-picker/api/engines.ts+++ b/studio/frontend/src/features/model-picker/api/engines.ts@@ -39,6 +39,12 @@ export function isEngineReady(engine: EngineStatus | undefined): boolean {);}+/** 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;+}+/** A retained INT4 / INT8 the newly picked engine cannot convert would fail only after unloading. */export function precisionAfterEngineSwitch<P extends string>(precision: P,diff --git a/studio/frontend/src/features/model-picker/hooks/use-vllm-available.ts b/studio/frontend/src/features/model-picker/hooks/use-vllm-available.tsnew file mode 100644index 00000000000..64a4b1fd018--- /dev/null+++ b/studio/frontend/src/features/model-picker/hooks/use-vllm-available.ts@@ -0,0 +1,65 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved.++import { useSyncExternalStore } from "react";+import { listEngines, vllmHostSupported } from "../api/engines";++// One read shared by every hub row; "Checking..." (GPU probe, up to a minute) and failed reads are retried.+let available = false;+let started = false;+let retries = 0;+let latest = 0;+const listeners = new Set<() => void>();++function publish(next: boolean) {+ if (next === available) return;+ available = next;+ for (const listener of listeners) listener();+}++function retry() {+ if (retries >= 24) return;+ retries += 1;+ setTimeout(() => void refresh(), 5000);+}++async function refresh() {+ const request = ++latest;+ try {+ const engines = await listEngines();+ if (request !== latest) return;+ publish(vllmHostSupported(engines));+ const vllm = engines.find((engine) => engine.engine === "vllm");+ if (vllm?.unsupported_reason?.startsWith("Checking")) retry();+ } catch {+ if (request === latest) retry();+ }+}++function subscribe(listener: () => void) {+ const first = listeners.size === 0;+ listeners.add(listener);+ if (!started) {+ started = true;+ window.addEventListener("studio-engines-changed", () => {+ retries = 0;+ void refresh();+ });+ }+ // Re-read whenever the hub opens again.+ if (first) {+ retries = 0;+ void refresh();+ }+ return () => {+ listeners.delete(listener);+ };+}++export function useVllmAvailable(): boolean {+ return useSyncExternalStore(+ subscribe,+ () => available,+ () => false,+ );+}diff --git a/studio/frontend/src/features/model-picker/index.ts b/studio/frontend/src/features/model-picker/index.tsindex cd435011635..5b9626cda1e 100644--- a/studio/frontend/src/features/model-picker/index.ts+++ b/studio/frontend/src/features/model-picker/index.ts@@ -36,6 +36,7 @@ export {type ApiModelOverrides,} from "./api/model-overrides";export { useActiveModelConfig } from "./hooks/use-active-model-config";+export { useVllmAvailable } from "./hooks/use-vllm-available";export type {DeletedModelRef,ExternalConnectionRef,diff --git a/studio/frontend/tests/unsloth-support-vllm.test.ts b/studio/frontend/tests/unsloth-support-vllm.test.tsnew file mode 100644index 00000000000..218f04b9fd2--- /dev/null+++ b/studio/frontend/tests/unsloth-support-vllm.test.ts@@ -0,0 +1,127 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0+import assert from "node:assert/strict";+import test from "node:test";+import { classifyUnslothSupport } from "../src/features/hub/lib/unsloth-support.ts";+import type { EngineStatus } from "../src/features/model-picker/api/engines.ts";+import { registerStoreStubResolver } from "./helpers/kit.ts";++registerStoreStubResolver();+const { vllmHostSupported } = await import("../src/features/model-picker/api/engines.ts");++// #11728: status stays "unsupported" (Default engine, training); supportedIn "vllm" only relabels the hub.+const NVFP4 = {+ modelId: "unsloth/Qwen3.8-27B-NVFP4",+ tags: ["safetensors", "qwen3_5", "unsloth", "compressed-tensors"],+ quantMethod: "compressed-tensors",+ deviceType: "cuda",+};++test("without vLLM every caller sees exactly what it saw before", () => {+ for (const vllmAvailable of [undefined, false]) {+ assert.deepEqual(classifyUnslothSupport({ ...NVFP4, vllmAvailable }), {+ status: "unsupported",+ reason: "Detected compressed-tensors quantization.",+ });+ assert.deepEqual(+ classifyUnslothSupport({ modelId: "TheBloke/Llama-2-7B-AWQ", tags: ["awq"], deviceType: "cuda", vllmAvailable }),+ { status: "unsupported", reason: "Detected AWQ quantization." },+ );+ }+});++test("with vLLM, compressed-tensors, AWQ and GPTQ are marked as vLLM-runnable", () => {+ assert.deepEqual(classifyUnslothSupport({ ...NVFP4, vllmAvailable: true }), {+ status: "unsupported",+ reason: "Detected compressed-tensors quantization.",+ supportedIn: "vllm",+ });+ for (const pipelineTag of ["text-generation", "image-text-to-text"]) {+ assert.equal(classifyUnslothSupport({ ...NVFP4, pipelineTag, vllmAvailable: true }).supportedIn, "vllm", pipelineTag);+ }+ for (const quantMethod of ["awq", "GPTQ", " compressed-tensors "]) {+ const support = classifyUnslothSupport({ modelId: "owner/model", quantMethod, deviceType: "cuda", vllmAvailable: true });+ assert.equal(support.status, "unsupported");+ assert.equal(support.supportedIn, "vllm", quantMethod);+ }+ for (const input of [+ { modelId: "owner/model", tags: ["gptq"] },+ { modelId: "owner/model", tags: ["auto-gptq"] },+ { modelId: "TheBloke/Llama-2-7B-AWQ" },+ ]) {+ assert.equal(classifyUnslothSupport({ ...input, deviceType: "cuda", vllmAvailable: true }).supportedIn, "vllm");+ }+});++test("vLLM does not excuse any other reason a model cannot run in chat", () => {+ for (const quantMethod of ["hqq", "exl2", "aqlm", "quark"]) {+ assert.equal(+ classifyUnslothSupport({ modelId: "owner/model", quantMethod, deviceType: "cuda", vllmAvailable: true }).supportedIn,+ undefined,+ quantMethod,+ );+ }+ for (const extra of [+ { pipelineTag: "text-to-image" },+ { pipelineTag: "automatic-speech-recognition" },+ { pipelineTag: "text-to-speech" },+ { pipelineTag: "feature-extraction" },+ { pipelineTag: "sentence-similarity" },+ { pipelineTag: "text-classification" },+ { tags: ["onnx"] },+ { tags: ["diffusers"] },+ { modelId: "owner/model-exl2" },+ ]) {+ assert.deepEqual(+ classifyUnslothSupport({ ...NVFP4, ...extra, vllmAvailable: true }),+ classifyUnslothSupport({ ...NVFP4, ...extra }),+ JSON.stringify(extra),+ );+ }+ assert.deepEqual(+ classifyUnslothSupport({ modelId: "unsloth/Qwen3.8-27B-GGUF", tags: ["gguf"], quantMethod: "compressed-tensors", deviceType: "cuda", vllmAvailable: true }),+ { status: "supported", reason: null },+ );+ assert.deepEqual(+ classifyUnslothSupport({ modelId: "unsloth/Qwen3.8-27B", tags: ["safetensors"], deviceType: "cuda", vllmAvailable: true }),+ { status: "supported", reason: null },+ );+});++function engine(overrides: Partial<EngineStatus>): EngineStatus {+ return {+ engine: "vllm",+ version: "0.30.0",+ installed_version: null,+ installed: false,+ in_use: false,+ current: false,+ can_rollback: false,+ unsupported_reason: null,+ job: { state: "idle", phase: null, message: "" },+ ...overrides,+ };+}++test("a host counts once the backend says vLLM can run there, installed or not", () => {+ assert.equal(vllmHostSupported([engine({})]), true);+ assert.equal(vllmHostSupported([engine({ installed: true, installed_version: "0.30.0", current: true })]), true);+ assert.equal(vllmHostSupported([engine({ unsupported_reason: "Checking for a supported NVIDIA GPU." })]), false);+ assert.equal(vllmHostSupported([engine({ unsupported_reason: "Managed engines currently require Linux x86_64 or Windows x64." })]), false);+ assert.equal(vllmHostSupported([engine({ engine: "sglang" })]), false);+ assert.equal(vllmHostSupported([]), false);+});++test("the vLLM label for AWQ / GPTQ tags does not depend on tag order or GGUF names", () => {+ for (const tags of [["awq", "mlx"], ["mlx", "awq"], ["gptq", "onnx"]]) {+ assert.deepEqual(+ classifyUnslothSupport({ modelId: "owner/model", tags, deviceType: "cuda", vllmAvailable: true }),+ classifyUnslothSupport({ modelId: "owner/model", tags, deviceType: "cuda" }),+ JSON.stringify(tags),+ );+ }+ assert.equal(+ classifyUnslothSupport({ modelId: "owner/Llama-3-8B-AWQ-GGUF", deviceType: "cuda", vllmAvailable: true }).supportedIn,+ undefined,+ );+});