Qwen3.5 2B โ NVFP4 for veloGB10 (NVIDIA DGX Spark / GB10)
Original model: Qwen/Qwen3.5-2B by Alibaba's Qwen team, Apache-2.0. This artifact contains modified weights (NVFP4/FP8 quantization); the original model is ยฉ its authors.
NVFP4/FP8-quantized variant of Qwen3.5 2B (2B). This quantized artifact exists first and foremost to run with the
veloGB10 inference engine (gb10_inference) on NVIDIA
DGX Spark / GB10 systems โ it is produced, validated, and tuned for veloGB10's kernels.
The weights use the standard HuggingFace compressed-tensors layout (nvfp4-pack-quantized),
so this artifact can be used for any purpose, with any framework that reads the format. It
is in particular fit and proven to work with veloGB10 โ greedy-lossless speculative decoding,
two-node TP=2 serving, and the engine's full correctness test suite all pass on this artifact.
What this pack is: sources and credits
- Original model: Qwen/Qwen3.5-2B โ ยฉ Alibaba Qwen team,
Apache License 2.0. A copy of the license
is included in this repository (
LICENSE). - This artifact: quantized from the original with veloGB10's offline quantizer
(
nvfp4-mixed). Weights are modified relative to the original; tokenizer and chat template are unchanged from the original model. - Engine: veloGB10 (Apache-2.0).
Specifications
| Base model | Qwen/Qwen3.5-2B |
| Architecture | dense hybrid (18 GatedDeltaNet + 6 full-GQA layers), hidden 2048, 8 Q / 2 KV heads |
| Attention | hybrid GatedDeltaNet (linear attention, fixed-size recurrent state) + periodic full GQA |
| MTP head | native multi-token-prediction head (used for speculative decoding) |
| Context | 262,144 tokens |
| Vocabulary | 248,320 |
| Quantization | nvfp4-mixed โ all GEMMs NVFP4 except GDN in/out projections (FP8) |
| Format | nvfp4-pack-quantized (compressed-tensors compatible) |
| On-disk size | 1.6 GB |
Running it with veloGB10
Download a release binary of veloGB10 (one self-contained file; see its README), and the pack with hf download doth4580/Qwen3.5-2B-NVFP4-MIXED --local-dir /path/to/Qwen3.5-2B-NVFP4-MIXED. The server is OpenAI-compatible on http://<head-ip>:9000/v1. The flags below are the ones this pack was tested with; --max-batch sets how many requests run at once.
One GB10 (TP=1)
./gb10_inference --server \
--model-dir /path/to/Qwen3.5-2B-NVFP4-MIXED \
--host 0.0.0.0 --port 9000 \
--max-seq-len 262144 \
--max-batch 2 \
--max-tokens 65536 \
--default-presence-penalty 2.0 \
--prefix-cache on \
--mtp=auto
Two GB10s (TP=2)
On the second machine (no model copy, no configuration):
./gb10_inference --node --port 29500
On the head (the machine with the model folder):
./gb10_inference --server \
--model-dir /path/to/Qwen3.5-2B-NVFP4-MIXED \
--tp 2 --nodes <node-ip>:29500 \
--host 0.0.0.0 --port 9000 \
--max-seq-len 262144 \
--max-batch 2 \
--max-tokens 65536 \
--default-presence-penalty 2.0 \
--prefix-cache on \
--mtp=auto
Four GB10s (TP=4)
Start ./gb10_inference --node --port 29500 on each of the three other machines, then on the head:
./gb10_inference --server \
--model-dir /path/to/Qwen3.5-2B-NVFP4-MIXED \
--tp 4 --nodes <node1-ip>:29500,<node2-ip>:29500,<node3-ip>:29500 \
--host 0.0.0.0 --port 9000 \
--max-seq-len 262144 \
--max-batch 2 \
--max-tokens 65536 \
--default-presence-penalty 2.0 \
--prefix-cache on \
--mtp=auto
The nodes need no copy of the model. The head sends each node only its own share of the weights over the network and keeps it in a local cache, so a second start of the same model transfers nothing. On a box with two active RoCE port pairs, name the one to use with --rdma-dev <rail1>,<rail2>; with one pair it is found automatically.
Measured with veloGB10
VeloBench runs against the served API on NVIDIA DGX Spark-class GB10 machines (2026-11-06, veloGB10 0.7.7 development builds), at production sampling: each request sends the pack's default sampler settings, thinking on, one request at a time for the single-request columns. Decode is in output tokens per second and includes speculative decoding. One run per cell; sampled runs vary by roughly ยฑ10%.
| Topology | Draft source | Code turn decode | Story turn decode | All-turn median decode | Prefill (tok/s) | 2 requests, aggregate | Draft acceptance |
|---|---|---|---|---|---|---|---|
| TP=1 | pack's MTP head | 76 | 104 | 83 | 7,926 | 221 | โ |
| TP=2 | pack's MTP head | 109 | 131 | 102 | 7,098 | 239 | โ |
| TP=4 | pack's MTP head | 116 | 116 | 110 | 5,384 | 243 | โ |
Intellectual property
We do not claim any intellectual-property ownership of the model, its weights, its architecture or its original documentation. All rights stay with the original authors and with every contributor credited above, under their own licences, which apply to this repository unchanged. Our contribution is limited to what the "What this pack is" section says we did (quantization, packaging, testing and the veloGB10 instructions). If you are a rights holder and want something here changed or removed, open a discussion on this repository.
Original model card โ Qwen/Qwen3.5-2B
Reproduced verbatim from the original repository (metadata header removed).
Qwen3.5-2B
This repository contains model weights and configuration files for the post-trained model in the Hugging Face Transformers format.
These artifacts are compatible with Hugging Face Transformers, vLLM, SGLang, KTransformers, etc.
In light of its parameter scale, the intended use cases are prototyping, task-specific fine-tuning, and other research or development purposes.
Over recent months, we have intensified our focus on developing foundation models that deliver exceptional utility and performance. Qwen3.5 represents a significant leap forward, integrating breakthroughs in multimodal learning, architectural efficiency, reinforcement learning scale, and global accessibility to empower developers and enterprises with unprecedented capability and efficiency.
Qwen3.5 Highlights
Qwen3.5 features the following enhancement:
Unified Vision-Language Foundation: Early fusion training on multimodal tokens achieves cross-generational parity with Qwen3 and outperforms Qwen3-VL models across reasoning, coding, agents, and visual understanding benchmarks.
Efficient Hybrid Architecture: Gated Delta Networks combined with sparse Mixture-of-Experts deliver high-throughput inference with minimal latency and cost overhead.
Scalable RL Generalization: Reinforcement learning scaled across million-agent environments with progressively complex task distributions for robust real-world adaptability.
Global Linguistic Coverage: Expanded support to 201 languages and dialects, enabling inclusive, worldwide deployment with nuanced cultural and regional understanding.
Next-Generation Training Infrastructure: Near-100% multimodal training efficiency compared to text-only training and asynchronous RL frameworks supporting massive-scale agent scaffolds and environment orchestration.
For more details, please refer to our blog post Qwen3.5.
Model Overview
- Type: Causal Language Model with Vision Encoder
- Training Stage: Pre-training & Post-training
- Language Model
- Number of Parameters: 2B
- Hidden Dimension: 2048
- Token Embedding: 248320 (Padded)
- Number of Layers: 24
- Hidden Layout: 6 ร (3 ร (Gated DeltaNet โ FFN) โ 1 ร (Gated Attention โ FFN))
- Gated DeltaNet:
- Number of Linear Attention Heads: 16 for V and 16 for QK
- Head Dimension: 128
- Gated Attention:
- Number of Attention Heads: 8 for Q and 2 for KV
- Head Dimension: 256
- Rotary Position Embedding Dimension: 64
- Feed Forward Network:
- Intermediate Dimension: 6144
- LM Output: 248320 (Tied to token embedding)
- MTP: trained with multi-steps
- Context Length: 262,144 natively
Benchmark Results
Language
| Qwen3-4B-2507 | Qwen3-1.7B | Qwen3.5-2B | Qwen3.5-0.8B | |
|---|---|---|---|---|
| Instruct (Non-Thinking) Mode | ||||
| MMLU-Pro | 69.6 | 40.2 | 55.3 | 29.7 |
| MMLU-Redux | 84.2 | 64.4 | 69.2 | 48.5 |
| C-Eval | 80.2 | 61.0 | 65.2 | 46.4 |
| SuperGPQA | 42.8 | 21.0 | 30.4 | 16.9 |
| IFEval | 83.4 | 68.2 | 61.2 | 52.1 |
| MMMLU | 64.9 | 46.7 | 56.9 | 34.1 |
| Knowledge & STEM (Thinking) | ||||
| MMLU-Pro | 74.0 | 56.5 | 66.5 | 42.3 |
| MMLU-Redux | 86.1 | 73.9 | 79.6 | 59.5 |
| C-Eval | 82.2 | 68.1 | 73.2 | 50.5 |
| SuperGPQA | 47.8 | 31.2 | 37.5 | 21.3 |
| GPQA | 65.8 | 40.1 | 51.6 | 11.9 |
| Instruction Following (Thinking๏ผ | ||||
| IFEval | 87.4 | 72.5 | 78.6 | 44.0 |
| IFBench | 50.4 | 26.7 | 41.3 | 21.0 |
| MultiChallenge | 41.7 | 27.2 | 33.7 | 18.9 |
| Long Context (Thinking๏ผ | ||||
| AA-LCR | 32.0 | 6.7 | 25.6 | 4.7 |
| LongBench v2 | 42.8 | 26.5 | 38.7 | 26.1 |
| Reasoning (Thinking๏ผ | ||||
| HMMT Feb 25 | 57.5 | 10.2 | 22.9 | -- |
| HMMT Nov 25 | 69.6 | 8.9 | 19.6 | -- |
| General Agent (Thinking๏ผ | ||||
| BFCL-V4 | 39.9 | -- | 43.6 | 25.3 |
| TAU2-Bench | 43.2 | -- | 48.8 | 11.6 |
| Multilingualism (Thinking๏ผ | ||||
| MMMLU | 70.8 | 57.0 | 63.1 | 44.3 |
| MMLU-ProX | 62.4 | 49.4 | 52.3 | 34.6 |
| NOVA-63 | 47.1 | 40.3 | 46.4 | 42.4 |
| INCLUDE | 64.4 | 51.8 | 55.4 | 40.6 |
| Global PIQA | 73.5 | 63.1 | 69.3 | 59.4 |
| PolyMATH | 46.2 | 25.2 | 26.1 | 8.2 |
| WMT24++ | 58.9 | 39.3 | 45.8 | 27.2 |
| MAXIFE | 72.1 | 50.7 | 60.6 | 39.2 |
* TAU2-Bench: we follow the official setup except for the airline domain, where all models are evaluated by applying the fixes proposed in the Claude Opus 4.5 system card.
* MMLU-ProX: we report the averaged accuracy on 29 languages.
* WMT24++: a harder subset of WMT24 after difficulty labeling and rebalancing; we report the averaged scores on 55 languages using XCOMET-XXL.
* MAXIFE: we report the accuracy on English + multilingual original prompts (totally 23 settings).
* Experimental settings: top_p=0.95, top_k=20, presence_penalty=1.5, and temperature=1.0 were used.
* Empty cells (--) indicate scores not yet available or not applicable.
Vision Language
| Qwen3-VL-4B | Qwen3-VL-2B | Qwen3.5-2B | Qwen3.5-0.8B | |
|---|---|---|---|---|
| STEM and Puzzle | ||||
| MMMU | 70.8 | 61.4 | 64.2/64.2 | 49/47.4 |
| MMMU-Pro | 57.0 | 42.5 | 50.3/47.7 | 31.2/31.4 |
| Mathvista(mini) | 79.5 | 73.6 | 76.7/73.9 | 62.2/58.6 |
| DynaMath | 74.4 | 66.7 | 73.6/69.6 | 49.9/46.5 |
| ZEROBench | 0.0 | 0.0 | 1/0 | 0/0 |
| ZEROBench_sub | 18.9 | 13.2 | 17.1/18.6 | 12.9/11.4 |
| VlmsAreBlind | 68.6 | 50.0 | 75.8/74.3 | 59.4/57.3 |
| General VQA | ||||
| RealWorldQA | 73.2 | 69.5 | 74.5/71.2 | 63.4/61.6 |
| MMStar | 73.2 | 68.1 | 71.7/68.0 | 58.3/55.9 |
| MMBenchEN-DEV-v1.1 | 86.7 | 81.9 | 83.3/81.3 | 69.9/68.0 |
| SimpleVQA | 48.8 | 43.6 | 38.5/39.5 | 31.3/30.4 |
| HallusionBench | 64.1 | 54.9 | 58.0/51.3 | 53.1/46.7 |
| Text Recognition and Document Understanding | ||||
| MMLongBench-Doc | 44.4 | 33.8 | 45.4/38.8 | 33.6/28.1 |
| AI2D_TEST | 84.9 | 80.4 | 83.3/81.5 | 69.9/68.7 |
| CC-OCR | 73.8 | 68.3 | 72.9/75.8 | 63.2/66.7 |
| OmniDocBench1.5 | 80.0 | 65.9 | 79.8/80.9 | 61.0/70.6 |
| CharXiv(RQ) | 50.3 | 37.1 | 58.8/52.6 | 41.3/38.2 |
| OCRBench | 80.8 | 79.2 | 84.5/85.4 | 74.5/79.1 |
| Spatial Intelligence | ||||
| RefCOCO(avg) | 88.2 | 84.8 | 84.8/84.3 | 79.3/77.8 |
| CountBench | 89.4 | 84.1 | 91.4/86.8 | 77.0/68.6 |
| ODInW13 | 39.4 | 36.0 | 35.9/40.5 | 31.6/33.2 |
| ERQA | 47.3 | 41.8 | 43.8/33.0 | 34.5/23.8 |
| EmbSpatialBench | 80.7 | 75.9 | 77.9/66.4 | 68.6/54.6 |
| RefSpatialBench | 45.3 | 28.9 | 32.9/30.0 | 23.5/21.7 |
| Hypersim | 11.9 | 11.2 | 12.4/12.4 | 11.9/11.0 |
| SUNRGBD | 28.0 | 28.6 | 28.7/25.6 | 26.1/23.3 |
| Nuscene | 4.9 | 4.0 | 6.9/8.5 | 5.7/7.0 |
| Video Understanding | ||||
| VideoMME(w sub.) | 76.0 | 67.9 | 75.6/-- | 63.8/-- |
| VideoMME(w/o sub.) | 68.9 | 62.1 | 69.0/-- | 57.7/-- |
| VideoMMMU | 69.4 | 54.1 | 62.1/-- | 44.3/-- |
| MLVU | 75.7 | 69.2 | 76.2/-- | 65.6/-- |
| MVBench | 69.3 | 64.5 | 64.9/-- | 55.8/-- |
| LVBench | 53.5 | 47.6 | 57.1/-- | 45.1/-- |
| MMVU | 58.6 | 48.9 | 48.6/-- | 34.3/-- |
| Visual Agent | ||||
| ScreenSpot Pro | 59.5 | 48.5 | --/54.5 | --/46.5 |
| Medical VQA | ||||
| SLAKE | 65.9 | 61.1 | 74.4/67.5 | 62.6/59.5 |
| PMC-VQA | 48.4 | 42.4 | 48.8/54.0 | 40.4/45.5 |
| MedXpertQA-MM | 26.3 | 13.0 | 26.9/19.1 | 17.1/25.3 |
* Scores of Qwen3.5 models are reported as Thinking / Non-thinking.
* MathVision: our modelโs score is evaluated using a fixed prompt, e.g., โPlease reason step by step, and put your final answer within \boxed{}.โ For other models, we report the higher score between runs with and without the \boxed{} formatting.
* Experimental settings: For the Video benchmarks, we used top_p=0.95, top_k=20, presence_penalty=1.5, and temperature=1.0. All other benchmarks adopted the same hyperparameter configuration but with temperature=0.6 under the thinking mode. Under the no-thinking mode, the inference hyperparameters were set to top_p=0.8, top_k=20, presence_penalty=1.5, and temperature=0.7.
* Empty cells (--) indicate scores not yet available or not applicable.
Quickstart
Qwen3.5 models support both non-thinking and thinking mode. Qwen3.5-2B operates in non-thinking mode by default. To enable thinking, refer to the examples here.
For streamlined integration, we recommend using Qwen3.5 via APIs. Below is a guide to use Qwen3.5 via OpenAI-compatible API.
Serving Qwen3.5
Qwen3.5 can be served via APIs with popular inference frameworks. In the following, we show example commands to launch OpenAI-Compatible API servers for Qwen3.5 models.
Inference efficiency and throughput vary significantly across frameworks. We recommend using the latest framework versions to ensure optimal performance and compatibility. For production workloads or high-throughput scenarios, dedicated serving engines such as SGLang, KTransformers or vLLM are strongly recommended.
The model has a default context length of 262,144 tokens. If you encounter out-of-memory (OOM) errors, consider reducing the context window.
SGLang
SGLang is a fast serving framework for large language models and vision language models. SGLang from the main branch of the open-source repository is required for Qwen3.5, which can be installed using the following command in a fresh environment:
uv pip install 'git+https://github.com/sgl-project/sglang.git#subdirectory=python&egg=sglang[all]'
See its documentation for more details.
The following will create API endpoints at http://localhost:8000/v1:
Standard Version: The following command can be used to create an API endpoint with maximum context length 262,144 tokens using tensor parallel on 8 GPUs.
python -m sglang.launch_server --model-path Qwen/Qwen3.5-2B --port 8000 --tp-size 1 --mem-fraction-static 0.8 --context-length 262144Tool Use: To support tool use, you can use the following command.
python -m sglang.launch_server --model-path Qwen/Qwen3.5-2B --port 8000 --tp-size 1 --mem-fraction-static 0.8 --context-length 262144 --tool-call-parser qwen3_coderMulti-Token Prediction (MTP): The following command is recommended for MTP:
python -m sglang.launch_server --model-path Qwen/Qwen3.5-2B --port 8000 --tp-size 1 --mem-fraction-static 0.8 --context-length 262144 --speculative-algo NEXTN --speculative-num-steps 3 --speculative-eagle-topk 1 --speculative-num-draft-tokens 4
vLLM
vLLM is a high-throughput and memory-efficient inference and serving engine for LLMs. vLLM from the main branch of the open-source repository is required for Qwen3.5, which can be installed using the following command in a fresh environment:
uv pip install vllm --torch-backend=auto --extra-index-url https://wheels.vllm.ai/nightly
See its documentation for more details.
For detailed Qwen3.5 usage guide, see the vLLM Qwen3.5 recipe.
The following will create API endpoints at http://localhost:8000/v1:
Standard Version: The following command can be used to create an API endpoint with maximum context length 262,144 tokens using tensor parallel on 8 GPUs.
vllm serve Qwen/Qwen3.5-2B --port 8000 --tensor-parallel-size 1 --max-model-len 262144Tool Call: To support tool use, you can use the following command.
vllm serve Qwen/Qwen3.5-2B --port 8000 --tensor-parallel-size 1 --max-model-len 262144 --enable-auto-tool-choice --tool-call-parser qwen3_coderMulti-Token Prediction (MTP): The following command is recommended for MTP:
vllm serve Qwen/Qwen3.5-2B --port 8000 --tensor-parallel-size 1 --max-model-len 262144 --speculative-config '{"method":"qwen3_next_mtp","num_speculative_tokens":2}'Text-Only: The following command skips the vision encoder and multimodal profiling to free up memory for additional KV cache:
vllm serve Qwen/Qwen3.5-2B --port 8000 --tensor-parallel-size 1 --max-model-len 262144 --language-model-only
KTransformers
KTransformers is a flexible framework for experiencing cutting-edge LLM inference optimizations with CPU-GPU heterogeneous computing. For running Qwen3.5 with KTransformers, see the KTransformers Deployment Guide.
Hugging Face Transformers
Hugging Face Transformers contains a lightweight server which can be used for quick testing and moderate load deployment.
The latest transformers is required for Qwen3.5:
pip install "transformers[serving] @ git+https://github.com/huggingface/transformers.git@main"
See its documentation for more details. Please also make sure torchvision and pillow are installed.
Then, run transformers serve to launch a server with API endpoints at http://localhost:8000/v1; it will place the model on accelerators if available:
transformers serve --force-model Qwen/Qwen3.5-2B --port 8000 --continuous-batching
Using Qwen3.5 via the Chat Completions API
The chat completions API is accessible via standard HTTP requests or OpenAI SDKs. Here, we show examples using the OpenAI Python SDK.
Before starting, make sure it is installed and the API key and the API base URL is configured, e.g.:
pip install -U openai
# Set the following accordingly
export OPENAI_BASE_URL="http://localhost:8000/v1"
export OPENAI_API_KEY="EMPTY"
We recommend using the following set of sampling parameters for generation
- Non-thinking mode for text tasks:
temperature=1.0, top_p=1.00, top_k=20, min_p=0.0, presence_penalty=2.0, repetition_penalty=1.0- Non-thinking mode for VL tasks:
temperature=0.7, top_p=0.80, top_k=20, min_p=0.0, presence_penalty=1.5, repetition_penalty=1.0- Thinking mode for text tasks:
temperature=1.0, top_p=0.95, top_k=20, min_p=0.0, presence_penalty=1.5, repetition_penalty=1.0- Thinking mode for VL or precise coding (e.g. WebDev) tasks :
temperature=0.6, top_p=0.95, top_k=20, min_p=0.0, presence_penalty=0.0, repetition_penalty=1.0Please note that the support for sampling parameters varies according to inference frameworks.
Text-Only Input
from openai import OpenAI
# Configured by environment variables
client = OpenAI()
messages = [
{"role": "user", "content": "Give me a short introduction to large language models."},
]
chat_response = client.chat.completions.create(
model="Qwen/Qwen3.5-2B",
messages=messages,
max_tokens=32768,
temperature=1.0,
top_p=1.0,
presence_penalty=2.0,
extra_body={
"top_k": 20,
},
)
print("Chat response:", chat_response)
Image Input
from openai import OpenAI
# Configured by environment variables
client = OpenAI()
messages = [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://qianwen-res.oss-accelerate.aliyuncs.com/Qwen3.5/demo/RealWorld/RealWorld-04.png"
}
},
{
"type": "text",
"text": "Where is this?"
}
]
}
]
chat_response = client.chat.completions.create(
model="Qwen/Qwen3.5-2B",
messages=messages,
max_tokens=32768,
temperature=0.7,
top_p=0.8,
presence_penalty=1.5,
extra_body={
"top_k": 20,
},
)
print("Chat response:", chat_response)
Video Input
from openai import OpenAI
# Configured by environment variables
client = OpenAI()
messages = [
{
"role": "user",
"content": [
{
"type": "video_url",
"video_url": {
"url": "https://qianwen-res.oss-accelerate.aliyuncs.com/Qwen3.5/demo/video/N1cdUjctpG8.mp4"
}
},
{
"type": "text",
"text": "Summarize the video content."
}
]
}
]
# When vLLM is launched with `--media-io-kwargs '{"video": {"num_frames": -1}}'`,
# video frame sampling can be configured via `extra_body` (e.g., by setting `fps`).
# This feature is currently supported only in vLLM.
#
# By default, `fps=2` and `do_sample_frames=True`.
# With `do_sample_frames=True`, you can customize the `fps` value to set your desired video sampling rate.
chat_response = client.chat.completions.create(
model="Qwen/Qwen3.5-2B",
messages=messages,
max_tokens=32768,
temperature=0.7,
top_p=0.8,
presence_penalty=1.5,
extra_body={
"top_k": 20,
"mm_processor_kwargs": {"fps": 2, "do_sample_frames": True},
},
)
print("Chat response:", chat_response)
Thinking Mode
Qwen3.5 does not officially support the soft switch of Qwen3, i.e.,
/thinkand/nothink.
You can make the model think before response by configuring the API parameters. For example,
from openai import OpenAI
# Configured by environment variables
client = OpenAI()
messages = [
{"role": "user", "content": "Type \"I love Qwen3.5\" backwards"},
]
chat_response = client.chat.completions.create(
model="Qwen/Qwen3.5-2B",
messages=messages,
max_tokens=81920,
temperature=1.0,
top_p=0.95,
presence_penalty=1.5,
extra_body={
"top_k": 20,
"enable_thinking": True,
},
)
print("Chat response:", chat_response)
from openai import OpenAI
# Configured by environment variables
client = OpenAI()
messages = [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://qianwen-res.oss-accelerate.aliyuncs.com/Qwen3.5/demo/CI_Demo/mathv-1327.jpg"
}
},
{
"type": "text",
"text": "The centres of the four illustrated circles are in the corners of the square. The two big circles touch each other and also the two little circles. With which factor do you have to multiply the radii of the little circles to obtain the radius of the big circles?\nChoices:\n(A) $\\frac{2}{9}$\n(B) $\\sqrt{5}$\n(C) $0.8 \\cdot \\pi$\n(D) 2.5\n(E) $1+\\sqrt{2}$"
}
]
}
]
chat_response = client.chat.completions.create(
model="Qwen/Qwen3.5-2B",
messages=messages,
max_tokens=81920,
temperature=1.0,
top_p=0.95,
presence_penalty=1.5,
extra_body={
"top_k": 20,
},
)
print("Chat response:", chat_response)
In thinking mode, we have observed that when using the recommended sampling parameters, Qwen3.5-2B is more prone to entering thinking loops compared to other Qwen3.5 models, which may prevent it from terminating generation properly. We recommend further tuning the sampling parameters specific to your use case and utilizing the API's streaming generation mode (if supported) to enable timely detection and interruption of such anomalous generation behaviors.
Agentic Usage
Qwen3.5 excels in tool calling capabilities.
Qwen-Agent
We recommend using Qwen-Agent to quickly build Agent applications with Qwen3.5.
To define the available tools, you can use the MCP configuration file, use the integrated tool of Qwen-Agent, or integrate other tools by yourself.
import os
from qwen_agent.agents import Assistant
# Define LLM
# Using OpenAI-compatible API endpoint. The API backend should disable response parsers.
llm_cfg = {
# Use your own model service compatible with OpenAI API by vLLM/SGLang:
'model': 'Qwen/Qwen3.5-2B',
'model_type': 'qwenvl_oai',
'model_server': 'http://localhost:8000/v1', # api_base
'api_key': 'EMPTY',
'generate_cfg': {
'use_raw_api': True,
# Pass the parameter of whether to enable thinking mode in this way
# 'extra_body': {
# 'chat_template_kwargs': {'enable_thinking': True}
# },
},
}
# Define Tools
tools = [
{'mcpServers': { # You can specify the MCP configuration file
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/xxxx/Desktop"]
}
}
}
]
# Define Agent
bot = Assistant(llm=llm_cfg, function_list=tools)
# Streaming generation
messages = [{'role': 'user', 'content': 'Help me organize my desktop.'}]
for responses in bot.run(messages=messages):
pass
print(responses)
# Streaming generation
messages = [{'role': 'user', 'content': 'Develop a dog website and save it on the desktop'}]
for responses in bot.run(messages=messages):
pass
print(responses)
Qwen Code
Qwen Code is an open-source AI agent for the terminal, optimized for Qwen models. It helps you understand large codebases, automate tedious work, and ship faster.
For more information, please refer to Qwen Code.
Best Practices
To achieve optimal performance, we recommend the following settings:
Sampling Parameters:
We suggest using the following sets of sampling parameters depending on the mode and task type:
- Non-thinking mode for text tasks:
temperature=1.0,top_p=1.00,top_k=20,min_p=0.0,presence_penalty=2.0,repetition_penalty=1.0 - Non-thinking mode for VL tasks:
temperature=0.7,top_p=0.80,top_k=20,min_p=0.0,presence_penalty=1.5,repetition_penalty=1.0 - Thinking mode for text tasks:
temperature=1.0,top_p=0.95,top_k=20,min_p=0.0,presence_penalty=1.5,repetition_penalty=1.0 - Thinking mode for VL or precise coding (e.g., WebDev) tasks:
temperature=0.6,top_p=0.95,top_k=20,min_p=0.0,presence_penalty=0.0,repetition_penalty=1.0
- Non-thinking mode for text tasks:
For supported frameworks, you can adjust the
presence_penaltyparameter between 0 and 2 to reduce endless repetitions. However, using a higher value may occasionally result in language mixing and a slight decrease in model performance.
Adequate Output Length: We recommend using an output length of 32,768 tokens for most queries. For benchmarking on highly complex problems, such as those found in math and programming competitions, we suggest setting the max output length to 81,920 tokens. This provides the model with sufficient space to generate detailed and comprehensive responses, thereby enhancing its overall performance.
Standardize Output Format: We recommend using prompts to standardize model outputs when benchmarking.
- Math Problems: Include "Please reason step by step, and put your final answer within \boxed{}." in the prompt.
- Multiple-Choice Questions: Add the following JSON structure to the prompt to standardize responses: "Please show your choice in the
answerfield with only the choice letter, e.g.,"answer": "C"."
No Thinking Content in History: In multi-turn conversations, the historical model output should only include the final output part and does not need to include the thinking content. It is implemented in the provided chat template in Jinja2. However, for frameworks that do not directly use the Jinja2 chat template, it is up to the developers to ensure that the best practice is followed.
Long Video Understanding: To optimize inference efficiency for plain text and images, the
sizeparameter in the releasedvideo_preprocessor_config.jsonis conservatively configured. It is recommended to set thelongest_edgeparameter in the video_preprocessor_config file to 469,762,048 (corresponding to 224k video tokens) to enable higher frame-rate sampling for hour-scale videos and thereby achieve superior performance. For example,{"longest_edge": 469762048, "shortest_edge": 4096}Alternatively, override the default values via engine startup parameters. For implementation details, refer to: vLLM / SGLang.
Citation
If you find our work helpful, feel free to give us a cite.
@misc{qwen3.5,
title = {{Qwen3.5}: Towards Native Multimodal Agents},
author = {{Qwen Team}},
month = {February},
year = {2026},
url = {https://qwen.ai/blog?id=qwen3.5}
}
- Downloads last month
- 49