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.

Better vllm deletion

Daniel Han84779ee11b84
diff --git a/unsloth/dataprep/synthetic.py b/unsloth/dataprep/synthetic.py
index 100044b54be..32ebad60bac 100644
--- a/unsloth/dataprep/synthetic.py
+++ b/unsloth/dataprep/synthetic.py
@@ -26,6 +26,7 @@ import time
from unsloth_zoo.vllm_utils import (
load_vllm,
patch_vllm,
+ delete_vllm,
)
import numpy as np
@@ -189,6 +190,14 @@ class SyntheticDataKit:
for _ in range(10):
torch.cuda.empty_cache()
gc.collect()
+
+ # Delete vLLM module as well
+ # We delete llm.llm_engine.model_executor, so first make it accessible
+ class Dummy0: model_executor = 1
+ class Dummy1: llm_engine = Dummy0()
+ class Dummy2: llm = Dummy1()
+ llm = Dummy2().llm.llm_engine.model_executor
+ delete_vllm(llm)
pass
def __enter__(self): return self
diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py
index e4782b457bc..90e0d9eb44f 100644
--- a/unsloth/models/_utils.py
+++ b/unsloth/models/_utils.py
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "2025.4.7"
+__version__ = "2025.4.8"
__all__ = [
"SUPPORTS_BFLOAT16",