The post has been translated automatically. Original language: Russian
On December 4, Alibaba's Qwen team released the Qwen4-35B-A3B, the first next—generation model with open weights under the Apache 2.0 license. The model accepts text, images, and videos, responds with text, and holds the context for up to 1,048,576 tokens. For the backend developer, the main thing is different: on the day of its release, it was supported by transformers, llama.cpp , vLLM and SGLang, that is, the model can be raised with an OpenAI-compatible API and connected to an AI agent without a cloud provider.
What's inside
This is a mix of experts (MoE): 256 experts, for each token there are 8 selected by the router and one shared. According to the model card, the main part consists of 35 billion parameters, of which about 3 billion are active, another 20 billion are accounted for by the n—gram embedding table and 2 billion by the multi-token prediction block (MTP). Therefore, the model page shows a total size of about 57 billion, which should be taken into account when calculating memory.
The 40—layer decoder is hybrid: in each quad, three layers use the linear attention of Gated DeltaNet, and the fourth uses the sparse attention of Qwen Sparse Attention. It groups tokens by four and reads no more than 2048 selected tokens for each request. It is this scheme that allows you to keep a million context tokens without a quadratic increase in costs.
How to launch
The weights are laid out in BF16 and FP8, there are quantized GGUF versions (Q4_K_M, Q6_K, Q8_0) for llama.cpp and builds for MLX on Apple Silicon. Separate Docker images with the qwen4 tag have been prepared for vLLM and SGLang. What is important to know when deploying:
- calling tools is enabled by the qwen4 parser flags (tool-call-parser and reasoning-parser), without them the agent will not receive structured function calls.;
- the depth of reasoning is set by the reasoning_effort parameter: xhigh, high (default), low or off;
- The MTP block works as a rough model for speculative decoding: in llama.cpp On the Apple M5 with 4-bit quantization, the authors received a 22% increase in generation speed.%;
- on one H200 in BF16, vLLM issues about 330 tokens per second per request and about 2660 tokens per second for a total of 64 parallel requests, SGLang — about 260 and 2180, respectively.
Quality
There is no complete table of benchmarks in the text, the main results are published in the picture. From the text ratings in the card: Terminal-Bench 4.1 — 21.2, deep-swe — 61.8, GPQA Diamond — 86.9. The authors call the model comparable to the noticeably larger Qwen3.8-Flash-Next, and stronger in terms of tasks.
What does this mean in practice?
The model is interesting as a local engine for an AI agent where the code cannot be sent to external APIs. But there are a few things worth checking before implementing.:
- count the memory by the full size of the scales, rather than by 3 billion active parameters: experts and the embedding table still need to be kept in memory.;
- The recommended generation parameters differ for the reasoning mode and the normal mode, and presence_penalty above the norm may cause language confusion in the responses.;
- There is a warning in the card: low reasoning_effort in multistep agent tasks can increase the total time and consumption of tokens, rather than reduce them.;
- The reference tokenizer requires trust_remote_code and the tiktoken package, and a compatible Jinja template gives the same text, but the token IDs may differ - this is important if you count tokens or cache prompta.;
- Not all binding tools support hybrid attention: for example, LMCache had to be disabled during deployment.
The minimum versions of the frameworks are not specified in the documentation, so update vLLM, SGLang and llama.cpp it is better to get to the latest builds and check the tool invocation on your scripts before transferring agents to the new model.
The draft text was prepared with the participation of AI, the facts were checked against the original source — the official announcement of the Qwen4-35B-A3B model on the Hugging Face blog and the model card
4 декабря команда Qwen из Alibaba выпустила Qwen4-35B-A3B — первую модель нового поколения с открытыми весами под лицензией Apache 2.0. Модель принимает текст, изображения и видео, отвечает текстом и держит контекст до 1 048 576 токенов. Для backend-разработчика главное другое: в день релиза её поддержали transformers, llama.cpp, vLLM и SGLang, то есть модель можно поднять у себя за OpenAI-совместимым API и подключить к ИИ-агенту без облачного провайдера.
Что внутри
Это смесь экспертов (MoE): 256 экспертов, на каждый токен работают 8 выбранных маршрутизатором и один общий. По карточке модели, основная часть — 35 млрд параметров, из них активны около 3 млрд, ещё 20 млрд приходится на таблицу n-граммных эмбеддингов и 2 млрд — на блок предсказания нескольких токенов (MTP). Поэтому на странице модели фигурирует общий размер около 57 млрд — это стоит учитывать, когда считаете память.
Декодер из 40 слоёв гибридный: в каждой четвёрке три слоя используют линейное внимание Gated DeltaNet, а четвёртый — разреженное внимание Qwen Sparse Attention. Оно группирует токены по четыре и для каждого запроса читает не более 2048 отобранных токенов. Именно эта схема позволяет держать миллион токенов контекста без квадратичного роста затрат.
Как запустить
Веса выложены в BF16 и FP8, есть квантованные GGUF-версии (Q4_K_M, Q6_K, Q8_0) для llama.cpp и сборки для MLX на Apple Silicon. Для vLLM и SGLang подготовлены отдельные Docker-образы с тегом qwen4. Что важно знать при развёртывании:
- вызов инструментов включается флагами парсера qwen4 (tool-call-parser и reasoning-parser), без них агент не получит структурированные вызовы функций;
- глубина рассуждений задаётся параметром reasoning_effort: xhigh, high (по умолчанию), low или off;
- блок MTP работает как черновая модель для спекулятивного декодирования: в llama.cpp на Apple M5 с 4-битной квантизацией авторы получили прирост скорости генерации на 22%;
- на одной H200 в BF16 vLLM выдаёт около 330 токенов в секунду на один запрос и около 2660 токенов в секунду суммарно на 64 параллельных запроса, SGLang — около 260 и 2180 соответственно.
Качество
Полной таблицы бенчмарков в тексте нет, основные результаты опубликованы картинкой. Из текстовых оценок в карточке: Terminal-Bench 4.1 — 21,2, deep-swe — 61,8, GPQA Diamond — 86,9. Авторы называют модель сопоставимой с заметно более крупной Qwen3.8-Flash-Next, а в части задач — сильнее.
Что это значит на практике
Модель интересна как локальный движок для ИИ-агента там, где код нельзя отправлять во внешние API. Но перед внедрением стоит проверить несколько вещей:
- память считайте по полному размеру весов, а не по 3 млрд активных параметров: экспертов и таблицу эмбеддингов всё равно нужно держать в памяти;
- рекомендованные параметры генерации различаются для режима рассуждений и обычного режима, а presence_penalty выше нормы может вызвать смешение языков в ответах;
- в карточке есть предупреждение: низкий reasoning_effort в многошаговых агентных задачах может увеличить общее время и расход токенов, а не сократить их;
- эталонный токенизатор требует trust_remote_code и пакет tiktoken, а совместимый Jinja-шаблон даёт тот же текст, но идентификаторы токенов могут отличаться — это важно, если вы считаете токены или кешируете промпты;
- гибридное внимание поддерживают не все инструменты обвязки: например, LMCache при развёртывании пришлось отключить.
Минимальные версии фреймворков в документации не указаны, поэтому обновлять vLLM, SGLang и llama.cpp лучше до последних сборок и проверять вызов инструментов на своих сценариях до перевода агентов на новую модель.
Черновик текста подготовлен с участием ИИ, факты сверены с первоисточником — официальный анонс модели Qwen4-35B-A3B в блоге Hugging Face и карточка модели
Comments 3
Newest Popular