AttributeError: 'LLM' object has no attribute 'engine_step' with Unsloth and vLLM
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.8k
- Forks
- 989
- Avg merge
- 6h 29m
- Merged PRs (30d)
- 85
Description
Description
I am experiencing an AttributeError when attempting to run a script that uses Unsloth with vLLM. The traceback indicates that an LLM object from vLLM is being accessed for an attribute named engine_step, which does not exist in the current vLLM version.
This suggests a version incompatibility between Unsloth's code and the installed vLLM library.
Traceback Traceback (most recent call last): File "/home/ecs-user/ART_training/art_train.py", line 478, in <module> asyncio.run(model.register(backend)) File "/home/ecs-user/anaconda3/envs/ART/lib/python3.10/site-packages/nest_asyncio.py", line 30, in run return loop.run_until_complete(task) File "/home/ecs-user/anaconda3/envs/ART/lib/python3.10/site-packages/nest_asyncio.py", line 98, in run_until_complete return f.result() File "/home/ecs-user/anaconda3/envs/ART/lib/python3.10/asyncio/futures.py", line 201, in result raise self._exception.with_traceback(self._exception_tb) File "/home/ecs-user/anaconda3/envs/ART/lib/python3.10/asyncio/tasks.py", line 232, in __step result = coro.send(None) File "/home/ecs-user/ART/src/art/model.py", line 322, in register base_url, api_key = await backend._prepare_backend_for_training( File "/home/ecs-user/ART/src/art/local/backend.py", line 272, in _prepare_backend_for_training await service.start_openai_server(config=config) File "/home/ecs-user/ART/src/mp_actors/traceback.py", line 26, in async_wrapper raise e.with_traceback(streamlined_traceback()) File "/home/ecs-user/ART/src/art/unsloth/service.py", line 60, in start_openai_server self.state.trainer.save_model(lora_path) File "/home/ecs-user/anaconda3/envs/ART/lib/python3.10/functools.py", line 981, in __get__ val = self.func(instance) File "/home/ecs-user/ART/src/art/unsloth/service.py", line 45, in state return ModelState(self.config) File "/home/ecs-user/ART/src/art/unsloth/state.py", line 88, in __init__ self.vllm = vLLMState(self.model.vllm_engine, enable_sleep_mode) File "/home/ecs-user/ART/src/art/unsloth/state.py", line 140, in __init__ create_engine_pause_and_resume_functions(self.async_engine) File "/home/ecs-user/ART/src/art/vllm/engine.py", line 68, in create_engine_pause_and_resume_functions _engine_step = engine.engine_step AttributeError: 'LLM' object has no attribute 'engine_step' Steps to Reproduce Use Python 3.10 with an environment that has Unsloth and vLLM installed.
Expected Behavior
The script should initialize the vLLM engine and proceed with the training process without encountering any errors.
System Information
Operating System: [Ubuntu 22.04]
Python Version: 3.10
Unsloth Version: 2025.9.6
vLLM Version: 0.9.2
CUDA Version: 12.6
GPU: NVIDIA H20
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure in the reported Python 3.10, Unsloth 2025.9.6, and vLLM 0.9.2 environment, then inspect src/art/vllm/engine.py at create_engine_pause_and_resume_functions and the callers in src/art/unsloth/state.py. Done means the vLLM engine initializes during model registration without the reported AttributeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100