Chat template named "Qwen4-35B-A3B" in llama.cpp

At 2:59 a.m. Dec. 4 Japan time, a PR (pull request, a proposed change) titled "model: qwen4" was opened in the official repository of "llama.cpp," open-source software for running generative AI models on local machines such as PCs. The PR was merged into the main branch (master) at 3:18 a.m. the same day. Its description says the change matches Hugging Face Transformers PR #51678.

It adds 451 lines and removes 10 across nine files. It lets llama.cpp convert "Qwen4," a next-generation model from China's Alibaba, and "Qwen4 MoE," its mixture-of-experts version, into the file format llama.cpp uses. One of the newly added files is a chat template, "Qwen4-35B-A3B.jinja."

The name "Qwen4-35B-A3B" did not appear in the Transformers code found the day before. Alibaba has not announced a model by this name, and the PR does not describe its scale.

The template accepts image, video and audio items in addition to text, and also handles tool calls and a setting for whether to show the reasoning process. A comment at the top of the file says the template is for compatibility only.

The account that opened the PR is listed as a "COLLABORATOR" on the repository, and the affiliation field of its public profile reads "@huggingface." ORIENS has not confirmed this with the person or the company.

Included in a pre-release build now available

llama.cpp automatically builds and distributes a new version each time a change enters the main branch. Build "b12969," which targets the merged commit, was published as a pre-release at 4:27 a.m. the same day. Its release notes include "model: qwen4 (#33626)."

Support on the software side has reached a distributed build, but the model weights needed to run it have not been released. When ORIENS checked on the morning of Dec. 4, Qwen's organization on Hugging Face had no model with "Qwen4" in its name.

Draft PR for "Qwen4 MoE" in vLLM

At 3:41 a.m. the same day, a PR titled "[Model] Add Qwen4 MoE" was opened in the official repository of "vLLM," inference software for serving models to large numbers of users on servers. It adds 5,463 lines and removes 835 across 92 files. The PR is a draft and has not been merged.

According to the description, it adds Qwen4MoeForConditionalGeneration (model type qwen4_moe) on top of the implementation of "Qwen4Exp," an experimental design already in vLLM. In the "Qwen Sparse Attention (QSA)" layers of Qwen4 MoE, it allows the KV cache (memory that keeps intermediate results during a conversation) to be stored in the 4-bit "NVFP4" format. It also includes the Qwen4 chat format, components that parse the reasoning process and tool calls, and tuning for NVIDIA and AMD chips.

The added documentation says only models in the Qwen4MoeForConditionalGeneration format support the NVFP4 KV cache, while the earlier Qwen4Exp formats support BF16 or FP8. The test code uses the name "Qwen/Qwen4-MoE" as an example, but the names 27B and 35B-A3B do not appear.

The account that opened the PR is listed as a "CONTRIBUTOR," and its public profile lists no affiliation.

The vLLM PR spread after an X account that automatically detects AI model releases and leaks posted about it at 4:05 a.m. The post is not an announcement from Alibaba or the developers.

Open-weight Qwen4 MoE and Qwen4-27B just surfaced in vLLM and Hugging Face Transformers ahead of release. vLLM opened a 92-file PR adding Qwen4MoeForConditionalGeneration right after Transformers merged Qwen4 MoE and a dense Qwen4-27B config this morning. Neither model is live on Hugging Face yet. What is new in Qwen4 MoE: - Native text, image, and video multimodal support - Gated DeltaNet + Qwen Sparse Attention + Per-Layer Embeddings (Engram-style n-gram layers) - QAT NVFP4 KV cache for sparse attention and MTP drafts (exclusive to Qwen4 MoE, not Qwen4-Exp) - New native Qwen4 chat renderer, reasoning parser, and tool-call parser

"Qwen4-27B" in Transformers the day before

At 10:03 p.m. Dec. 3, code and documentation supporting Qwen4 and Qwen4 MoE had been merged into the main branch of the official Hugging Face Transformers repository. The usage examples in the documentation load a model named "Qwen/Qwen4-27B" and use images and video as input in addition to text.

As of the morning of Dec. 4, the latest Transformers release was still v5.25.1, from before the merge, and the Qwen4 code is not in any released version. Of the three pieces of software, only llama.cpp's pre-release build has Qwen4 support in a distributed version.

Alibaba officially launched its flagship "Qwen4-Max" on Nov. 16 and at the time said it would release weights for smaller Qwen4 models, but did not give model names or timing. For the 27B, the 35B-A3B and the MoE version alike, the breakdown of scale, performance, license and release timing are unknown.

Timeline of Qwen 4 (Japan time). Based on the official llama.cpp, vLLM and Transformers repositories and previous ORIENS reports
  1. Attendees report Max, Plus, Flash and 27B on presentation slidesReport
  2. Qwen4-Max officially launched; release of weights for smaller models promisedOfficial
  3. Qwen4 support code in Transformers main, with "Qwen/Qwen4-27B" in usage examplesLeak
  4. Qwen4 support in llama.cpp with a "Qwen4-35B-A3B" chat template; included in pre-release build b12969Leak
  5. Draft PR for "Qwen4 MoE" support in vLLM (not merged)Leak