Welcome to the GitHub repository of the Qwen4.
The Qwen4 open model series shares the architecture and training techniques of Qwen4-Max, our ultra-sparse flagship built for long-horizon agentic applications and efficient inference that build upon Qwen3.8-Flash-Next.
Qwen4 features the following enhancement:
-
Efficient model architecture design: Built on a hybrid of linear attention and sparse attention, the Qwen4 architecture delivers outstanding efficiency in long-sequence scenarios — with faster inference and a drastically reduced cache footprint, enabling a native 1,000,000-token context window. Combined with n-gram embeddings, the architecture improves model quality without extra compute or accelerator memory overhead.
-
Significantly enhanced long-horizon agentic capabilities: Real-world productivity spans virtually every industry and profession. Throughout Qwen4's development, we went deep into the workflows of knowledge work, continually expanding the model's knowledge and capability boundaries, and achieved substantial progress in scenarios that demand sustained, long-term task delivery, with the goal of becoming a truly capable work assistant. Qwen4 also delivers stronger performance in coding for visual and creative deliverables, such as frontend development, 3D modeling, and game development with professional software & tools.
-
Improved token efficiency: Qwen4 substantially lowers the overall cost of task completion. Tasks require fewer interaction rounds, and within each round, thinking is markedly more concise across all effort levels, with the levels now clearly better separated. Paired with the architectural gains in inference efficiency, tasks complete faster and at lower cost.
In this release we are opening the weights of Qwen3.8-Flash-Next, a multimodal MoE model that also serves as an early preview of the architecture used in Qwen4. It plays the same role that Qwen3-Next played for Qwen3.5: the hybrid Gated DeltaNet + Gated Attention design introduced at that time has since been used across the Qwen3.5, Qwen3.6, Qwen3.7 and Qwen3.8 series. We are again releasing the architectural changes early, so that the community can examine them before the full Qwen4 model family is built on top of them.
Qwen3.8-Flash-Next upgrades the model systematically along four aspects — attention, residual, embedding and optimization — improving model capability while further optimizing computational efficiency, model capacity and training stability:
- Attention A GDN + QSA hybrid architecture. Gated DeltaNet (GDN) compresses the history efficiently; Qwen Sparse Attention (QSA) uses a compressed lightweight indexer to select the important context at micro-block granularity, substantially reducing the cost of attention on long sequences.
- Residual Gated Residual (GR) widens the residual stream into 4 branches and controls reads and writes with a dynamic gate, strengthening cross-layer information flow and training stability.
- Embedding N-gram Embedding looks up a table using the local context to scale model capacity with very little extra computation; the embedding table can be offloaded to host memory and overlapped with model computation through asynchronous prefetching.
- Optimization The Muon optimizer is used, refined around orthogonalization accuracy, the division of labour between Muon and AdamW, and the splitting of fused parameters, with the scaling law refitted for the new architecture.
Qwen3.8-Flash-Next features a 125B-parameter main model, supplemented by an additional 51B N-gram embeddings, with 6B parameters activated per token. Compared with Qwen3.7-Plus, Qwen3.8-Flash-Next substantially reduces both training and inference cost — training takes only about 1/9 as much, yet it delivers superior capabilities in coding and office tasks.
- 2026-12-04: Qwen4-35B-A3B is now available on Hugging Face Hub and ModelScope. Read more on the model card.
- 2026-08-26: We release Qwen3.8-Flash-Next. Read more on our blog.
The official model weights are released on:
- 🤗Hugging Face Hub: Most LLM frameworks and applications support downloading model files from Hugging Face Hub automatically by specifying the model ID, e.g.,
Qwen/Qwen4-35B-A3B. You can also download model files manually usinghuggingface downloadorgit clone. Please follow the instructions on the model page. - 🤖ModelScope: For users unable to access Hugging Face Hub, we strongly recommend using ModelScope.
For supported frameworks, you can download from ModelScope by setting environment variables, such as
SGLANG_USE_MODELSCOPE=trueorVLLM_USE_MODELSCOPE=true. You can also download model files manually usingmodelscope downloadorgit clone. Please follow the instructions on the model page.
Detailed evaluation results are reported in the Qwen3.8-Flash-Next blog.
You can try Qwen4 on our official sites and enjoy the native experience with extra features.
QwenCloud provides first-class support for Qwen4, which is compatible with various API specifications, including OpenAI and Anthropic, making it simple for you to try Qwen4 in your own applications.
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. Follow its documentation to get started!
Qwen3.8-Flash-Next now powers the newly-launched "Standard" mode on QwenWork. QwenWork is a one-stop AI working platform launched by Alibaba. Follow its documentation to get started!
transformers acts as the model-definition framework in the current open-weight LLM landscape.
It also includes functionalities for LLM inference and training. The addition of serving capabilities in transformers makes it much easier to integrate new models in your development. See the Serve CLI guide for more information.
llama.cpp enables LLM inference with minimal setup and state-of-the-art performance on a wide range of hardware.
llama.cpp supports the Qwen4 (text & vision).
Look for models ending with GGUF on Hugging Face Hub.
If you are running on Apple Silicon, mlx-vlm supports Qwen4 (vision + text).
Original checkpoints are compatible and can be converted.
You can also search for models ending with MLX on the Hugging Face Hub for ready-to-use quantized versions.
Unsloth contains a local UI to run and train LLMs and diffusion models, including Qwen4 and more. See the Qwen4 guide for running Qwen4 quants with Unsloth.
LiteRT-LM is a production-ready, high-performance LLM runtime.
See the Qwen4 guide for running Qwen4 with LiteRT-LM.
You can also look for models in the .litertlm format on the Hugging Face Hub.
Qwen4 is supported by multiple inference frameworks for production-level serving.
SGLang is a fast serving framework for large language models and vision language models. SGLang can be used to launch a server with an OpenAI-compatible API service.
See SGLang Cookbook on serving Qwen4-35B-A3B.
vLLM is a high-throughput and memory-efficient inference and serving engine for LLMs. vLLM can be used to launch a server with an OpenAI-compatible API service.
See vLLM Recipes on serving Qwen4-35B-A3B.
TokenSpeed is a speed-of-light LLM inference engine. TokenSpeed can be used to launch a server with an OpenAI-compatible API service.
See TokenSpeed Recipes on serving Qwen4.
We advise you to use training frameworks, including Unsloth, Swift, Llama-Factory, to finetune your models with SFT, DPO, GRPO, etc.
Please find the license file released with the model weights on Hugging Face Hub or ModelScope.
If you find our work helpful, feel free to give us a cite.
@techreport{qwen2026design,
title = {On the Design of {Qwen3.8-Next} Architecture: Evaluation, Efficiency, and Training Stability},
author = {{Qwen Team}},
institution = {Alibaba Group},
month = {August},
year = {2026}
}
@misc{qwen3.8flashnext,
title = {{Qwen3.8-Flash-Next}: A New Architecture, Towards Ultimate Cost-Efficiency},
author = {{Qwen Team}},
month = {August},
year = {2026},
url = {https://qwen.ai/blog?id=qwen3.8-flash-next}
}
@misc{qwen4-35ba3b,
title = {{Qwen4-35B-A3B}},
author = {{Qwen Team}},
month = {December},
year = {2026},
url = {https://huggingface.co/Qwen/Qwen4-35B-A3B}
}If you are interested in leaving a message to either our research team or product team, join our Discord or WeChat groups!

