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.

SamplingParams

Daniel Hanc27074c28b4b
diff --git a/unsloth/models/__init__.py b/unsloth/models/__init__.py
index b15e04ab748..29ad78dae2d 100644
--- a/unsloth/models/__init__.py
+++ b/unsloth/models/__init__.py
@@ -20,4 +20,4 @@ from .mistral import FastMistralModel
from .qwen2 import FastQwen2Model
from .dpo import PatchDPOTrainer, PatchKTOTrainer
from ._utils import is_bfloat16_supported
-from .rl import PatchFastRL
+from .rl import PatchFastRL, vLLMSamplingParams
diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py
index 3ab45cdf729..572caf594c4 100644
--- a/unsloth/models/rl.py
+++ b/unsloth/models/rl.py
@@ -44,6 +44,7 @@ torch_compile_options = {
def vLLMSamplingParams(**kwargs):
+ from vllm import SamplingParams
sampling_params = SamplingParams(**kwargs)
sampling_params._set_kwargs = kwargs
return sampling_params