> For the complete documentation index, see [llms.txt](https://unsloth.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unsloth.ai/docs/zh/mo-xing/qwen3.8.md).

# Qwen3.8：如何本地运行

在本地环境中运行 Qwen3.8 量化模型的指南，包括 Qwen3.8-27B。

Qwen3.8 是 Qwen 的新模型家族，包含 Qwen3.8-**27B**，Qwen3.8-**2.4T-A95B** 以及 Qwen3.8-**Max**。Qwen3.8-27B 具备 **视觉** 和推理能力，拥有 **256K 上下文** 窗口，并可在以下环境本地运行： **17GB RAM/VRAM** 配置。Qwen3.8 在智能体编码、视觉和聊天任务方面表现出色，现在还可以通过 Unsloth GGUF、NVFP4 以及 [Unsloth Desktop](#run-qwen3.8-in-unsloth-desktop)运行。Qwen3.8-2.4T-A95B 是一个拥有 2.4T 参数（95B 激活）的模型，可与 GPT-5.6 Sol 相媲美。

**8 月 19 日更新：** Qwen3.8-27B GGUF 现在使用 [Unsloth Dynamic V3.0](/docs/zh/ji-chu/dynamic-3.0-ggufs.md) ，在相同大小下可获得高出 10% 的准确率，整体表现大幅优于其他方案。

{% columns %}
{% column %} <a href="/pages/d03b47babbad2abc249a0979b2d44af1f02bbd20#run-qwen3.8-guide" class="button primary">Qwen3.8 使用指南</a><a href="https://unsloth.ai/download" class="button primary">下载 Unsloth</a>

感谢 Qwen 在第一时间开放访问。Unsloth 量化还包括：

* **开发者角色支持** 用于 Codex 等智能体工具
* [已启用 MTP](/docs/zh/mo-xing/mtp.md) 用于快速推理
* **工具调用：** 改进了嵌套对象的解析，使工具更容易成功

完整精度的 Qwen3.8-2.4T-A95B 需要 4.9TB 存储和 1-bit [Unsloth](https://github.com/unslothai/unsloth) Dynamic GGUF 仅需 **397GB（缩小 91%）**，而更大的 IQ1\_S 需要 508GB。
{% endcolumn %}

{% column %}

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F6aw6IjO7lnYJhSyzXYwq%2Fvolcano%20qwen.gif?alt=media&amp;token=94e56117-d10d-45e8-82dc-3e134b2b9359" alt=""><figcaption><p>在 Unsloth Desktop 中运行动态 4-bit Qwen3.8-27B</p></figcaption></figure>

Unsloth 量化：

* [Qwen3.8-**27B**-GGUF](https://huggingface.co/unsloth/Qwen3.8-27B-GGUF)
* [Qwen3.8-27B-**NVFP4**](https://huggingface.co/unsloth/Qwen3.8-27B-NVFP4)
  {% endcolumn %}
  {% endcolumns %}

### :gear: 使用指南

#### Qwen3.8-27B 要求：

Qwen3.8-**27B** 4-bit 量化可在 16-19GB VRAM 上运行，例如 RTX 5080、4090，或配备 24GB RAM 的 Mac。\
**表：硬件要求** （单位 = 总内存：RAM + VRAM，或统一内存）

<table><thead><tr><th>1-bit</th><th>2-bit</th><th>3-bit</th><th>4-bit</th><th width="128">6-bit</th><th>8-bit</th><th>BF16</th></tr></thead><tbody><tr><td>7-8 GB</td><td>9-11 GB</td><td>12-14 GB</td><td>16-19 GB</td><td>23-26 GB</td><td>31 GB</td><td>56 GB</td></tr></tbody></table>

{% hint style="info" %}
如果你想使用 [MTP](/docs/zh/mo-xing/mtp.md) 以获得更快的推理，请预留 1-2GB 的额外空间。
{% endhint %}

#### Qwen3.8-**2.4T** 要求：

* [Qwen3.8-**2.4T-A95B**-GGUF](https://huggingface.co/unsloth/Qwen3.8-2.4T-A95B-GGUF)

| 动态 1-bit XXXS | 动态 1-bit 标准版 | 动态 2-bit | Q8\_0  | BF16（无损） |
| ------------- | ------------ | -------- | ------ | -------- |
| 397GB         | 508GB        | 657 GB   | 2.6 TB | 4.9 TB   |

### 推荐设置

#### Qwen3.8-**27B 设置：**

Qwen3.8-27B 是一个 **混合思考** 模型，对思考和非思考模式有不同的默认设置。默认启用了 Extra high，因此如果你想要更短的思考轨迹，可以 [调整思考强度](#thinking--preserve-thinking):

| 参数                   | 思考模式 | Instruct（非思考）模式 |
| -------------------- | ---- | --------------- |
| `temperature`        | 1.0  | 0.7             |
| `top_p`              | 0.95 | 0.80            |
| `top_k`              | 20   | 20              |
| `min_p`              | 0.0  | 0.0             |
| `presence_penalty`   | 0.0  | 1.5             |
| `repetition_penalty` | 1.0  | 1.0             |

* **最大上下文窗口：** `262,144` （可通过 YaRN 扩展到 1M）
* 思考模式： `temperature=1.0`, `top_p=0.95`, `top_k=20`, `min_p=0.0`, `presence_penalty=0.0`, `repetition_penalty=1.0`
* Instruct（或非思考）模式： `temperature=0.7`, `top_p=0.80`, `top_k=20`, `min_p=0.0`, `presence_penalty=1.5`, `repetition_penalty=1.0`

#### Qwen3.8-**2.4T 设置：**

Qwen3.8-2.4T 是 **仅思考**，而 Qwen3.8-Max 是混合模式。

| 默认                      |
| ----------------------- |
| temperature = 1.0       |
| top\_p = 0.95           |
| top\_k = 20             |
| min\_p = 0.0            |
| presence\_penalty = 0.0 |

* 上下文长度 = 最多 `1,010,000`
* `temperature=1.0`, `top_p=0.95`, `top_k=20`, `min_p=0.0`, `presence_penalty=0.0`, `repetition_penalty=1.0`

如果模型能装下，在使用 B200 时，你将获得约 20 tokens/s 的生成速度和 >120 tokens/s 的吞吐量。最经验法则：RAM+VRAM ≈ 量化大小；否则它仍然可以运行，只是由于磁盘卸载会慢很多。

### 💡 思考 + 保留思考

{% columns %}
{% column %}
Qwen3.8 具有 **保留思考** 功能，它会保留上一轮对话中的思考轨迹。这会增加你使用的 token 数量，但可能会提高连续对话中的准确率。 [Unsloth](#run-qwen3.8-in-unsloth-desktop) 为 Qwen3.8 提供了“Think”和“保留思考”开关（见右侧）：
{% endcolumn %}

{% column %}

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FLdgmjRrb5qhpbY9PwYe8%2FScreenshot%202026-08-14%20at%2011.26.15%E2%80%AFAM.png?alt=media&amp;token=6333f5ca-196d-46ae-9efd-2e522014e6db" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

Qwen3.8-27B 支持 `reasoning_effort`，可用于调整推理深度并控制成本。这些开关在 Unsloth 中会自动启用：

* `xhigh` （默认）：适用于需要深入分析的复杂任务
* `medium`：平衡准确性与速度
* `low`：高效推理，优化速度与成本
* none

{% hint style="warning" %}
要更改[ 思考 / 推理](#how-to-enable-or-disable-reasoning-and-thinking) 强度，在 `unsloth run` 或 `llama-server`中，使用 `--chat-template-kwargs '{"reasoning_effort":"medium"}'`

如果你在 **Windows** Powershell 中，请使用： `--chat-template-kwargs "{\"reasoning_effort\":\"medium\"}"`

更改 `medium` 为你想要的推理级别。
{% endhint %}

## Qwen3.8 使用指南

现在你可以在 llama.cpp 和 Unsloth Desktop 中运行 Qwen3.8。对于大型的 Qwen3.8-2.T 模型，我们将使用 397GB `IQ1_XXXS` 量化（命名为 Q1\_0），以在可访问性和准确性方面获得最佳结果，并且至少需要 450GB RAM。你可以随意更改量化类型。

* Hugging Face： [Qwen3.8-27B-**GGUF**](https://huggingface.co/unsloth/Qwen3.8-27B-GGUF) • [Qwen3.8-27B-**NVFP4**](https://huggingface.co/unsloth/Qwen3.8-27B-NVFP4)
* ModelScope： [Qwen3.8-27B-**GGUF**](https://www.modelscope.cn/models/unsloth/Qwen3.8-27B-GGUF) • [Qwen3.8-27B-**NVFP4**](https://www.modelscope.cn/models/unsloth/Qwen3.8-27B-NVFP4)
* **2.4T-A95B：** [Qwen3.8-**2.4T-A95B**-GGUF](https://huggingface.co/unsloth/Qwen3.8-2.4T-A95B-GGUF)

<a href="/pages/d03b47babbad2abc249a0979b2d44af1f02bbd20#run-qwen3.8-in-unsloth-desktop" class="button primary">在 Unsloth Desktop 中运行</a><a href="/pages/d03b47babbad2abc249a0979b2d44af1f02bbd20#run-qwen3.8-in-llama.cpp" class="button secondary">在 llama.cpp 中运行</a><a href="/pages/d03b47babbad2abc249a0979b2d44af1f02bbd20#run-qwen3.8-in-llama.cpp" class="button secondary">NVFP4 指南</a>

### 🦥 在 Unsloth Desktop 中运行 Qwen3.8

Qwen3.8 可以在 [Unsloth Desktop](#run-qwen3.8-in-unsloth-desktop)中运行，这是一个用于本地 AI 的开源 UI 应用。 **Unsloth 会自动卸载到 RAM，并检测多 GPU 配置**。使用 Unsloth Desktop，你可以在以下平台本地运行模型： **MacOS、Windows**、Linux 和：

{% columns %}
{% column %}

* 搜索、下载、 [运行 GGUF](/docs/zh/xin/studio.md#run-models-locally)、MLX 和 safetensor 模型
* [**自我修复** 工具调用](/docs/zh/xin/studio/chat.md#auto-healing-tool-calling) + **网页搜索**
* [**代码执行**](/docs/zh/desktop.md#code-execution) （Python、Bash）
* [自动推理](https://unsloth.ai/docs/desktop#feature-deep-dive) 参数调优（temp、top-p 等）
* 通过 MLX 和 llama.cpp 实现快速 CPU + GPU 推理
* [训练 LLM](/docs/zh/xin/studio.md#no-code-training) 速度提升 2 倍，VRAM 减少 70%
  {% endcolumn %}

{% column %}

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F6IXaXdTVyvbrnjehlxys%2Fkimik3.gif?alt=media&amp;token=31e1213b-d7da-46e9-bc7f-3a8c402513fc" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

{% stepper %}
{% step %}

#### 安装 Unsloth

最简单的入门方式是下载 [Unsloth Desktop 应用](/docs/zh/desktop.md)。支持 [macOS](/docs/zh/kai-shi-shi-yong/install/mac.md), [Windows](/docs/zh/kai-shi-shi-yong/install/windows-installation.md)，以及 [Linux](/docs/zh/kai-shi-shi-yong/install/linux.md).

<a href="https://unsloth.ai/download" class="button primary" data-icon="down-to-bracket">下载 Unsloth</a>

* <i class="fa-apple">:apple:</i> [下载 macOS 版](https://unsloth.ai/download/mac)
* <i class="fa-windows">:windows:</i> [下载 Windows 版](https://unsloth.ai/download/windows)
* <i class="fa-linux">:linux:</i> [下载 Linux 版](https://unsloth.ai/download/linux)

或者，如果你更喜欢手动安装：

MacOS、Linux、WSL：

```bash
curl -fsSL https://unsloth.ai/install.sh | sh
```

Windows PowerShell：

```bash
irm https://unsloth.ai/install.ps1 | iex
```

{% endstep %}

{% step %}

#### 搜索并下载 Qwen3.8

前往 [Unsloth Chat](/docs/zh/xin/studio/chat.md) 或 Model hub，在搜索栏中搜索 Qwen3.8，然后下载你想要的模型和量化版本。

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fo53hIyoFypinWWLa1c0x%2FScreenshot%202026-08-14%20at%2012.42.38%E2%80%AFPM.png?alt=media&amp;token=a69de985-56ee-4ef3-8e10-f669cc168346" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### 运行 Qwen3.8

使用 Unsloth 时，推理参数应会自动设置，不过你仍然可以手动修改。你也可以编辑上下文长度、聊天模板和其他设置。

更多信息请查看我们的 [Unsloth 推理指南](/docs/zh/xin/studio/chat.md).

例如，在 Unsloth Desktop 中使用 397GB 的 Qwen3.8（缩小 91%）可以让你切换思考模式、启用内联画布、网页搜索和代码执行等更多功能。

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fb3IiYJzHzsp2698xTim4%2Fgiffyy%20gf.gif?alt=media&amp;token=f1bda1a1-b81f-43e2-ba10-dbdc9a29c0c0" alt="" width="563"><figcaption><p>在 Unsloth Desktop 中运行 Qwen3.8 2.4T 的动态 1-bit 397GB 91% 缩小版 GGUF</p></figcaption></figure>
{% endstep %}

{% step %}

#### 通过 Unsloth API 提供 Qwen3.8 服务

你可以使用 `unsloth run` 命令，并通过以下方式提供 Qwen3.8 的 API 服务： `llama-server` 运行时标志，包括上下文大小、GPU 层数、线程、采样、网络和工具配置。更多信息请参见我们的 [API 文档](/docs/zh/ji-chu/api.md) 或 [unsloth start](/docs/zh/ji-cheng/unsloth-start.md).

{% code overflow="wrap" %}

```bash
unsloth run --model unsloth/qwen3.8-27B-GGUF:UD-Q4_K_XL
    --temp 1.0 \\
    --top-p 0.95 \\
    --top-k 20 \\
    --min-p 0.0 \\
    --reasoning-effort medium
```

{% endcode %}
{% endstep %}

{% step %}

#### Unsloth 现在已准备就绪

你还可以通过 Unsloth Desktop 用 Qwen3.8 做很多其他事情，例如：

* **连接工具：** [Claude Code](/docs/zh/ji-chu/claude-code.md), [Codex](/docs/zh/ji-chu/codex.md), [网页搜索](/docs/zh/xin/studio/chat.md#advanced-web-search), [MCP](/docs/zh/ji-chu/mcp.md) 等等
* **训练模型：** 微调文本、扩散、 [嵌入](/docs/zh/ji-chu/embedding-finetuning.md)等
* **生成媒体：** 创建并训练 [图像](/docs/zh/ji-chu/diffusion-image.md)、视频、 [TTS](/docs/zh/ji-chu/text-to-speech-tts-fine-tuning.md) 本地

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FYShiiub5gs5pCQLX6d4U%2FScreenshot%202026-08-15%20at%2012.18.24%E2%80%AFAM.png?alt=media&amp;token=d6996797-a144-4113-b4c3-155cca6c39a0" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### Qwen3.8-2.4T-A95B 新的 1-bit 数据类型

我们将 llama.cpp 中的 IQ1\_S 扩展到每个权重 1.5625 位，并通过减少 codebook 中的条目数将其提升到 1.1875 bpw——我们发现这对大型模型效果很好，并且仍能保留大量准确率——我们还发现这些新的数据类型适用于训练后的量化（PTQ），无需 QAT 或 QAD（量化感知训练 / 蒸馏）。 [Qwen3.8-**2.4T-A95B**-GGUF](https://huggingface.co/unsloth/Qwen3.8-2.4T-A95B-GGUF)

由于命名问题，我们使用了 TQ2\_0、TQ1\_0 和 Q1\_0，否则它不会在 HF 仓库中显示。

<table><thead><tr><th>数据类型</th><th width="147.60000610351562">命名</th><th width="114.39996337890625" align="right">BPW</th><th width="106.20001220703125" align="right"># 条目</th><th width="113.413330078125" align="right">索引位</th><th width="106.4000244140625" align="right">块</th></tr></thead><tbody><tr><td>IQ1_S</td><td>IQ1_S</td><td align="right"><strong>1.5625</strong></td><td align="right">2048</td><td align="right">11</td><td align="right">50 B</td></tr><tr><td>UD-IQ1_XS</td><td>TQ2_0</td><td align="right">1.4375</td><td align="right">1024</td><td align="right">10</td><td align="right">46 B</td></tr><tr><td>UD-IQ1_XXS</td><td>TQ1_0</td><td align="right">1.3125</td><td align="right">512</td><td align="right">9</td><td align="right">42 B</td></tr><tr><td>UD-IQ1_XXXS</td><td>Q1_0</td><td align="right"><strong>1.1875</strong></td><td align="right">256</td><td align="right">8</td><td align="right">38 B</td></tr></tbody></table>

我们仍在对新的数据类型进行基准测试，但对于其他大型模型，我们得到了 **无需任何 QAT / QAD 的良好结果**:

| 数据类型         |     GiB |      PPL |      KLD |  top-p |
| ------------ | ------: | -------: | -------: | -----: |
| IQ1\_S       | 553.204 | 2.578876 | 0.564553 | 78.882 |
| UD-IQ1\_XS   | 513.583 | 2.931261 | 0.690161 | 75.726 |
| UD-IQ1\_XXS  | 473.961 | 3.540383 | 0.876007 | 71.284 |
| UD-IQ1\_XXXS | 434.340 | 4.488796 | 1.109944 | 66.257 |

### :llama: 在 llama.cpp 中运行 Qwen3.8

{% stepper %}
{% step %}
我们需要使用特定的 IQ1\_XXXS 分支 [这里](https://github.com/unslothai/llama.cpp/pull/61)。你也可以按照下面的构建说明进行操作。将 `-DGGML_CUDA=ON` 改为 `-DGGML_CUDA=OFF` 如果你没有 GPU，或者只想进行 CPU 推理。 **对于 Apple Mac / Metal 设备**，设置 `-DGGML_CUDA=OFF` 然后按常规继续——Metal 支持默认开启。

```bash
apt-get update
apt-get install pciutils build-essential cmake curl libcurl4-openssl-dev -y
git clone --branch iq1-narrow https://github.com/unslothai/llama.cpp
cmake llama.cpp -B llama.cpp/build \\
    -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON
cmake --build llama.cpp/build --config Release -j --clean-first --target llama-cli llama-mtmd-cli llama-server llama-gguf-split
cp llama.cpp/build/bin/llama-* llama.cpp
```

{% endstep %}

{% step %}
如果你只是想运行标准的 `IQ1_S` 以及其他量化版本，那么请按常规编译 llama.cpp：

{% code overflow="wrap" %}

```bash
apt-get update
apt-get install pciutils build-essential cmake curl libcurl4-openssl-dev -y
git clone https://github.com/ggml-org/llama.cpp
cmake llama.cpp -B llama.cpp/build \\
    -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON
cmake --build llama.cpp/build --config Release -j --clean-first --target llama-cli llama-mtmd-cli llama-server llama-gguf-split
cp llama.cpp/build/bin/llama-* llama.cpp
```

{% endcode %}
{% endstep %}

{% step %}
通过以下方式下载模型（在安装后 `pip install huggingface_hub`）。你可以选择 `Q1_0` 用于 `IQ1_XXXS` ，或者其他量化版本，例如 `Q8_0` 。如果下载卡住，请参见： [Hugging Face Hub、XET 调试](/docs/zh/ji-chu/troubleshooting-and-faqs/hugging-face-hub-xet-debugging.md)

**Qwen3.8-27B：**

```bash
pip install -U "huggingface_hub[cli]"
hf download unsloth/Qwen3.8-27B-GGUF \\
    --local-dir unsloth/Qwen3.8-27B-GGUF \\
    --include "*UD-Q4_K_XL*" # 3-bit 请使用 "*UD-Q3_K_XL*"
```

**Qwen3.8-2.4T：**

```bash
pip install -U "huggingface_hub[cli]"
hf download unsloth/Qwen3.8-2.4T-A95B-GGUF \\
    --local-dir unsloth/Qwen3.8-2.4T-A95B-GGUF \\
    --include "*Q1_0*" # 2-bit 请使用 "*IQ2_XXS*"
```

{% endstep %}

{% step %}
要在 llama-cli 中运行该模型，请按照下面的代码片段执行：\
记得 [根据你的使用场景更改设置](#recommended-settings) 。

**Qwen3.8-27B：**

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-cli \\
    --model unsloth/Qwen3.8-27B-GGUF/Qwen3.8-27B-UD-Q4_K_XL.gguf \\
    --temp 1.0 \\
    --top-p 0.95 \\
    --top-k 20 \\
    --min-p 0.0
```

{% endcode %}

**Qwen3.8-2.4T：**

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-cli \\
    --model unsloth/Qwen3.8-2.4T-A95B-GGUF/UD-Q1_0/Qwen3.8-2.4T-A95B-UD-Q1_0-00001-of-00010.gguf \\
    --temp 1.0 \\
    --top-p 0.95 \\
    --top-k 20 \\
    --min-p 0.0
```

{% endcode %}
{% endstep %}

{% step %}
要运行通用的 UD-IQ1\_S，你可以这样做：

**Qwen3.8-2.4T：**

{% code overflow="wrap" %}

```bash
pip install -U "huggingface_hub[cli]"
hf download unsloth/Qwen3.8-2.4T-A95B-GGUF \\
    --local-dir unsloth/Qwen3.8-2.4T-A95B-GGFF \\
    --include "*IQ1_S*" # 2-bit 请使用 "*IQ2_XXS*"
```

{% endcode %}
{% endstep %}

{% step %}
然后运行它：

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-cli \\
    --model unsloth/Qwen3.8-2.4T-A95B-GGUF/UD-IQ1_S/Qwen3.8-2.4T-A95B-UD-IQ1_S-00001-of-00012.gguf \\
    --temp 1.0 \\
    --top-p 0.95 \\
    --top-k 20 \\
    --min-p 0.0
```

{% endcode %}
{% endstep %}
{% endstepper %}

### ⚡️NVFP4

像 Qwen3.6 一样，我们也发布了新的 [动态 NVFP4 Qwen3.8](/docs/zh/ji-chu/nvfp4.md)-27B 量化版本，可运行 **快约 1.5×** 相比 BF16 检查点，并且 **性能更好** 且文件大小相近。运行 Qwen3.8-27B NVFP4 **快 1.5 倍** 在 **24GB 显存。** 我们还添加了 **FP8 KV 缓存校准** 以实现长 2 倍的上下文长度！NVFP4 需要 NVIDIA 的 Blackwell GPU，例如 RTX 50X、DGX Spark（见 [#dgx-spark-with-nvfp4-quants](#dgx-spark-with-nvfp4-quants "mention")）、B200、B300 GPU。对于更老的 GPU，我们的 GGUF 也很好用！你现在可以在 [vLLM](#vllm) 中运行 NVFP4 量化版本，但目前仅限于此（不支持 SGLang）。

* [Qwen3.8-27B-**NVFP4**](https://huggingface.co/unsloth/Qwen3.8-27B-NVFP4) 量化

<table><thead><tr><th width="90" align="right">批次</th><th width="114.5999755859375" align="right">BF16 总 tok/s</th><th width="122.60003662109375" align="right">NVFP4 总 tok/s</th><th width="122" align="right">加速比</th><th width="137.4000244140625" align="right">BF16 单用户</th><th align="right">NVFP4 单用户</th></tr></thead><tbody><tr><td align="right">1</td><td align="right">89.8</td><td align="right"><strong>133.7</strong></td><td align="right">1.49x</td><td align="right">89.8</td><td align="right"><strong>133.7</strong></td></tr><tr><td align="right">8</td><td align="right">649.4</td><td align="right"><strong>938.8</strong></td><td align="right">1.45x</td><td align="right">81.2</td><td align="right"><strong>117.3</strong></td></tr><tr><td align="right">32</td><td align="right">1983.0</td><td align="right"><strong>2787.0</strong></td><td align="right">1.41x</td><td align="right">62.0</td><td align="right"><strong>87.1</strong></td></tr><tr><td align="right">64</td><td align="right">3048.5</td><td align="right"><strong>4407.2</strong></td><td align="right">1.45x</td><td align="right">47.6</td><td align="right"><strong>68.9</strong></td></tr></tbody></table>

下面还可以查看之前为 Qwen3.6 进行的基准测试，这些测试也对比了其他 NVFP4 实现，它们使用 16 位激活值，而我们的 NVFP4 使用的是激活值：

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F8zM7cg0Xgo2pAlop1iPW%2F01_qwen36_combined_throughput.png?alt=media&amp;token=23131a96-4c41-42d7-aa16-5bfb21bb44a3" alt="" width="563"><figcaption></figcaption></figure>

所有基准测试都使用 1x B200，128 并发。更高并发可将 35B 提升到 17,561 tokens / s。&#x20;

对于准确率基准测试，我们在代码、聊天和多个领域上运行了 KLD 以及 Top-1% 一致率。与 BF16 相比，NVFP4 的准确率恢复稳定在 92% 到 97%。

| 语料            |        KLD 均值 | top-1 一致率 |
| ------------- | ------------: | --------: |
| 中文            |       0.01628 |    93.55% |
| 代码            |       0.02600 |    96.68% |
| 参考生成          |       0.03993 |    94.46% |
| 聊天            |       0.05818 |    92.15% |
| 日 / 韩 / 俄 / 西 | 0.0124-0.0155 |    94-95% |

对于 Qwen 3.6 的准确率基准测试，我们对 FP8、BF16、NVIDIA 的 NVFP4 以及我们的 NVFP4s 进行了 MMLU-Pro、AIME 2025、GPQA 测试——我们展示的更快量化版本在所有项目上表现都相近：

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FFhOUUUlRBj3dafGnmvhK%2F03_qwen36_combined_accuracy(7).png?alt=media&amp;token=9178447f-d5ae-4489-9bdc-73b2b7b1631b" alt=""><figcaption></figcaption></figure>

更多信息，请阅读我们的 [动态 NVFP4 量化博客](/docs/zh/ji-chu/nvfp4.md).

要运行 NVFP4 量化版本，请见下方在 Qwen3.8-27B 中运行的命令， [vLLM](/docs/zh/ji-chu/inference-and-deployment/vllm-guide.md) 或 [SGLang](/docs/zh/ji-chu/inference-and-deployment/sglang-guide.md):

#### **vLLM：**

要在单独的虚拟环境中安装 vLLM：

{% code overflow="wrap" expandable="true" %}

```bash
uv venv unsloth-nvfp4-env --python 3.13
source unsloth-nvfp4-env/bin/activate
uv pip install "vllm>=0.25.0" "flashinfer-python>=0.6.13" "nvidia-cutlass-dsl>=4.5.2" \\
    --torch-backend=auto
```

{% endcode %}

然后提供 27B 变体：

```shell
vllm serve unsloth/Qwen3.8-27B-NVFP4
```

要启用 MTP / 推测解码（解码更快，但吞吐量会稍低），请使用：

```bash
vllm serve unsloth/Qwen3.8-27B-NVFP4
    --speculative-config '{"method": "mtp", "num_speculative_tokens": 2}'
```

如果遇到 Torchcodec 问题，请先执行下面步骤，然后重新启动 vllm。

{% code overflow="wrap" expandable="true" %}

```bash
sudo apt-get update
sudo apt-get install -y ffmpeg
```

{% endcode %}

#### **SGLang：**

如果使用 SGLang，你必须使用 **SGLang 版本 v0.5.19** 否则将无法工作，因为我们将 lm\_head 量化为 FP8。

{% hint style="info" %}
vLLM 有一个 `CompressedTensorsW8A8Fp8` 内核支持这一点，而 SGLang v0.5.19 无法加载 FP8 lm\_head。v0.5.19 现在可以用了！
{% endhint %}

对于 sglang，在安装最新版本后：

{% code overflow="wrap" %}

```bash
uv pip install sglang sglang-kernel \\
  --extra-index-url https://sgl-project.github.io/whl/cu130/ \\
  --extra-index-url https://download.pytorch.org/whl/cu130 \\
  --index-strategy unsafe-best-match
```

{% endcode %}

然后可以部署它：

```bash
sglang serve unsloth/Qwen3.8-27B-NVFP4
```

要启用 MTP，请使用：

{% code overflow="wrap" %}

```bash
sglang serve unsloth/Qwen3.8-27B-NVFP4 --speculative-algorithm EAGLE \\
    --speculative-num-steps 3 --speculative-eagle-topk 1  --speculative-num-draft-tokens 4
```

{% endcode %}

### :exploding\_head:量化分析

NVFP4 量化版本比 BF16 快 1.5 倍，并保留 92% 到 97% 的 top-1% 准确率。

我们使用了 [Dynamic 3.0 GGUFs](/docs/zh/ji-chu/dynamic-3.0-ggufs.md) 使 Qwen3.8-27B 大幅提升！

如 UD-3 中所示的 Qwen3.8-27B 的 Top-1% 准确率图：

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FVg5FHPxOpmaJ1r3ciw4u%2Fimage.png?alt=media&amp;token=107ef044-0181-489b-b6ae-da218e16c98b" alt=""><figcaption></figcaption></figure>

以及 Qwen3.8 的平均 KLD：

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Ft8BnEqBLUQGUgu2cAKKI%2Fimage.png?alt=media&amp;token=912d5b6a-540f-4ee0-9208-f5ad45776341" alt=""><figcaption></figcaption></figure>

### 📊 基准测试

对于 GGUF 量化基准测试，你可以在上方查看我们的 [量化分析](#quantization-analysis) 或 [动态 V3.0 文章](/docs/zh/ji-chu/dynamic-3.0-ggufs.md).

#### Qwen3.8-**27B**

表格基准测试请见下方：

<div><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FWijY5wYmLx70Ao2ol7Tj%2Fqwen%20benchmark%201.jpeg?alt=media&amp;token=f69ebf50-cf35-426f-a610-8eeb32151d90" alt=""><figcaption></figcaption></figure> <figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FELa2vq8Wh3oelQi6Bf07%2Fqwen%20benchmark%202.jpeg?alt=media&amp;token=2cc6d085-630d-4fa1-9b50-784b22a1fb04" alt=""><figcaption></figcaption></figure></div>

#### 文本性能

| 基准                                    | Qwen3.8-27B               | Qwen3.6-27B          | Qwen3.7-Plus         | Muse Glimmer-30B | Opus4.6 Max |
| ------------------------------------- | ------------------------- | -------------------- | -------------------- | ---------------- | ----------- |
| **编程**                                |                           |                      |                      |                  |             |
| 代理式终端编程 Terminal Bench 2.1 (Terminus) | 73.0                      | 63.4                 | 64.0                 | 51.7             | **78.2**    |
| 代理式编程 SWE-bench Pro                   | **61.7**                  | 53.5                 | 57.6                 | 51.2             | 53.4        |
| 仓库级代码生成 NL2Repo-Bench                 | 42.3                      | 36.2                 | 41.1                 | --               | **47.6**    |
| 代理式编程 DeepSWE 1.1                     | **42.2**                  | 13.3                 | 14.2                 | --               | --          |
| 软件工程 QwenSWEBench                     | **79.0**                  | 49.3                 | 59.2                 | --               | 63.8        |
| **代理**                                |                           |                      |                      |                  |             |
| 长周期办公工作 CoWorkBench                   | **70.7**                  | 61.0                 | 65.1                 | --               | 68.2        |
| 专业工作任务 JobBench                       | **33.4**                  | 21.8                 | 27.6                 | --               | --          |
| 前沿代理任务 Agents' Last Exam              | Pass\@1**20.4**分数**42.9** | Pass\@1 10.6 分数 27.3 | Pass\@1 13.2 分数 33.6 | --               | --          |
| 通用                                    |                           |                      |                      |                  |             |
| 指令遵循 IFBench                          | **79.5**                  | 69.1                 | 79.1                 | 77.0             | 62.5        |
| 科学推理 GPQA Diamond                     | 89.2                      | 87.8                 | 90.3                 | 83.5             | **91.3**    |
| 多学科推理 HLE                             | 30.8                      | 24.0                 | 34.7                 | 22.0             | **40.0**    |
| 竞技编程 LiveCodeBench v6                 | **90.3**                  | 83.9                 | 89.6                 | --               | 88.8        |

#### Qwen3.8-**2.4T-A95B**

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FWP0nBgaQcnnAGjqG1jyQ%2Fqwen3.8%20bench.jpg?alt=media&amp;token=92a0d19c-51cb-4df2-a4f5-334fe08e6a21" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://unsloth.ai/docs/zh/mo-xing/qwen3.8.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
