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.

Keep PDL module check but remove unnecessary env var setting

Daniel Hanc8a585a5890e
diff --git a/unsloth/import_fixes.py b/unsloth/import_fixes.py
index ef647ec65a7..e8c4a2f665a 100644
--- a/unsloth/import_fixes.py
+++ b/unsloth/import_fixes.py
@@ -593,6 +593,22 @@ def fix_vllm_pdl_blackwell():
except Exception:
return
+ # Helper to check if module spec exists
+ def _spec_exists(name):
+ try:
+ return importlib.util.find_spec(name) is not None
+ except (ModuleNotFoundError, ValueError):
+ return False
+
+ # Check if vLLM has the PDL-related modules before doing internet check
+ has_utils = _spec_exists("vllm.lora.ops.triton_ops.utils")
+ has_expand_op = _spec_exists("vllm.lora.ops.triton_ops.lora_expand_op")
+ has_shrink_op = _spec_exists("vllm.lora.ops.triton_ops.lora_shrink_op")
+
+ if not has_utils and not has_expand_op and not has_shrink_op:
+ # Old vLLM version without PDL support - nothing to patch
+ return
+
# Check if GitHub issue is closed (fix merged upstream)
issue_closed = False
try: