vllm nighlty and "No user query found in messages"

#2
by dnum-ia-unistra - opened

Hi,

I deployed that FP8 version with the latest nightly vllm (lmcache/vllm-openai:nightly-2026-03-02).
I use "qwen3_xml" as tool parser and i use the instruct mode with --default-chat-template-kwargs '{"enable_thinking": false}'

And i saw the following errors sometimes in the log file :

(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311] Error in preprocessing prompt inputs
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311] Traceback (most recent call last):
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]   File "/opt/venv/lib/python3.12/site-packages/vllm/renderers/hf.py", line 472, in safe_apply_chat_template
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]     return tokenizer.apply_chat_template(
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]   File "/opt/venv/lib/python3.12/site-packages/transformers/tokenization_utils_base.py", line 1667, in apply_chat_template
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]     rendered_chat, generation_indices = render_jinja_template(
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]                                         ^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]   File "/opt/venv/lib/python3.12/site-packages/transformers/utils/chat_template_utils.py", line 539, in render_jinja_template
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]     rendered_chat = compiled_template.render(
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]                     ^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]   File "/opt/venv/lib/python3.12/site-packages/jinja2/environment.py", line 1295, in render
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]     self.environment.handle_exception()
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]   File "/opt/venv/lib/python3.12/site-packages/jinja2/environment.py", line 942, in handle_exception
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]     raise rewrite_traceback_stack(source=source)
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]   File "<template>", line 79, in top-level template code
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]   File "/opt/venv/lib/python3.12/site-packages/jinja2/sandbox.py", line 401, in call
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]     return __context.call(__obj, *args, **kwargs)
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]   File "/opt/venv/lib/python3.12/site-packages/transformers/utils/chat_template_utils.py", line 447, in raise_exception
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]     raise jinja2.exceptions.TemplateError(message)
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311] jinja2.exceptions.TemplateError: No user query found in messages.
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311] The above exception was the direct cause of the following exception:
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311] Traceback (most recent call last):
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]   File "/opt/venv/lib/python3.12/site-packages/vllm/entrypoints/openai/chat_completion/serving.py", line 295, in render_chat_request
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]     conversation, engine_prompts = await self._preprocess_chat(
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]   File "/opt/venv/lib/python3.12/site-packages/vllm/entrypoints/openai/engine/serving.py", line 995, in _preprocess_chat
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]     (conversation,), (engine_prompt,) = await renderer.render_chat_async(
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]   File "/opt/venv/lib/python3.12/site-packages/vllm/renderers/base.py", line 755, in render_chat_async
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]     for conv, prompt in await asyncio.gather(*rendered):
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]   File "/opt/venv/lib/python3.12/site-packages/vllm/renderers/hf.py", line 694, in render_messages_async
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]     prompt_raw = safe_apply_chat_template(
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]                  ^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]   File "/opt/venv/lib/python3.12/site-packages/vllm/renderers/hf.py", line 487, in safe_apply_chat_template
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311]     raise ValueError(str(e)) from e
(APIServer pid=1) ERROR 03-02 14:02:34 [serving.py:311] ValueError: No user query found in messages.

In the latest lm studio, i saw i the changelog : "Fixed Qwen3.5 RAG jinja rendering bug: "No user query found in messages"
https://lmstudio.ai/changelog/lmstudio-v0.4.6

How can we fix it with vLLM ?

Thanks

Sign up or log in to comment