Instructions to use Qwen/Qwen3.5-35B-A3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/Qwen3.5-35B-A3B 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") 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") model = AutoModelForMultimodalLM.from_pretrained("Qwen/Qwen3.5-35B-A3B") 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]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Qwen/Qwen3.5-35B-A3B 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" # 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", "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
- SGLang
How to use Qwen/Qwen3.5-35B-A3B 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" \ --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", "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" \ --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", "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 with Docker Model Runner:
docker model run hf.co/Qwen/Qwen3.5-35B-A3B
Non-deterministic outputs with identical inputs (GPTQ-Int4, vLLM 0.18, document extraction)
Description:
Environment
- Model:
Qwen3.5-35B-A3B-GPTQ-Int4(from
Qwen/Qwen3.5-35B-A3B-GPTQ-Int4) - Inference engine: vLLM 0.18.0
- GPU: NVIDIA RTX 5090 (32 GB VRAM)
- OS: Ubuntu 24.04, CUDA 13.0
Problem
We use Qwen3.5-35B-A3B-GPTQ-Int4 for structured data extraction from scanned Russian accounting documents (invoices,
contracts, acts, etc.). The model receives a page image + a system prompt in Russian and must return a strict JSON with
fields like document number, date, buyer/seller names, INN, KPP, VAT amount, etc.
The issue: given the exact same inputs, the model produces different outputs across runs.
We process a batch of 37 identical PDF files with:
- Same system prompt (see below)
- Same user prompt
- Same DPI (230) for PDF→PNG conversion
- Same vLLM parameters
Yet on repeated runs, some fields change — e.g., seller name or address may differ slightly, or VAT amount
appears/disappears. This is critical for our use case where accuracy and consistency are essential for accounting
automation.
vLLM generation parameters
We explicitly set all parameters for maximum determinism:
{
"model": "document-parser",
"temperature": 0.0,
"top_p": 1.0,
"top_k": 1,
"seed": 42,
"chat_template_kwargs": {"enable_thinking": False},
"max_tokens": 2048
}
vLLM launch command
python -m vllm.entrypoints.openai.api_server \
--model Qwen3.5-35B-A3B-GPTQ-Int4 \
--served-model-name document-parser \
--port 8001 \
--dtype float16 \
--gpu-memory-utilization 0.97 \
--max-model-len 16384 \
--max-num-seqs 12 \
--trust-remote-code \
--enable-chunked-prefill \
--seed 42
System prompt (Russian)
The prompt instructs the model to extract structured data from Russian accounting documents and return strict JSON:
Ты — экспертная система извлечения данных из российских бухгалтерских документов.
На изображении — отсканированный документ. Определи тип и извлеки реквизиты двух сторон.
Верни СТРОГО JSON:
{
"тип_документа": "string",
"номер_документа": "string | null",
"дата_документа": "ДД.ММ.ГГГГ | null",
"покупатель": "string | null",
"покупатель_инн": "string | null",
"покупатель_кпп": "string | null",
"покупатель_адрес": "string | null",
"продавец": "string | null",
"продавец_инн": "string | null",
"продавец_кпп": "string | null",
"продавец_адрес": "string | null",
"ндс": "number | null",
"сумма_с_ндс": "number | null"
}
МАППИНГ СТОРОН:
- Продавец = ПОСТАВЩИК (тот, кто отгружает товар).
- Покупатель = тот, кто получает и оплачивает товар.
СУММЫ:
- НДС — итоговая сумма НДС (число).
- Сумма с НДС — итоговая сумма документа с учётом НДС.
- Числа: десятичный разделитель — точка, без пробелов. Пример: 15000.50
ПРАВИЛА:
1. Верни ТОЛЬКО валидный JSON.
2. Если данные не найдены — null.
3. Даты строго ДД.ММ.ГГГГ.
/no_think
Question
1. Is fully deterministic output achievable with this model (GPTQ-Int4 quantization) given fixed seed, temperature=0,
top_k=1?
2. Could the MoE routing introduce non-determinism even with greedy decoding? (Expert selection might vary due to
floating-point order of operations)
3. Are there any recommended vLLM settings or model configurations to improve reproducibility?
4. Would the full BF16 version be more deterministic than GPTQ-Int4?
Any guidance would be greatly appreciated. Thank you!