Instructions to use Qwen/Qwen3.5-35B-A3B-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/Qwen3.5-35B-A3B-FP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Qwen/Qwen3.5-35B-A3B-FP8") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Qwen/Qwen3.5-35B-A3B-FP8") model = AutoModelForMultimodalLM.from_pretrained("Qwen/Qwen3.5-35B-A3B-FP8") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Qwen/Qwen3.5-35B-A3B-FP8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/Qwen3.5-35B-A3B-FP8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Qwen/Qwen3.5-35B-A3B-FP8", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Qwen/Qwen3.5-35B-A3B-FP8
- SGLang
How to use Qwen/Qwen3.5-35B-A3B-FP8 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Qwen/Qwen3.5-35B-A3B-FP8" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Qwen/Qwen3.5-35B-A3B-FP8", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Qwen/Qwen3.5-35B-A3B-FP8" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Qwen/Qwen3.5-35B-A3B-FP8", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use Qwen/Qwen3.5-35B-A3B-FP8 with Docker Model Runner:
docker model run hf.co/Qwen/Qwen3.5-35B-A3B-FP8
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