Skip to content

Commit 228a6df

Browse files
pos-ei-donclaude
andauthored
fix(vllm): restore compatibility with vLLM >= 0.22 (get_tokenizer moved to vllm.tokenizers) (#10252)
fix(vllm): restore compatibility with vLLM >= 0.22 (get_tokenizer moved) vLLM 0.22 moved get_tokenizer from vllm.transformers_utils.tokenizer to vllm.tokenizers. Since the backend requirements install vllm unpinned, freshly built/installed vllm backends currently fail to start with ModuleNotFoundError: No module named 'vllm.transformers_utils.tokenizer' (surfacing as 'grpc service not ready' when loading a model). Use the same try/except version-compat import pattern already used elsewhere in this file: try the new vllm.tokenizers location first and fall back to the pre-0.22 path. Tested on a DGX Spark (GB10, ARM64) with the cuda13-nvidia-l4t-arm64-vllm backend and vllm 0.22.0: model load, chat completions and tool calls all work with this patch applied. Signed-off-by: pos-ei-don <1822533+pos-ei-don@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 51a92b6 commit 228a6df

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

backend/python/vllm/backend.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
from vllm.engine.async_llm_engine import AsyncLLMEngine
2727
from vllm.sampling_params import SamplingParams
2828
from vllm.utils import random_uuid
29-
from vllm.transformers_utils.tokenizer import get_tokenizer
29+
try:
30+
from vllm.tokenizers import get_tokenizer # vLLM >= 0.22
31+
except ImportError:
32+
from vllm.transformers_utils.tokenizer import get_tokenizer # vLLM < 0.22
3033
from vllm.multimodal.utils import fetch_image
3134
from vllm.assets.video import VideoAsset
3235
import base64

0 commit comments

Comments
 (0)