Skip to content

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.

vLLM Windows CUDA support [tested] (#2158)

feng lui48cb9c724c76
diff --git a/unsloth/models/__init__.py b/unsloth/models/__init__.py
index 99db55c0867..fb3fc5c4551 100644
--- a/unsloth/models/__init__.py
+++ b/unsloth/models/__init__.py
@@ -20,5 +20,5 @@ from .qwen3 import FastQwen3Model
from .qwen3_moe import FastQwen3MoeModel
from .granite import FastGraniteModel
from .dpo import PatchDPOTrainer, PatchKTOTrainer
-from ._utils import is_bfloat16_supported, __version__
-from .rl import PatchFastRL, vLLMSamplingParams
+from ._utils import is_bfloat16_supported, is_vLLM_available, __version__
+from .rl import PatchFastRL, vLLMSamplingParams
\ No newline at end of file
diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py
index 82a1d02fce1..4b9e2cce068 100644
--- a/unsloth/models/_utils.py
+++ b/unsloth/models/_utils.py
@@ -17,6 +17,7 @@ __version__ = "2025.5.1"
__all__ = [
"SUPPORTS_BFLOAT16",
"is_bfloat16_supported",
+ "is_vLLM_available",
"prepare_model_for_kbit_training",
"xformers",
@@ -800,6 +801,9 @@ def is_bfloat16_supported():
return SUPPORTS_BFLOAT16
pass
+def is_vLLM_available():
+ return _is_package_available("vllm")
+pass
# Patches models to add RoPE Scaling
def patch_linear_scaling(
diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py
index 2145571ae1e..207540abf5c 100644
--- a/unsloth/models/llama.py
+++ b/unsloth/models/llama.py
@@ -1661,9 +1661,8 @@ class FastLlamaModel:
)
pass
if fast_inference:
- import platform
- if platform.system().lower() == 'windows':
- print("Unsloth: vLLM does not work in Windows! Will use Unsloth inference!")
+ if not is_vLLM_available():
+ print("Unsloth: vLLM is not installed! Will use Unsloth inference!")
fast_inference = False
major_version, minor_version = torch.cuda.get_device_capability()
if major_version < 7:
diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py
index 7e904471bc7..c93c5d2742b 100644
--- a/unsloth/models/loader.py
+++ b/unsloth/models/loader.py
@@ -14,6 +14,7 @@
from ._utils import (
is_bfloat16_supported,
+ is_vLLM_available,
HAS_FLASH_ATTENTION,
HAS_FLASH_ATTENTION_SOFTCAPPING,
USE_MODELSCOPE,
@@ -351,9 +352,8 @@ class FastLanguageModel(FastLlamaModel):
pass
if fast_inference:
- import platform
- if platform.system().lower() == 'windows':
- print("Unsloth: vLLM does not work in Windows! Will use Unsloth inference!")
+ if not is_vLLM_available():
+ print("Unsloth: vLLM is not installed! Will use Unsloth inference!")
fast_inference = False
pass
from unsloth_zoo.vllm_utils import (