Skip to content

[Bug] ModuleNotFoundError: No module named 'vllm.model_executor.model_loader.bitsandbytes_loader' #2983

@hellcastter

Description

@hellcastter
  1. Did you update? pip install --upgrade unsloth unsloth_zoo
  2. Colab or Kaggle or local / cloud: Colab
  3. Number GPUs used, use nvidia-smi: Tesla T4 free env
  4. Which notebook? Please link! https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_(4B)-GRPO.ipynb
  5. Which Unsloth version, TRL version, transformers version, PyTorch version? unsloth== 2025.7.4, unsloth-zoo==2025.7.6

Code to replicate

%%capture
import os
if "COLAB_" not in "".join(os.environ.keys()):
    !pip install unsloth vllm
else:
    # [NOTE] Do the below ONLY in Colab! Use [[pip install unsloth vllm]]
    !pip install --no-deps unsloth vllm==0.8.5.post1

#@title Colab Extra Install { display-mode: "form" }
%%capture
import os
if "COLAB_" not in "".join(os.environ.keys()):
    !pip install unsloth vllm
else:
    !pip install --no-deps unsloth vllm==0.8.5.post1
    # [NOTE] Do the below ONLY in Colab! Use [[pip install unsloth vllm]]
    # Skip restarting message in Colab
    import sys, re, requests; modules = list(sys.modules.keys())
    for x in modules: sys.modules.pop(x) if "PIL" in x or "google" in x else None
    !pip install --no-deps bitsandbytes accelerate xformers==0.0.29.post3 peft trl triton cut_cross_entropy unsloth-zoo
    !pip install sentencepiece protobuf "datasets>=3.4.1,<4.0.0" huggingface_hub hf_transfer

    # vLLM requirements - vLLM breaks Colab due to reinstalling numpy
    f = requests.get("https://raw.githubusercontent.com/vllm-project/vllm/refs/heads/main/requirements/common.txt").content
    with open("vllm_requirements.txt", "wb") as file:
        file.write(re.sub(rb"(transformers|numpy|xformers)[^\n]{1,}\n", b"", f))
    !pip install -r vllm_requirements.txt
from unsloth import FastLanguageModel

Error

🦥 Unsloth: Will patch your computer to enable 2x faster free finetuning.
🦥 Unsloth Zoo will now patch everything to make training faster!
INFO 07-17 16:03:10 [importing.py:53] Triton module has been replaced with a placeholder.
INFO 07-17 16:03:10 [__init__.py:239] Automatically detected platform cuda.
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
[/tmp/ipython-input-3-3010846500.py](https://localhost:8080/#) in <cell line: 0>()
----> 1 from unsloth import FastLanguageModel
      2 import torch
      3 max_seq_length = 2048 # Can increase for longer reasoning traces
      4 lora_rank = 32 # Larger rank = smarter, but slower
      5 

4 frames
[/usr/local/lib/python3.11/dist-packages/unsloth/__init__.py](https://localhost:8080/#) in <module>
    241 pass
    242 
--> 243 from .models import *
    244 from .models import __version__
    245 from .save import *

[/usr/local/lib/python3.11/dist-packages/unsloth/models/__init__.py](https://localhost:8080/#) in <module>
     13 # limitations under the License.
     14 
---> 15 from .llama     import FastLlamaModel
     16 from .loader    import FastLanguageModel, FastVisionModel, FastTextModel, FastModel
     17 from .mistral   import FastMistralModel

[/usr/local/lib/python3.11/dist-packages/unsloth/models/llama.py](https://localhost:8080/#) in <module>
     48 if HAS_FLASH_ATTENTION:
     49     from flash_attn import flash_attn_func
---> 50 from .vision import FastBaseModel
     51 
     52 # Final patching code

[/usr/local/lib/python3.11/dist-packages/unsloth/models/vision.py](https://localhost:8080/#) in <module>
     81 _compile_config.disable = True # Must set manually
     82 
---> 83 from unsloth_zoo.vllm_utils import (
     84     convert_lora_modules,
     85     return_lora_modules,

[/usr/local/lib/python3.11/dist-packages/unsloth_zoo/vllm_utils.py](https://localhost:8080/#) in <module>
    101         return quant_states
    102 
--> 103     import vllm.model_executor.model_loader.bitsandbytes_loader
    104     if hasattr(
    105         vllm.model_executor.model_loader.bitsandbytes_loader,

ModuleNotFoundError: No module named 'vllm.model_executor.model_loader.bitsandbytes_loader'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

Solution that worked for me: downgrade to unsloth==2025.7.3, unsloth-zoo==2025.7.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions