开源项目 Hugging Face Models 2026-08-13T00:01 正文 ok 1731 words

Qwen/Qwen3.8-2.4T-A95B:总参数 2.4 万亿、激活参数 950 亿的开源推理模型

英文标题:🤗 Qwen/Qwen3.8-2.4T-A95B

Qwen 发布 Qwen3.8-2.4T-A95B,这是 Qwen 开源模型家族中能力最强的一代,首次将 Qwen-Max 级模型开放发布。该模型总参数量为 2.4 万亿、每次激活 950 亿参数,原生支持 26.2 万 token 上下文,并可扩展至 101 万 token。官方称其在编程、专业工作、研究及长程 Agent 任务上较 Qwen3.5 和 Qwen3.6 系列显著提升,并提供 `reasoning_effort` 与 `preserve_thinking` 控制能力。开发者可通过 vLLM、SGLang、TokenSpeed 等推理框架部署,也可使用兼容 OpenAI Chat Completions API 的方式接入。
打开原文相关 1.6 · 机会 2
media4.5 KB media2.8 KB media2.1 KB media406.5 KB

中文

Qwen3.8-2.4T-A95B

Qwen Studio

此仓库包含以 Hugging Face Transformers 格式提供的后训练模型权重和配置文件。

这些制品兼容 vLLM、SGLang、TokenSpeed 等框架。

对于希望获得托管式、可扩展推理服务而无需维护基础设施的用户,官方通过 Qwen Cloud 提供 Qwen API 服务。

其中,Qwen3.8-Max 是基于 Qwen3.8-2.4T-A95B 的官方版本,具备更多功能,例如视觉输入与非思考模式支持、默认 100 万上下文长度、官方内置工具等。更多信息请参阅 Qwen3.8-Max 概览。

继 Qwen3.5 和 Qwen3.6 系列在社区获得广泛采用后,我们很高兴推出 Qwen3.8——这是迄今为止 Qwen 开源模型家族中能力最强的一代。

Qwen3.8 首次将 Qwen-Max 级别模型开放发布。Qwen3.8 构建于 Qwen3.5 的架构基础之上,在编程、专业工作、研究以及长程 Agent 任务方面实现显著提升。除能够回答更困难的问题外,Qwen3.8 还被设计为能以更高可靠性完成复杂的多步骤任务。

Qwen3.8 核心亮点

Qwen3.8 具有以下增强能力:

  • 核心能力:在编程、专业工作、研究和长程 Agent 任务方面实现全面提升。
  • Agent 执行能力:具备更强的自主规划能力,并能更好地处理环境反馈,从而更可靠地端到端完成任务。
  • 下游兼容性:更广泛地支持主流 harness 和开发工具,更便于集成至现有技术栈。
  • 灵活的思考控制:可通过 reasoning_effort 调整推理深度,并通过 preserve_thinking 保留历史消息中的推理上下文。

更多详情请参阅我们的博客文章 Qwen3.8-Max。

模型概览

  • 类型:因果语言模型
  • 训练阶段:预训练与后训练
  • 语言模型
    • 参数量:总计 2.4T,每次激活 95B
    • 隐藏层维度:8192
    • Token 嵌入:248,320(填充后)
    • 层数:92
    • 隐藏层布局:23 × (3 × (Gated DeltaNet → MoE) → 1 × (Gated Attention → MoE))
    • Gated DeltaNet:
      • 线性注意力头数量:V 为 128,QK 为 16
      • 头维度:128
    • Gated Attention:
      • 注意力头数量:Q 为 64,KV 为 4
      • 头维度:256
      • 旋转位置嵌入维度:64
    • 混合专家(Mixture of Experts):
      • 专家数量:512
      • 激活专家数量:10 个路由专家 + 1 个共享专家
      • 专家中间层维度:2048
    • LM 输出:248,320(填充后)
    • MTP(Multi-Token Prediction,多 Token 预测):采用多步训练
  • 上下文长度:原生支持 262,144 token,可扩展至 1,010,000 token。

基准测试结果

| Opus 4.8 | Fable 5 | GPT 5.6 Sol(max) | Qwen3.7-Max | Qwen3.8-Max | |---|---|---|---|---|---| | 编程 Agent | | Terminal Bench 2.1 | 84.6 | 84.6 | 88.8 | 74.5 | 86.6 | | SWE-bench Pro | 69.2 | 80.0 | 64.6 | 60.6 | 67.7 | | DeepSWE 1.1 | 59.0 | 70.0 | 73.0 | 21.6 | 56.6 | | NL2Repo-Bench | 69.4 | -- | -- | 47.2 | 55.9 | | FrontierSWE | 70.0 | 88.8 | -- | 40.7 | 73.5 | | MLS-Bench-Lite | 42.8 | 49.9 | 46.2 | 31.7 | 41.0 | | PaperBench | 80.3 | 88.8 | 90.5 | 64.8 | 93.0 | | AndroidBench | 69.8 | 84.5 | 74.0 | 56.5 | 75.1 | | QwenSWEBench | 84.0 | 86.3 | 73.5 | 63.4 | 80.7 | | QwenQoderBench | 62.7 | 63.1 | 53.8 | 36.8 | 58.4 | | QwenReactBench | 1694 | 1770 | 1564 | 1538 | 1724 | | QwenSVGBench | 1648 | 1690 | 1758 | 1499 | 1713 | | 通用 Agent | | CoWorkBench | 72.3 | 75.9 | 71.5 | 64.6 | 74.8 | | WorkSpaceBench | 66.8 | 68.7 | 65.6 | 61.4 | 67.7 | | JobBench | 48.4 | 57.4 | 45.4 | 31.3 | 53.4 | | SkillsBench | 65.1 | 70.9 | 73.5 | 61.2 | 70.2 | | Agents' Last Exam(通过率 / 分数) | 27.0 / 45.1 | -- / -- | 30.6 / 53.6 | 11.8 / 31.1 | 27.0 / 52.4 | | Automation-Bench(Pass@1) | 27.2 | 29.1 | 29.7 | 14.2 | 27.3 | | Toolathlon Verified(Pass@1) | 76.2 | 77.9 | 74.9 | 49.7 | 72.5 | | WideSearch | 72.9 | 81.2 | -- | 75.2 | 81.9 | | HLE w/ tools | 57.9 | 64.5 | 58.0 | 53.5 | 56.2 | | 通用能力 | | GPQA Diamond | 92.0 | 92.6 | 94.1 | 92.4 | 92.6 | | HLE | 45.7 | 53.3 | 47.2 | 41.4 | 43.6 | | IFBench | 62.2 | 63.5 | 72.7 | 79.1 | 82.8 | | $OneMillion-Bench(专家评分) | 41.8 | 55.9 | 53.8 | 44.4 | 52.5 | | HealthBench | 52.4 | -- | 55.3 | 54.5 | 60.2 | | PLawBench | 69.6 | 70.2 | 72.3 | 58.9 | 73.2 | | PRBench-Legal | 52.7 | 57.6 | 57.6 | 48.5 | 57.6 | | PRBench-Finance | 51.9 | 55.8 | 55.5 | 46.8 | 58.3 | | MRCR v2 256K(8-needle) | 83.2 | -- | 93.8 | 86.7 | 92.9 | | LongBench v2 | 69.1 | -- | 67.1 | 65.3 | 66.3 |

1. Fable 5 的结果可能涉及回退(fallback)。 2. Terminal Bench 2.1:使用 Claude Code(avg@10)评估,超时时间为 5 小时,max_tokens=131,072。对于所有其他模型,我们报告各 harness 已公开的最高分:Claude Opus 4.8 和 Claude Fable 5 使用 Artificial Analysis 的 Terminus 2(https://artificialanalysis.ai/evaluations/terminalbench-v2-1);GPT-5.6 Sol 使用 Codex(https://openai.com/index/previewing-gpt-5-6-sol/)。 3. SWE-bench Pro:使用 Claude Code harness 评估,temp=1.0、top_p=0.95,上下文窗口为 256K。对存在问题的任务进行了修正,且所有基线模型均在经修订的基准上评估。 4. DeepSWE 1.1:使用 Claude Code 和 mini-SWE-agent harness 评估,temp=1.0、top_p=0.95,上下文窗口为 256K。报告两个 harness 中的最高得分;值得注意的是,Qwen3.8-Max 在 Claude Code 上表现最佳。 5. NL2Repo-Bench:使用 Claude Code harness 评估。为防止奖励投机(reward hacking),禁用了尝试访问特定仓库的 Bash 命令,例如 pip download、pip install 和 git clone。 6. FrontierSWE:使用 Claude Code harness 评估。其他所有可用的 MEAN@5 结果均取自截至 2026 年 8 月 3 日的 FrontierSWE 官方排行榜(https://www.frontierswe.com)。支配分数使用官方评估脚本根据原始分数重新计算。"--" 表示截至该日期尚无官方 MEAN@5 结果。 7. MLS-Bench-Lite:使用 Claude Code 评估,超时时间为 5 小时,max_tokens=131,072。其他所有模型分数均来自官方排行榜。 8. PaperBench:在 Code-Dev 模式下的 BasicAgent 设置中评估,由 Claude Opus 4.6 进行判定,取 3 次运行的平均值(每次运行最长 12 小时)。 9. AndroidBench:在包含 95 个任务的公开子集上评估,报告 avg@3 分数。 10. QwenSWEBench:用于评估模型软件工程能力的内部编程基准。使用 Claude Code harness 评估。报告 avg@3,超时时间为 8 小时,max_tokens=32,768、temperature=1.0,上下文窗口为 256K token。 11. QwenQoderBench:用于评估 Qoder 用户体验的内部编程基准。使用 Claude Code harness 评估。报告 avg@5,超时时间为 6 小时,max_tokens=32,768、temperature=1.0,上下文窗口为 256K token。 12. QwenReactBench:内部 React 项目构建基准,使用 Claude Code 作为 harness,提供双语(英语/中文)任务,覆盖 7 个类别;采用自动渲染 + 多模态评审,并使用 BT/Elo 评分。 13. QwenSVGBench:内部 SVG 代码生成基准;提供双语(英语/中文)任务,采用自动渲染 + 多模态评审,并使用 BT/Elo 评分。 14. CoWorkBench:内部协作工作基准,用于评估涵盖计算机科学、金融、法律、医疗及其他生产力领域的长程任务。 15. SkillsBench:在公开 SkillsBench v1.1 基准的 87 个任务上评估,报告每项任务 3 次运行的平均分。Opus 4.8 和 Fable 5 使用 Claude Code 评估;GPT-5.6 Sol 使用 Codex 评估;Qwen 系列使用 OpenCode 评估。所有结果均来自我们的内部测试。 16. Automation-Bench:在包含 600 个任务的公开子集上评估。 17. WideSearch:外部模型使用 Claude Code harness 评估,我们的模型使用 Qwen-Agent harness 评估,报告 4 次运行的平均 item-F1。 18. $OneMillion-Bench:使用 gemini-3.1-pro-preview 评估。 19. PLawBench:使用 gemini-3.1-pro-preview 评估。 20. 空单元格(--):分数尚未可用或不适用。

快速开始

为实现简化集成,我们建议通过 API 使用 Qwen3.8。

部署 Qwen3.8

不同框架之间的推理效率和吞吐量存在显著差异。我们建议使用最新版本的框架,以确保最佳性能和兼容性。对于生产工作负载或高吞吐量场景,建议使用 SGLang、vLLM 或 TokenSpeed 等专用服务引擎。

Qwen3.8 可通过主流推理框架部署,例如:

API 使用

Qwen3.8-2.4T-A95B 是一个纯文本模型,所有交互都必须使用思考模式。不支持多模态输入,且无法关闭思考。每个响应都会在最终输出之前,自动以包含在 <think>\n...</think>\n\n 中的推理内容开头。

我们建议生成时使用以下采样参数:

  • temperature=1.0, top_p=0.95, top_k=20, min_p=0.0, presence_penalty=0.0, repetition_penalty=1.0

请注意,不同推理框架对采样参数的支持情况有所不同。

Qwen3.8 官方支持 reasoning_effort,可用于调整推理深度并控制成本:

  • xhigh(默认):适用于需要全面分析的复杂任务
  • medium:平衡准确性与速度
  • low:以速度和成本为优先的高效推理

此外,preserve_thinking 默认对所有工作负载启用,以提供最佳的开箱即用体验。

Chat Completions API

Chat Completions API 可与大多数推理框架以及 Qwen Cloud 配合使用。开始前,请确保已安装 OpenAI Python SDK,并已配置 API 密钥和 API 基础 URL,例如:

pip install -U openai

# Set the following accordingly
export OPENAI_BASE_URL='your-base-url'
export OPENAI_API_KEY='your-api-key'
纯文本输入
from openai import OpenAI

client = OpenAI()

messages = [{"role": "user", "content": "Write a Python function to merge two sorted linked lists."}]

completion = client.chat.completions.create(
    model="Qwen/Qwen3.8-2.4T-A95B",
    messages=messages,
    extra_body={
        "chat_template_kwargs": {
            "enable_thinking": True,  
            "preserve_thinking": True, 
        },
    },
    reasoning_effort="xhigh",  
    stream=True,
    stream_options={"include_usage": True},
)

reasoning_content = ""
answer_content = ""
is_answering = False
print("\n" + "=" * 20 + "Reasoning" + "=" * 20 + "\n")

for chunk in completion:
    if not chunk.choices:
        print("\nUsage:")
        print(chunk.usage)
        continue

    delta = chunk.choices[0].delta

    if hasattr(delta, "reasoning_content") and delta.reasoning_content is not None:
        if not is_answering:
            print(delta.reasoning_content, end="", flush=True)
        reasoning_content += delta.reasoning_content

    if hasattr(delta, "content") and delta.content:
        if not is_answering:
            print("\n" + "=" * 20 + "Answer" + "=" * 20 + "\n")
            is_answering = True
        print(delta.content, end="", flush=True)
        answer_content += delta.content

如果使用 Qwen Cloud 的 API,除修改 model 外,请传入 extra_body={"enable_thinking": True, "preserve_thinking": True},而不是 extra_body={"chat_template_kwargs": {"enable_thinking": True, "preserve_thinking": True}}。

最佳实践

为获得最佳性能,我们建议采用以下设置:

  1. 采样参数:

    • 建议使用以下采样参数:
      • temperature=1.0、top_p=0.95、top_k=20、min_p=0.0、presence_penalty=0.0、repetition_penalty=1.0
    • 对于支持的框架,可将 presence_penalty 参数调整至 0 到 2 之间,以减少无休止的重复。但使用较高值偶尔可能导致语言混杂,并使模型性能略有下降。
  2. 充足的输出长度:为优化 Agent 任务的性能,我们建议分配足够的输出长度,使模型能够生成详细且全面的回答。对于支持分别设置内部推理和最终输出 token 上限的框架,建议在 100 万上下文长度内采用以下配置:

    • **推理内容:**将最大输出长度设为 262,144 token。
    • **最终回答:**将最大输出长度设为 131,072 token。

这些设置可为复杂推理提供所需容量,同时为高质量的最终交付内容确保充足空间。

引用

如果您认为我们的工作有所帮助,欢迎引用。

@misc{qwen38,
    title = {{Qwen3.8-Max}: A New Bar for Coding and Cowork},
    url = {https://qwen.ai/blog?id=qwen3.8},
    author = {{Qwen Team}},
    month = {August},
    year = {2026}
}

English / 原文

Qwen3.8-2.4T-A95B

Qwen Studio

This repository contains model weights and configuration files for the post-trained model in the Hugging Face Transformers format.

These artifacts are compatible with vLLM, SGLang, TokenSpeed, etc.

For users seeking managed, scalable inference without infrastructure maintenance, the official Qwen API service is provided by Qwen Cloud.

In particular, Qwen3.8-Max is the official version based on Qwen3.8-2.4T-A95B with more features, such as vision input & non-thinking support, 1M context length by default, official built-in tools, etc. For more information, please refer to the Qwen3.8-Max Overview.

Following the widespread community adoption of the Qwen3.5 and Qwen3.6 series, we are pleased to introduce Qwen3.8, the most capable generation in the Qwen open-model family to date.

For the first time, Qwen3.8 brings a Qwen-Max-class model to open release. Built on the architectural foundation of Qwen3.5, Qwen3.8 delivers substantial gains across coding, professional work, research, and long-horizon agentic tasks. Beyond answering harder questions, Qwen3.8 is designed to carry complex, multi-step tasks through to completion with greater reliability.

Qwen3.8 Highlights

Qwen3.8 features the following enhancements:

  • Core Capabilities : Comprehensive improvements across coding, professional work, research, and long-horizon agentic tasks.
  • Agent Execution : Stronger autonomous planning and better handling of environment feedback, leading to more reliable end-to-end task completion.
  • Downstream Compatibility : Broader support for popular harnesses and development tools, making it easier to integrate into your existing stack.
  • Flexible Thinking Control : Reasoning depth can be tuned with reasoning_effort, and reasoning context from historical messages is retained via preserve_thinking.

For more details, please refer to our blog post Qwen3.8-Max.

Model Overview

  • Type: Causal Language Model
  • Training Stage: Pre-training & Post-training
  • Language Model
    • Number of Parameters: 2.4T in total and 95B activated
    • Hidden Dimension: 8192
    • Token Embedding: 248,320 (Padded)
    • Number of Layers: 92
    • Hidden Layout: 23 × (3 × (Gated DeltaNet → MoE) → 1 × (Gated Attention → MoE))
    • Gated DeltaNet:
      • Number of Linear Attention Heads: 128 for V and 16 for QK
      • Head Dimension: 128
    • Gated Attention:
      • Number of Attention Heads: 64 for Q and 4 for KV
      • Head Dimension: 256
      • Rotary Position Embedding Dimension: 64
    • Mixture of Experts:
      • Number of Experts: 512
      • Number of Activated Experts: 10 Routed + 1 Shared
      • Expert Intermediate Dimension: 2048
    • LM Output: 248,320 (Padded)
    • MTP (Multi-Token Prediction): trained with multiple steps
  • Context Length: 262,144 natively and extensible up to 1,010,000 tokens.

Benchmark Results

| Opus 4.8| Fable 5| GPT 5.6 Sol (max)| Qwen3.7-Max| Qwen3.8-Max
---|---|---|---|---|---
Coding Agent
Terminal Bench 2.1 | 84.6 | 84.6 | 88.8 | 74.5 | 86.6
SWE-bench Pro | 69.2 | 80.0 | 64.6 | 60.6 | 67.7
DeepSWE 1.1 | 59.0 | 70.0 | 73.0 | 21.6 | 56.6
NL2Repo-Bench | 69.4 | -- | -- | 47.2 | 55.9
FrontierSWE | 70.0 | 88.8 | -- | 40.7 | 73.5
MLS-Bench-Lite | 42.8 | 49.9 | 46.2 | 31.7 | 41.0
PaperBench | 80.3 | 88.8 | 90.5 | 64.8 | 93.0
AndroidBench | 69.8 | 84.5 | 74.0 | 56.5 | 75.1
QwenSWEBench | 84.0 | 86.3 | 73.5 | 63.4 | 80.7
QwenQoderBench | 62.7 | 63.1 | 53.8 | 36.8 | 58.4
QwenReactBench | 1694 | 1770 | 1564 | 1538 | 1724
QwenSVGBench | 1648 | 1690 | 1758 | 1499 | 1713
General Agent
CoWorkBench | 72.3 | 75.9 | 71.5 | 64.6 | 74.8
WorkSpaceBench | 66.8 | 68.7 | 65.6 | 61.4 | 67.7
JobBench | 48.4 | 57.4 | 45.4 | 31.3 | 53.4
SkillsBench | 65.1 | 70.9 | 73.5 | 61.2 | 70.2
Agents' Last Exam (Pass / Score) | 27.0 / 45.1 | -- / -- | 30.6 / 53.6 | 11.8 / 31.1 | 27.0 / 52.4
Automation-Bench (Pass@1) | 27.2 | 29.1 | 29.7 | 14.2 | 27.3
Toolathlon Verified (Pass@1) | 76.2 | 77.9 | 74.9 | 49.7 | 72.5
WideSearch | 72.9 | 81.2 | -- | 75.2 | 81.9
HLE w/ tools | 57.9 | 64.5 | 58.0 | 53.5 | 56.2
General Capabilities
GPQA Diamond | 92.0 | 92.6 | 94.1 | 92.4 | 92.6
HLE | 45.7 | 53.3 | 47.2 | 41.4 | 43.6
IFBench | 62.2 | 63.5 | 72.7 | 79.1 | 82.8
$OneMillion-Bench (expert score) | 41.8 | 55.9 | 53.8 | 44.4 | 52.5
HealthBench | 52.4 | -- | 55.3 | 54.5 | 60.2
PLawBench | 69.6 | 70.2 | 72.3 | 58.9 | 73.2
PRBench-Legal | 52.7 | 57.6 | 57.6 | 48.5 | 57.6
PRBench-Finance | 51.9 | 55.8 | 55.5 | 46.8 | 58.3
MRCR v2 256K (8-needle) | 83.2 | -- | 93.8 | 86.7 | 92.9
LongBench v2 | 69.1 | -- | 67.1 | 65.3 | 66.3

1. Fable5 results may involve fallbacks.
2. Terminal Bench 2.1: Evaluated with Claude Code (avg@10), using a 5-hour timeout and max_tokens=131,072. For all other models, we report the best published score across harnesses: Claude Opus 4.8 and Claude Fable 5 with Terminus 2 from Artificial Analysis (https://artificialanalysis.ai/evaluations/terminalbench-v2-1); GPT-5.6 Sol with Codex (https://openai.com/index/previewing-gpt-5-6-sol/).
3. SWE-bench Pro: Evaluated with the Claude Code harness, temp=1.0, top_p=0.95, and a 256K context window. Problematic tasks corrected and all baselines evaluated on the refined benchmark.
4. DeepSWE 1.1: Evaluated with the Claude Code and mini-SWE-agent harnesses, temp=1.0, top_p=0.95, and a 256K context window. We report the highest score among both harnesses; notably, Qwen3.8-Max performs best on Claude Code.
5. NL2Repo-Bench: Evaluated with the Claude Code harness. To prevent reward hacking, we disable Bash commands that attempt to access the specific repository, such as pip download, pip install, and git clone.
6. FrontierSWE: Evaluated with the Claude Code harness. All other available MEAN@5 results are taken from the official FrontierSWE leaderboard (https://www.frontierswe.com) as of August 3, 2026. Dominance scores are recomputed from the raw scores using the official evaluation script. "--" indicates that no official MEAN@5 result was available as of that date.
7. MLS-Bench-Lite: Evaluated with Claude Code using a 5-hour timeout and max_tokens=131,072. All other model scores are taken from the official leaderboard.
8. PaperBench: Evaluated in the BasicAgent setting under Code-Dev mode, judged by Claude Opus 4.6, and averaged over 3 runs (max 12 hours per run).
9. AndroidBench: Evaluated on the 95-task public subset, reporting avg@3 scores.
10. QwenSWEBench: Inhouse coding benchmark to evaluate models' software engineering capabilities. Evaluated with the Claude Code harness. Reporting avg@3 with an 8-hour timeout, max_tokens=32,768, temperature=1.0, and a 256K-token context window.
11. QwenQoderBench: Inhouse coding benchmark to evaluate user experience on Qoder. Evaluated with the Claude Code harness. Reporting avg@5 with a 6-hour timeout, max_tokens=32,768, temperature=1.0, and a 256K-token context window.
12. QwenReactBench: Inhouse React project building benchmark using Claude Code as the harness, bilingual (EN/CN), 7 categories; auto-render + multimodal judge; BT/Elo rating.
13. QwenSVGBench: Inhouse SVG code generation benchmark; bilingual (EN/CN), auto-render + multimodal judge; BT/Elo rating.
14. CoWorkBench: Inhouse cowork benchmark for evaluating long-horizon tasks across computer science, finance, law, medical, and other productivity domains.
15. SkillsBench: Evaluated on the public SkillsBench v1.1 benchmark across 87 tasks, reporting the average score over three runs per task. Opus 4.8 and Fable 5 are evaluated on Claude Code; GPT-5.6 Sol is evaluated on Codex; the Qwen-series are evaluated on OpenCode. All results are from our own testing.
16. Automation-Bench: Evaluated on the 600-task public subset.
17. WideSearch: Evaluated with the Claude Code harness for external models and the Qwen-Agent harness for ours, reporting the average item-F1 over four runs.
18. $OneMillion-Bench: Evaluated using gemini-3.1-pro-preview.
19. PLawBench: Evaluated using gemini-3.1-pro-preview.
20. Empty cells (--): Scores are not yet available or are not applicable.

Quickstart

For streamlined integration, we recommend using Qwen3.8 via APIs.

Serving Qwen3.8

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, vLLM, or TokenSpeed are recommended.

Qwen3.8 can be deployed with popular inference frameworks, e.g.:

API Usage

Qwen3.8-2.4T-A95B is a text-only model that requires thinking mode for all interactions. Multimodal inputs are not supported, and thinking cannot be disabled. Every response will automatically begin with reasoning enclosed in <think>\n...</think>\n\n before the final output.

We recommend using the following set of sampling parameters for generation:

  • temperature=1.0, top_p=0.95, top_k=20, min_p=0.0, presence_penalty=0.0, repetition_penalty=1.0

Please note that the support for sampling parameters varies according to inference frameworks.

Qwen3.8 comes with official support for reasoning_effort, which can be used to adjust reasoning depth and control cost:

  • xhigh (default): for complex tasks demanding thorough analysis
  • medium: balancing accuracy and speed
  • low: efficient reasoning optimizing for speed and cost

In addition, preserve_thinking is enabled by default for all workloads for the best out-of-the-box experience.

Chat Completions API

The Chat Completions API can be used with most inference frameworks, as well as Qwen Cloud. Before starting, make sure the OpenAI Python SDK is installed and the API key and the API base URL are configured, e.g.:

pip install -U openai

# Set the following accordingly
export OPENAI_BASE_URL='your-base-url'
export OPENAI_API_KEY='your-api-key'
Text-Only Input
from openai import OpenAI

client = OpenAI()

messages = [{"role": "user", "content": "Write a Python function to merge two sorted linked lists."}]

completion = client.chat.completions.create(
    model="Qwen/Qwen3.8-2.4T-A95B",
    messages=messages,
    extra_body={
        "chat_template_kwargs": {
            "enable_thinking": True,  
            "preserve_thinking": True, 
        },
    },
    reasoning_effort="xhigh",  
    stream=True,
    stream_options={"include_usage": True},
)

reasoning_content = ""
answer_content = ""
is_answering = False
print("\n" + "=" * 20 + "Reasoning" + "=" * 20 + "\n")

for chunk in completion:
    if not chunk.choices:
        print("\nUsage:")
        print(chunk.usage)
        continue

    delta = chunk.choices[0].delta

    if hasattr(delta, "reasoning_content") and delta.reasoning_content is not None:
        if not is_answering:
            print(delta.reasoning_content, end="", flush=True)
        reasoning_content += delta.reasoning_content

    if hasattr(delta, "content") and delta.content:
        if not is_answering:
            print("\n" + "=" * 20 + "Answer" + "=" * 20 + "\n")
            is_answering = True
        print(delta.content, end="", flush=True)
        answer_content += delta.content

If you are using APIs from Qwen Cloud, in addition to changing model, please pass extra_body={"enable_thinking": True, "preserve_thinking": True} instead of extra_body={"chat_template_kwargs": {"enable_thinking": True, "preserve_thinking": True}}.

Best Practices

To achieve optimal performance, we recommend the following settings:

  1. Sampling Parameters :

    • We suggest using the following set of sampling parameters:
      • temperature=1.0, top_p=0.95, top_k=20, min_p=0.0, presence_penalty=0.0, repetition_penalty=1.0
    • For supported frameworks, you can adjust the presence_penalty parameter between 0 and 2 to reduce endless repetition. However, using a higher value may occasionally result in language mixing and a slight decrease in model performance.
  2. Adequate Output Length : To optimize performance on agentic tasks, we recommend allocating sufficient output length to allow the model to generate detailed and comprehensive responses. For frameworks that support separate token limits for internal reasoning and final outputs, we suggest the following configuration within the 1M context length:

    • Reasoning Content: Set the maximum output length to 262,144 tokens.
    • Final Response: Set the maximum output length to 131,072 tokens.

These settings provide the necessary capacity for complex reasoning while ensuring ample space for high-quality final deliverables.

Citation

If you find our work helpful, feel free to give us a cite.

@misc{qwen38,
    title = {{Qwen3.8-Max}: A New Bar for Coding and Cowork},
    url = {https://qwen.ai/blog?id=qwen3.8},
    author = {{Qwen Team}},
    month = {August},
    year = {2026}
}