> 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.6.md).

# Qwen3.6：如何在本地运行

在本地运行新的 Qwen3.6-27B 和 35B-A3B 模型！

Qwen3.6 是阿里巴巴全新一代多模态混合思维模型家族，包括： **Qwen3.6-27B** 以及 **35B-A3B**。它在自身规模内提供顶尖性能，支持覆盖 201 种语言的 256K 上下文。它在智能体编程、视觉、聊天任务方面表现出色。Qwen3.6-27B 可在 **18GB RAM** 的配置上运行，而 35B-A3B 可在 **22GB**上运行。你现在可以在 [Unsloth Desktop](#unsloth-guide).

{% hint style="success" %}
**7 月 10 日：** 我们发布了新的 [**NVFP4** 量化版本](#nvfp4) ，可在 GPU 上将 Qwen3.6 的运行速度提升 2.5 倍。

[**Qwen3.6 MTP 来了**](#mtp-guide)**!** MTP 可在不损失准确度的情况下实现 1.4-2.2 倍更快的推理。可直接在 [Unsloth Studio](#unsloth-studio-mtp-guide)中运行 MTP。我们进行了 [Qwen3.6 GGUF 基准测试](#unsloth-gguf-benchmarks) ，帮助你挑选最佳量化版本。
{% endhint %}

<a href="/pages/213bd08e4302b621f4392f7ee38decb275ffab02#qwen3.6-inference-tutorials" class="button primary">运行 Qwen3.6 教程</a><a href="/docs/zh/mo-xing/qwen3.6.md#mtp-guide" class="button primary">MTP 指南</a>

{% columns %}
{% column %}
Qwen3.6 GGUF 使用 Unsloth [Dynamic 2.0](/docs/zh/ji-chu/dynamic-3.0-ggufs.md) 以实现业界领先的量化性能——因此量化版本会在真实使用场景数据集上进行校准，并对重要层进行上浮精度处理。 *感谢 Qwen 在发布首日提供访问权限。*

* **开发者角色支持** ，适用于 Codex、OpenCode 等：\
  我们的上传现在支持 `开发者角色` ，用于智能体编程工具。
* **工具调用：** 像 [Qwen3.5](/docs/zh/mo-xing/qwen3.5.md)一样，我们改进了对嵌套对象的解析，使工具调用更容易成功。
  {% endcolumn %}

{% column %}

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FTbH2CrUTG2TWwgOP74GF%2FGemma%204%20example.gif?alt=media&amp;token=56409d06-3735-4531-97c0-af9968371a26" alt=""><figcaption><p>运行中的 Qwen3.6 <a href="#unsloth-studio-guide">Unsloth Studio</a>.</p></figcaption></figure></div>
{% endcolumn %}
{% endcolumns %}

### :gear: 使用指南

**表：推理硬件需求** （单位 = 总内存：RAM + VRAM，或统一内存）

<table><thead><tr><th>Qwen3.6</th><th>3 位</th><th>4 位</th><th width="128">6 位</th><th>8 位</th><th>BF16</th></tr></thead><tbody><tr><td><strong>27B</strong></td><td>15 GB</td><td>18 GB</td><td>24 GB</td><td>30 GB</td><td>55 GB</td></tr><tr><td><strong>35B-A3B</strong></td><td>17 GB</td><td>23 GB</td><td>30 GB</td><td>38 GB</td><td>70 GB</td></tr></tbody></table>

{% hint style="success" %}
为了获得最佳性能，请确保你的可用总内存（VRAM + 系统 RAM）大于你正在下载的量化模型文件大小。否则，你仍然可以通过 SSD/HDD 卸载来运行，但推理速度会更慢。
{% endhint %}

**要训练 Qwen3.6，你可以参考我们之前的** [**Qwen3.5 微调指南**](/docs/zh/mo-xing/qwen3.5/fine-tune.md)**.**

### 推荐设置

* **最大上下文窗口：** `262,144` （可通过 YaRN 扩展到 1M）
* `presence_penalty = 0.0 到 2.0` 默认情况下这是关闭的，但为了减少重复，你可以使用它，不过使用更高的值可能会导致 **性能略有下降**
* **足够的输出长度**: `32,768` 个 token，适用于大多数查询

{% hint style="info" %}
如果你看到的是乱码，你的上下文长度可能设置得太低。或者尝试使用 `--cache-type-k bf16 --cache-type-v bf16` ，这可能会有帮助。
{% endhint %}

由于 Qwen3.6 是混合推理，思考模式和非思考模式的设置不同：

#### 思考模式：

{% hint style="success" %}
Qwen3.6 现在具有 [保留思考](#turn-on-off-thinking--preserve-thinking).
{% endhint %}

| 通用任务                       | 精确编程任务（例如 WebDev）          |
| -------------------------- | -------------------------- |
| temperature = 1.0          | temperature = 0.6          |
| top\_p = 0.95              | top\_p = 0.95              |
| top\_k = 20                | top\_k = 20                |
| min\_p = 0.0               | min\_p = 0.0               |
| presence\_penalty = 0.0    | presence\_penalty = 0.0    |
| repeat\_penalty = 已禁用或 1.0 | repeat\_penalty = 已禁用或 1.0 |

{% columns %}
{% column %}
通用任务的思考模式：

{% code overflow="wrap" %}

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

{% endcode %}
{% endcolumn %}

{% column %}
精确编程任务的思考模式：

{% code overflow="wrap" %}

```bash
temperature=0.6, top_p=0.95, top_k=20, min_p=0.0, presence_penalty=0.0, repetition_penalty=1.0
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### 指令（非思考）模式设置：

| 通用任务                       |
| -------------------------- |
| temperature = 0.7          |
| top\_p = 0.8               |
| top\_k = 20                |
| min\_p = 0.0               |
| presence\_penalty = 1.5    |
| repeat\_penalty = 已禁用或 1.0 |

{% hint style="warning" %}
要 [禁用思考 / 推理](#how-to-enable-or-disable-reasoning-and-thinking)，请使用 `--chat-template-kwargs '{"enable_thinking":false}'`

如果你使用的是 **Windows** PowerShell，请使用： `--chat-template-kwargs "{\"enable_thinking\":false}"`

可交替使用 'true' 和 'false'。
{% endhint %}

通用任务的指令（非思考）模式：

{% code overflow="wrap" %}

```bash
temperature=0.7, top_p=0.8, top_k=20, min_p=0.0, presence_penalty=1.5, repetition_penalty=1.0
```

{% endcode %}

## Qwen3.6 推理教程：

我们将使用 Dynamic 4-bit `UD-Q4_K_XL` GGUF 变体进行推理工作负载。点击下方以跳转到指定模型说明：

<a href="/docs/zh/mo-xing/qwen3.6.md#unsloth-studio-guide" class="button primary">在 Unsloth Desktop 中运行</a><a href="/pages/213bd08e4302b621f4392f7ee38decb275ffab02#llama.cpp-guide" class="button secondary">在 llama.cpp 中运行</a><a href="/docs/zh/mo-xing/qwen3.6.md#mtp-guide" class="button primary">MTP 指南</a><a href="/docs/zh/mo-xing/qwen3.6.md#nvfp4" class="button secondary">NVFP4 指南</a>

{% hint style="warning" %}
请不要使用 CUDA 13.2，因为你可能会得到乱码输出。请使用低于 CUDA 13.2 的版本或 CUDA 13.3。
{% endhint %}

### 🦥 Unsloth 指南

Qwen3.6 和 Qwen3.6 MTP 现在可以在 [Unsloth Desktop、](/docs/zh/desktop.md) 我们的全新本地 AI 开源 UI 中运行。Unsloth Studio 让你可以在本地运行模型，支持 **MacOS、Windows**、Linux 以及：

{% columns %}
{% column %}

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

{% column %}

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FKoonE97b0H3RioMwVohd%2Fstudio%20new%20ui.gif?alt=media&amp;token=e37f2839-914e-48b8-8c81-2dac3ade9408" alt=""><figcaption></figcaption></figure></div>
{% 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
```

{% hint style="success" %}
**安装会很快，大约需要 20 秒到 1 分钟。**
{% endhint %}
{% endstep %}

{% step %}

#### 启动 Unsloth

**MacOS、Linux、WSL 和 Windows：**

```bash
unsloth studio -H 0.0.0.0 -p 8888
```

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fd1yMMNa65Ccz50Ke0E7r%2FScreenshot%202026-03-17%20at%2012.32.38%E2%80%AFAM.png?alt=media&amp;token=9369cfe7-35b1-4955-b8cb-42f7ecb43780" alt="" width="375"><figcaption></figcaption></figure></div>

然后打开 `http://127.0.0.1:8888` （或你的特定 URL）在浏览器中。

**通过 HTTPS 和 Cloudflare 安全启动 Unsloth**

**新！** Unsloth 现在提供一种通过免费的 Cloudflare 隧道，以 HTTPS 方式安全启动 Unsloth 的方法。使用下面的命令（适用于 Windows、Mac 和 Linux）：

```bash
unsloth studio --secure
```

{% endstep %}

{% step %}

#### 搜索并下载 Qwen3.6 或 Qwen3.6 MTP

首次启动时，你需要创建一个密码来保护你的账户，并在之后再次登录。然后前往 [Unsloth Chat](/docs/zh/xin/studio/chat.md) 选项卡，在搜索栏中搜索 Qwen3.6 或 Qwen3.6 MTP，并下载你想要的模型和量化版本。

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FT6uAnOeF7OU9cuiE8JR5%2FScreenshot%202026-04-16%20at%208.59.33%E2%80%AFAM.png?alt=media&amp;token=6977f7b6-aff7-494b-84b5-ad737125da31" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### 运行 Qwen3.6

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

更多信息请查看我们的 [Unsloth Studio 推理指南](/docs/zh/xin/studio/chat.md)。下面这个 2-bit Qwen3.6 GGUF 完成了 30+ 次工具调用，搜索了 20 个网站，并执行了 Python 代码：

{% embed url="<https://cdn-uploads.huggingface.co/production/uploads/62ecdc18b72a69615d6bd857/9lqVQm1qDX3elt6Uan5Vm.mp4>" %}
{% endstep %}
{% endstepper %}

### ⚡ MTP 指南

MTP（多 token 预测）推测解码使 Qwen3.6 等模型能够实现 **约 1.4-2.2 倍更快的生成速度，且&#x20;**<mark style="background-color:$success;">**准确度没有变化**</mark>。这使得 Qwen3.6 27B 和 35B-A3B 能实现 **>1.4 倍加速** ，相较于原始基线版本，这对本地模型尤其有用。

Unsloth 的 Qwen3.6 MTP GGUF 现已不再处于实验模式，且 llama.cpp 已合并 MTP 支持。可直接在 [Unsloth Studio 的 UI](#unsloth-studio-guide) 中或通过 llama.cpp 运行。 **Qwen3.6 27B MTP 现在在 RTX 6000 GPU 上可实现 160 tokens/s 的生成速度，而 Qwen3.6 35B-A3B 可实现 240 tokens/s。** 参见 [#mtp-benchmarks](#mtp-benchmarks "mention").

Unsloth Studio 会自动为你的特定硬件（Mac、CPU、GPU 等）设置经过优化的理想 MTP 参数——你之后仍然可以修改。

{% hint style="info" %}
**MTP 比标准 GGUF 使用略多一些 VRAM**，因此请预留大约 1 GB 的额外 RAM/VRAM 空间。
{% endhint %}

<a href="/docs/zh/mo-xing/qwen3.6.md#unsloth-studio-mtp-guide" class="button primary">在 Unsloth Studio 中运行</a><a href="/pages/213bd08e4302b621f4392f7ee38decb275ffab02#llama.cpp-mtp-guide" class="button secondary">在 llama.cpp 中运行</a><a href="/docs/zh/mo-xing/qwen3.6.md#nvfp4" class="button secondary">运行 NVFP4</a>

| [Qwen3.6-27B-MTP-GGUF](https://huggingface.co/unsloth/Qwen3.6-27B-MTP-GGUF) | [Qwen3.6-35B-A3B-MTP-GGUF](https://huggingface.co/unsloth/Qwen3.6-35B-A3B-MTP-GGUF) |
| --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |

<div><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FMYn1g7MDeVRAUa6i2oOk%2Fthroughput%20mpt.png?alt=media&amp;token=aff44c0a-3cc3-493e-b6b4-e3279dfb90c1" alt=""><figcaption></figcaption></figure> <figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F4CvUpxr0xdxCR1lTGUbS%2Fmtp%20benchmarks%20landscape.png?alt=media&amp;token=d6579f47-a196-408b-a013-329e09705251" alt=""><figcaption></figcaption></figure></div>

实际上，MTP 会预测若干未来 token，然后主模型并行验证这些 token。这减少了生成过程中所需的前向传播次数，从而使输出更快。 **我们发现 `--spec-draft-n-max 2` 在大多数配置中效果最好。** **不过，不要假设 `2` 就是最佳，因为性能取决于硬件。请尝试从 `1` 到 `6` 的各个值，并使用对你的系统最快的那个。**

我们还 [上传了 MTP GGUF](https://huggingface.co/unsloth/models?search=mtp) 用于 [**Qwen3.5**](/docs/zh/mo-xing/qwen3.5.md) **模型家族** ，包括：0.8B、2B、4B、9B、27B、35B-A3B、122B-A10B 和 397B-A17B。Llama.cpp 正在持续改进 MTP 性能，所以预计它会随着时间推移越来越快！

**表：MTP 硬件需求** （单位 = 总内存：RAM + VRAM，或统一内存）

<table><thead><tr><th>Qwen3.6</th><th>3 位</th><th>4 位</th><th width="128">6 位</th><th>8 位</th><th>BF16</th></tr></thead><tbody><tr><td><strong>27B</strong></td><td>16 GB</td><td>19 GB</td><td>25 GB</td><td>31 GB</td><td>56 GB</td></tr><tr><td><strong>35B-A3B</strong></td><td>18 GB</td><td>24 GB</td><td>31 GB</td><td>39 GB</td><td>71 GB</td></tr></tbody></table>

#### 🦥 Unsloth Studio MTP 指南

Unsloth Studio 会自动为你的特定硬件（Mac、CPU、GPU 等）设置经过优化的理想 MTP 参数——你之后仍然可以修改。

{% stepper %}
{% step %}

#### 安装 Unsloth

在你的终端中运行：

**MacOS、Linux、WSL：**

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

**Windows PowerShell：**

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

{% endstep %}

{% step %}

#### 启动 Unsloth

**MacOS、Linux、WSL 和 Windows：**

```bash
unsloth studio -H 127.0.0.1 -p 8888
```

然后打开 `http://127.0.0.1:8888` （或你的特定 URL）在浏览器中。
{% endstep %}

{% step %}

#### 搜索并下载 Qwen3.6 MTP

首次启动时，你需要创建一个密码来保护你的账户，并在之后再次登录。然后前往 [Unsloth Chat](/docs/zh/xin/studio/chat.md) 选项卡，在搜索栏中搜索 Qwen3.6 MTP，并下载你想要的模型和量化版本。

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F2zQdtdNf0CRBrnTOXBZa%2FScreenshot%202026-05-16%20at%207.10.39%E2%80%AFPM.png?alt=media&amp;token=d1f2e482-5cb7-4e41-97ed-f2905a81f262" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### 运行 Qwen3.6 MTP

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

更多信息请查看我们的 [Unsloth Studio 推理指南](/docs/zh/xin/studio/chat.md)。下面这个 2-bit Qwen3.6 MTP GGUF 完成了 10+ 次工具调用，搜索了 10 个网站，并执行了 Python 代码：

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FsERzR65n4jc1UtuSHozZ%2Fwedefrwfwe.gif?alt=media&amp;token=e303ed9e-0d90-456d-8d57-874a06803903" alt=""><figcaption></figcaption></figure></div>
{% endstep %}
{% endstepper %}

#### 🦙 Llama.cpp MTP 指南

{% stepper %}
{% step %}
安装最新版本的 `llama.cpp` 在 [**GitHub 上点击这里**](https://github.com/ggml-org/llama.cpp/pull/22673)。你也可以按照下面的构建说明进行操作。将 `-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 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
```

{% endstep %}

{% step %}
如果你想使用 `llama.cpp` 直接加载模型，你可以使用下面的方法：(:`Q4_K_XL`）是量化类型。你也可以通过 Hugging Face 下载（见第 3 点）。这与 `ollama run` 类似。使用 `export LLAMA_CACHE="folder"` 可强制 `llama.cpp` 保存到特定位置。该模型的最大上下文长度为 256K。

请根据具体模型选择以下命令之一：

<a href="/pages/213bd08e4302b621f4392f7ee38decb275ffab02#mtp-qwen3.6-27b" class="button primary">27B MTP</a><a href="/pages/213bd08e4302b621f4392f7ee38decb275ffab02#mtp-qwen3.6-35b-a3b" class="button primary">35-A3B MTP</a>

#### MTP Qwen3.6-27B：

**思考模式：**

{% hint style="info" %}
请查看 Qwen3.6 新的 [保留思考](#thinking-enable-disable--preserve-thinking).
{% endhint %}

通用任务：

```bash
export LLAMA_CACHE="unsloth/Qwen3.6-27B-MTP-GGUF"
./llama.cpp/llama-cli \\
    -hf unsloth/Qwen3.6-27B-MTP-GGUF:UD-Q4_K_XL \\
    --temp 1.0 \\
    --top-p 0.95 \\
    --top-k 20 \\
    --min-p 0.00 \\
    --spec-type draft-mtp --spec-draft-n-max 2
```

对于精确编程任务，改为： `temperature=0.6`

**非思考模式：**

通用任务：

```bash
export LLAMA_CACHE="unsloth/Qwen3.6-27B-MTP-GGUF"
./llama.cpp/llama-server \\
    -hf unsloth/Qwen3.6-27B-MTP-GGUF:UD-Q4_K_XL \\
    --temp 0.7 \\
    --top-p 0.8 \\
    --top-k 20 \\
    --presence-penalty 1.5 \\
    --min-p 0.00 \\
    --spec-type draft-mtp --spec-draft-n-max 2 \\
    --chat-template-kwargs '{"enable_thinking":false}'
```

#### MTP Qwen3.6-35B-A3B：

**思考模式：**

{% hint style="info" %}
请查看 Qwen3.6 新的 [保留思考](#thinking-enable-disable--preserve-thinking).
{% endhint %}

通用任务：

```bash
export LLAMA_CACHE="unsloth/Qwen3.6-35B-A3B-MTP-GGUF"
./llama.cpp/llama-cli \\
    -hf unsloth/Qwen3.6-35B-A3B-MTP-GGUF:UD-Q4_K_XL \\
    --temp 1.0 \\
    --top-p 0.95 \\
    --top-k 20 \\
    --min-p 0.00 \\
    --spec-type draft-mtp --spec-draft-n-max 2
```

对于精确编程任务，改为： `temperature=0.6`

**非思考模式：**

通用任务：

```bash
export LLAMA_CACHE="unsloth/Qwen3.6-35B-A3B-MTP-GGUF"
./llama.cpp/llama-server \\
    -hf unsloth/Qwen3.6-35B-A3B-MTP-GGUF:UD-Q4_K_XL \\
    --temp 0.7 \\
    --top-p 0.8 \\
    --top-k 20 \\
    --presence-penalty 1.5 \\
    --min-p 0.00 \\
    --spec-type draft-mtp --spec-draft-n-max 2 \\
    --chat-template-kwargs '{"enable_thinking":false}'
```

{% endstep %}

{% step %}
你也可以通过下面的代码手动下载模型（在安装之后 `pip install huggingface_hub`）。你可以选择 Q4\_K\_M 或其他量化版本，例如 `UD-Q4_K_XL` 。我们建议至少使用 2-bit dynamic 量化 `UD-Q2_K_XL` ，以平衡体积和准确度。如果下载卡住，请参见： [Hugging Face Hub、XET 调试](/docs/zh/ji-chu/troubleshooting-and-faqs/hugging-face-hub-xet-debugging.md)

```bash
hf download unsloth/Qwen3.6-35B-A3B-MTP-GGUF \\
    --local-dir unsloth/Qwen3.6-35B-A3B-MTP-GGUF \\
    --include "*mmproj-F16*" \\
    --include "*UD-Q4_K_XL*" # 动态 2-bit 请使用 "*UD-Q2_K_XL*"
```

{% endstep %}

{% step %}
然后以对话模式运行模型：

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-cli \\
    --model unsloth/Qwen3.6-35B-A3B-MTP-GGUF/Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf \\
    --mmproj unsloth/Qwen3.6-35B-A3B-MTP-GGUF/mmproj-F16.gguf \\
    --temp 1.0 \\
    --top-p 0.95 \\
    --min-p 0.00 \\
    --top-k 20 \\
    --spec-type draft-mtp --spec-draft-n-max 2
```

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

### 🍎 MLX 动态量化

我们还为 MacOS 设备上传了 Qwen3.6 的动态 4bit 和 8bit 量化版本！我们的 MLX 量化算法仍在不断演进，我们正在积极优化任何可以改进的地方。

你可以在 [Unsloth Studio](#unsloth-studio-guide)!

**Qwen3.6-27B MLX：**

| [3 位](https://huggingface.co/unsloth/Qwen3.6-27B-UD-MLX-3bit) | [4 位](https://huggingface.co/unsloth/Qwen3.6-27B-UD-MLX-4bit) | [MXFP4](https://huggingface.co/unsloth/Qwen3.6-27B-UD-MLX-MXFP4) | [NVFP4](https://huggingface.co/unsloth/Qwen3.6-27B-UD-MLX-NVFP4) | [6 位](https://huggingface.co/unsloth/Qwen3.6-27B-UD-MLX-6bit) | [8 位](https://huggingface.co/unsloth/Qwen3.6-27B-MLX-8bit) |
| ------------------------------------------------------------- | ------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------- | ---------------------------------------------------------- |

**Qwen3.6-35B-A3B MLX：**

| [3 位](https://huggingface.co/unsloth/Qwen3.6-35B-A3B-UD-MLX-3bit) | [4 位](https://huggingface.co/unsloth/Qwen3.6-35B-A3B-UD-MLX-4bit) | [8 位](https://huggingface.co/unsloth/Qwen3.6-35B-A3B-MLX-8bit) |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | -------------------------------------------------------------- |

试用方法：

{% code overflow="wrap" %}

```bash
curl -fsSL https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/scripts/install_qwen3_6_mlx.sh | sh
source ~/.unsloth/unsloth_qwen3_6_mlx/bin/activate
python -m mlx_vlm.chat --model unsloth/Qwen3.6-27B-UD-MLX-4bit
```

{% endcode %}

以下是 Qwen3.6-27B 的 KL 散度（KLD）和困惑度（PPL）分数（越低越好）：

| 模型                                                               | 平均 KLD | 中位数 KLD | PPL   | P90 KLD | P99.9 KLD | 大小      |
| ---------------------------------------------------------------- | ------ | ------- | ----- | ------- | --------- | ------- |
| [8 位](https://huggingface.co/unsloth/Qwen3.6-27B-MLX-8bit)       | 0.0028 | 0.0003  | 4.812 | 0.0019  | 0.192     | 34.7 GB |
| [6 位](https://huggingface.co/unsloth/Qwen3.6-27B-UD-MLX-6bit)    | 0.0037 | 0.0007  | 4.809 | 0.0032  | 0.343     | 30.5 GB |
| [4 位](https://huggingface.co/unsloth/Qwen3.6-27B-UD-MLX-4bit)    | 0.0227 | 0.0053  | 4.821 | 0.0293  | 2.339     | 26.2 GB |
| [NVFP4](https://huggingface.co/unsloth/Qwen3.6-27B-UD-MLX-NVFP4) | 0.0325 | 0.0087  | 4.843 | 0.0466  | 3.693     | 26.2 GB |
| [MXFP4](https://huggingface.co/unsloth/Qwen3.6-27B-UD-MLX-MXFP4) | 0.0479 | 0.0153  | 4.902 | 0.0769  | 4.035     | 25.6 GB |
| [3 位](https://huggingface.co/unsloth/Qwen3.6-27B-UD-MLX-3bit)    | 0.0734 | 0.0223  | 4.976 | 0.1261  | 5.529     | 24.1 GB |

### ⚡️NVFP4

**2026年7月10日：** 我们正在发布新的 [动态 NVFP4 Qwen3.6 量化](/docs/zh/ji-chu/nvfp4.md) 运行速度约为**快 2.5 倍** ，相比其他 NVFP4 量化，具有 **更好的性能** 且文件大小相近。运行 Qwen3.6-27B NVFP4 **快 2.5 倍** 在 **24GB 显存** 以及 Qwen3.6-35B-A3B **快 1.7 倍** 在 **32GB 显存**。我们还添加了 **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 表现也很好！

<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=""><figcaption></figcaption></figure>

所有基准都使用 1x B200、128 并发。更高的并发可将 35B 提升到 17,561 token/s。我们还发布了两个 35B-A3B NVFP4 版本：

* [Qwen3.6-35B-A3B-NVFP4-Fast](https://huggingface.co/unsloth/Qwen3.6-35B-A3B-NVFP4-Fast) 这是完整的 W4A4 量化 - 快 1.79 倍
* [Qwen3.6-35B-A3B-NVFP4](https://huggingface.co/unsloth/Qwen3.6-35B-A3B-NVFP4) 它稍大一些，但更准确，且快 1.56 倍

对于准确率基准，我们对 FP8、BF16、NVIDIA 的 NVFP4 以及我们的 NVFP4 进行了 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>

<table><thead><tr><th width="372.5999755859375">Qwen3.6-35B-A3B</th><th>Qwen3.6-27B</th></tr></thead><tbody><tr><td><a href="https://huggingface.co/unsloth/Qwen3.6-35B-A3B-NVFP4">Qwen3.6-35B-A3B-NVFP4</a> （快 1.56 倍）</td><td><a href="https://huggingface.co/unsloth/Qwen3.6-27B-NVFP4">Qwen3.6-27B-NVFP4</a> （快 2.5 倍）</td></tr><tr><td><a href="https://huggingface.co/unsloth/Qwen3.6-35B-A3B-NVFP4-Fast">Qwen3.6-35B-A3B-NVFP4-Fast</a> （快 1.79 倍）</td><td></td></tr></tbody></table>

**MTP 张量也直接内置到这些量化中，以进一步提速。** 准确率提升来自对 Qwen3.6 聊天模板和数据集校准的改进。我们使用之前的聊天模板更新来提升编程和工具调用的一致性，同时减少循环和其他已报告的问题。我们的校准混合了为编程、工具调用和聊天优化的数据集，并结合了 UltraChat。

对于解码速度（每人 token 数），我们的 27B 快 1.03 倍，35B 分别快 1.17 倍和 1.22 倍。

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FR3X2O3iOBhjMS1ekX7zO%2F03_qwen36_combined_decode.png?alt=media&amp;token=a8b34056-7178-4e0d-851b-9467fa0ba2f6" alt=""><figcaption></figcaption></figure>

### NVFP4 基准

NVFP4 直接在 Blackwell Tensor Core 上运行 4-bit 权重和矩阵乘法。我们的 Qwen3.6 NVFP4 量化使用 W4A4，因此实际上使用的是 FP4 Tensor Core，所以它们的解码速度比 NVIDIA 使用 W4A16 的方案更快。我们还动态量化各层以保持准确率，并对所有量化做了 MMLU-Pro、AIME 2025、GPQA 测试，包括与 FP8 和 BF16 的比较。

**Qwen3.6-27B NVFP4 准确率基准**

| 提供方     | MMLU-Pro |  GPQA | AIME 2025 |
| ------- | -------: | ----: | --------: |
| Unsloth |    86.25 | 86.34 |     93.12 |
| NVIDIA  |    85.96 | 86.87 |     93.12 |
| FP8     |    86.11 | 86.87 |     93.75 |
| BF16    |    85.96 | 88.13 |     93.33 |

**Qwen3.6-35B-A3B NVFP4 准确率基准**

| 提供方              | MMLU-Pro |  GPQA | AIME 2025 |
| ---------------- | -------: | ----: | --------: |
| Unsloth          |    85.85 | 86.74 |     92.29 |
| **Unsloth Fast** |    85.58 | 87.75 |     91.67 |
| NVIDIA           |    85.60 | 87.12 |     91.88 |
| FP8              |    85.75 | 86.74 |     93.12 |
| BF16             |    85.75 | 86.36 |     92.50 |

我们还检查了所有基准的输出长度，它们都相近，因此新的 NVFP4 量化不会为了量化而让模型思考更久——那样就失去了量化的意义！（也就是说，如果它快 2 倍，但思考量也多 2 倍，那就没用了）

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FjG1C3y6GVWvnorRfmnIF%2Fqwen36_combined_output_length_reordered_estimated_no_footnote.png?alt=media&amp;token=2aa2d784-c082-476e-895a-4bea77385956" alt=""><figcaption></figcaption></figure>

### Marlin vs Flashinfer vs cutlass vs cute-DSL

我们还发现 Marlin 内核对 W4A4 的支持不佳——启用后会导致性能下降 2.5 倍——所以请使用 CUTLASS、Flashinfer-TRTLLM 或 Cute-DSL（在 vLLM 中会自动启用）！另外，如果你有 DGX Spark，请参见 [#dgx-spark-serving](#dgx-spark-serving "mention") 你必须使用 `--moe-backend flashinfer_b12x` ，否则推理速度会慢 2.5 倍。

**所以不要设置任何后端——让 vLLM 自动选择最佳方案。**

| 模型              | 方案    | 后端                 | 解码 tok/s | 吞吐 tok/s   |
| --------------- | ----- | ------------------ | -------- | ---------- |
| nvidia 27B      | W4A16 | marlin（自动）         | 115.6    | 2,403      |
| unsloth 27B     | W4A4  | marlin             | 105.6    | 2,127      |
| unsloth 27B     | W4A4  | cutlass            | 113.5    | 6,681      |
| unsloth 27B     | W4A4  | flashinfer\_trtllm | 112.6    | 6,158      |
| unsloth 27B     | W4A4  | **cute-DSL（自动）**   | 125.9    | **6,863**  |
| nvidia 35B-A3B  | W4A4  | marlin（自动）         | 240.8    | 8,721      |
| unsloth 35B-A3B | W4A4  | marlin             | 215.8    | 8,619      |
| unsloth 35B-A3B | W4A4  | cutlass            | 158.3    | 11,017     |
| unsloth 35B-A3B | W4A4  | **cute-DSL（自动）**   | 295.2    | **15,636** |

#### **vLLM：**

要运行 NVFP4 量化，请查看下面在 [vLLM](/docs/zh/ji-chu/inference-and-deployment/vllm-guide.md) 以及 [SGLang](/docs/zh/ji-chu/inference-and-deployment/sglang-guide.md) 中的 Qwen3.6-27B 运行命令（你可以将模型名称改为 `Qwen3.6-35-A3B-NVFP4`）。另外，不要选择任何 MoE 后端——让 vLLM 自行选择——例如 Marlin 会慢 2.5 倍！参见 [#marlin-vs-flashinfer-vs-cutlass-vs-cute-dsl](#marlin-vs-flashinfer-vs-cutlass-vs-cute-dsl "mention")如果你有 DGX Spark，请参见 [#dgx-spark-serving](#dgx-spark-serving "mention") 你必须使用 `--moe-backend flashinfer_b12x` 否则推理会慢很多。

要在单独的 venv 中安装 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 %}

然后启动 35B Fast 版本：

```shell
vllm serve unsloth/Qwen3.6-35B-A3B-NVFP4-Fast
```

将 `unsloth/Qwen3.6-35B-A3B-NVFP4-Fast` 改成对应的 NVFP4 量化名称！

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

```bash
vllm serve unsloth/Qwen3.6-35B-A3B-NVFP4-Fast
    --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 %}

### **带 NVFP4 量化的 DGX Spark**

为确保 DGX Spark 使用正确的内核（否则你会得到 **快 2 倍的慢速推理**），请先检查：

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

```bash
python -c "
import torch; from vllm.utils.flashinfer import has_flashinfer_b12x_gemm as g, has_flashinfer_b12x_moe as m
cap = torch.cuda.get_device_capability(); print('cap', cap, '| b12x gemm', g(), '| b12x moe', m()); assert cap[0] == 12 and g() and m(), 'b12x unavailable: serving would degrade to marlin W4A16'"
```

{% endcode %}

这不应该报错——如果报错了，请更新 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 %}

然后在 DGX Spark 上使用 vLLM 运行：

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

```shellscript
export CUTE_DSL_ARCH=sm_121a
vllm serve unsloth/Qwen3.6-35B-A3B-NVFP4-Fast --moe-backend flashinfer_b12x
```

{% endcode %}

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

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

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

{% endcode %}

#### **SGLang：**

```bash
python -m sglang.launch_server --model-path unsloth/Qwen3.6-27B-NVFP4 --speculative-algorithm NEXTN \\
     --speculative-num-steps 3 --speculative-eagle-topk 1 --speculative-num-draft-tokens 4
```

### 🦙 Llama.cpp 指南

在本指南中，我们将使用动态 4-bit，它在 24GB 内存 / Mac 设备上运行效果很好，可用于在 [llama.cpp](llama.cpphttps://github.com/ggml-org/llama.cpp)上进行快速推理。由于该模型在完整 F16 精度下只有大约 72GB，我们无需过多担心性能。 [查看我们的 GGUF 集合](https://huggingface.co/collections/unsloth/qwen36).

<a href="/pages/213bd08e4302b621f4392f7ee38decb275ffab02#qwen3.6-27b" class="button primary">27B</a><a href="/pages/213bd08e4302b621f4392f7ee38decb275ffab02#qwen3.6-35b-a3b" class="button primary">35-A3B</a>

{% stepper %}
{% step %}
获取最新的 `llama.cpp` **在** [**GitHub 上点击这里**](https://github.com/ggml-org/llama.cpp)。你也可以按照下面的构建说明进行操作。将 `-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 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
```

{% endstep %}

{% step %}
如果你想使用 `llama.cpp` 直接加载模型，你可以使用下面的方法：(:`Q4_K_XL`）是量化类型。你也可以通过 Hugging Face 下载（见第 3 点）。这与 `ollama run` 类似。使用 `export LLAMA_CACHE="folder"` 可强制 `llama.cpp` 保存到特定位置。该模型的最大上下文长度为 256K。

请根据具体模型选择以下命令之一：

<a href="/pages/213bd08e4302b621f4392f7ee38decb275ffab02#qwen3.6-27b" class="button primary">27B</a><a href="/pages/213bd08e4302b621f4392f7ee38decb275ffab02#qwen3.6-35b-a3b" class="button primary">35-A3B</a>

#### Qwen3.6-27B：

**思考模式：**

{% hint style="info" %}
请查看 Qwen3.6 新的 [保留思考](#thinking-enable-disable--preserve-thinking).
{% endhint %}

通用任务：

```bash
export LLAMA_CACHE="unsloth/Qwen3.6-27B-GGUF"
./llama.cpp/llama-cli \\
    -hf unsloth/Qwen3.6-27B-GGUF:UD-Q4_K_XL \\
    --temp 1.0 \\
    --top-p 0.95 \\
    --top-k 20 \\
    --min-p 0.00
```

对于精确编程任务，改为： `temperature=0.6`

**非思考模式：**

通用任务：

```bash
export LLAMA_CACHE="unsloth/Qwen3.6-27B-GGUF"
./llama.cpp/llama-server \\
    -hf unsloth/Qwen3.6-27B-GGUF:UD-Q4_K_XL \\
    --temp 0.7 \\
    --top-p 0.8 \\
    --top-k 20 \\
    --presence-penalty 1.5 \\
    --min-p 0.00 \\
    --chat-template-kwargs '{"enable_thinking":false}'
```

#### Qwen3.6-35B-A3B：

**思考模式：**

{% hint style="info" %}
请查看 Qwen3.6 新的 [保留思考](#thinking-enable-disable--preserve-thinking).
{% endhint %}

通用任务：

```bash
export LLAMA_CACHE="unsloth/Qwen3.6-35B-A3B-GGUF"
./llama.cpp/llama-cli \\
    -hf unsloth/Qwen3.6-35B-A3B-GGUF:UD-Q4_K_XL \\
    --temp 1.0 \\
    --top-p 0.95 \\
    --top-k 20 \\
    --min-p 0.00
```

对于精确编程任务，改为： `temperature=0.6`

**非思考模式：**

通用任务：

```bash
export LLAMA_CACHE="unsloth/Qwen3.6-35B-A3B-GGUF"
./llama.cpp/llama-server \\
    -hf unsloth/Qwen3.6-35B-A3B-GGUF:UD-Q4_K_XL \\
    --temp 0.7 \\
    --top-p 0.8 \\
    --top-k 20 \\
    --presence-penalty 1.5 \\
    --min-p 0.00 \\
    --chat-template-kwargs '{"enable_thinking":false}'
```

{% endstep %}

{% step %}
你也可以通过下面的代码手动下载模型（在安装之后 `pip install huggingface_hub`）。你可以选择 Q4\_K\_M 或其他量化版本，例如 `UD-Q4_K_XL` 。我们建议至少使用 2-bit dynamic 量化 `UD-Q2_K_XL` ，以平衡体积和准确度。如果下载卡住，请参见： [Hugging Face Hub、XET 调试](/docs/zh/ji-chu/troubleshooting-and-faqs/hugging-face-hub-xet-debugging.md)

```bash
hf download unsloth/Qwen3.6-35B-A3B-GGUF \\
    --local-dir unsloth/Qwen3.6-35B-A3B-GGUF \\
    --include "*mmproj-F16*" \\
    --include "*UD-Q4_K_XL*" # 动态 2-bit 请使用 "*UD-Q2_K_XL*"
```

{% endstep %}

{% step %}
然后以对话模式运行模型：

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-cli \\
    --model unsloth/Qwen3.6-35B-A3B-GGUF/Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf \\
    --mmproj unsloth/Qwen3.6-35B-A3B-GGUF/mmproj-F16.gguf \\
    --temp 1.0 \\
    --top-p 0.95 \\
    --min-p 0.00 \\
    --top-k 20
```

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

### 💡 思考：启用/禁用 + 保留思考

Qwen3.6 还具有 **保留思考** ，它会保留上一轮对话中的思考轨迹。这会增加你使用的 token 数，但可能提升继续对话时的准确率。Unsloth Studio 为 Qwen3.6 提供了“Think”和“保留思考”切换：

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FKoonE97b0H3RioMwVohd%2Fstudio%20new%20ui.gif?alt=media&amp;token=e37f2839-914e-48b8-8c81-2dac3ade9408" alt="" width="563"><figcaption><p>Unsloth Studio 默认启用 Think 开关，并提供一个新的 <a href="#preserved-thinking">保留思考</a> 切换</p></figcaption></figure></div>

要启用 **保留思考** 在 llama.cpp 中使用（将其改为 'true' 或 'false'）： '`preserve_thinking`，而不是 '`enable_thinking`' 或 '`disable_thinking`'.

{% code expandable="true" %}

```bash
--chat-template-kwargs '{"preserve_thinking":true}'
```

{% endcode %}

对于普通思考，你可以通过以下命令在 llama.cpp 中启用/禁用思考。'`true`' 和 '`false`' 可互换使用。

<table data-full-width="false"><thead><tr><th width="197.76666259765625">llama-server 操作系统：</th><th>启用思考</th><th>禁用思考</th></tr></thead><tbody><tr><td>Linux、MacOS、WSL：</td><td><pre data-overflow="wrap"><code>--chat-template-kwargs '{"enable_thinking":true}'
</code></pre></td><td><pre data-overflow="wrap"><code>--chat-template-kwargs '{"enable_thinking":false}'
</code></pre></td></tr><tr><td>Windows / Powershell：</td><td><pre data-overflow="wrap"><code>--chat-template-kwargs "{\"enable_thinking\":true}"
</code></pre></td><td><pre data-overflow="wrap"><code>--chat-template-kwargs "{\"enable_thinking\":false}"
</code></pre></td></tr></tbody></table>

以 Qwen3.6-35B-A3B 为例，要启用保留思考（默认已启用）：

```bash
./llama.cpp/llama-server \\
    --model unsloth/Qwen3.6-35B-A3B-GGUF/Qwen3.6-35B-A3B-BF16.gguf \\
    --alias "unsloth/Qwen3.6-35B-A3B-GGUF" \\
    --temp 0.6 \\
    --top-p 0.95 \\
    --top-k 20 \\
    --min-p 0.00 \\
    --port 8001 \\
    --chat-template-kwargs '{"preserve_thinking":true}'
```

然后在 Python 中：

```python
from openai import OpenAI
import json
openai_client = OpenAI(
    base_url = "http://127.0.0.1:8001/v1",
    api_key = "sk-no-key-required",
)
completion = openai_client.chat.completions.create(
    model = "unsloth/Qwen3.6-35B-A3B-GGUF",
    messages = [{"role": "user", "content": "2+2 等于多少？"},],
)
print(completion.choices[0].message.content)
print(completion.choices[0].message.reasoning_content)
```

### 👨‍💻 OpenAI Codex 与 Claude Code <a href="#claude-codex" id="claude-codex"></a>

要通过本地编码代理式工作流运行模型，你可以 [参考我们的指南](#claude-codex)。使用 `llama-server` 就是我们刚刚设置的那个，并将模型名称设置为它在 `GET /v1/models` 中报告的精确 id（ `--alias` 上面的值，例如 `unsloth/Qwen3.6-35B-A3B-GGUF`）。请遵循正确的 Qwen3.6 参数和使用说明。

{% columns %}
{% column %}
{% content-ref url="/pages/1a707991086189a8e5cd8374f3ce1b81915bc159" %}
[Claude Code](/docs/zh/ji-chu/claude-code.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
{% content-ref url="/pages/b71ddea7924324c058a771e5e831c3cb6fc75b18" %}
[OpenAI Codex](/docs/zh/ji-chu/codex.md)
{% endcontent-ref %}
{% endcolumn %}
{% endcolumns %}

例如，在按照 Claude Code 的说明后，你会看到：

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fup2DMSMPjNR8BM9pgR0v%2Fimage.png?alt=media&amp;token=152e9ee0-2491-4379-af18-8fca0789b19d" alt="" width="563"><figcaption></figcaption></figure></div>

然后我们可以比如说让它： `创建一个 Python 国际象棋游戏` :

<div><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F9TfMAoKSdMpb8OHKNnHH%2Fimage.png?alt=media&amp;token=771df3aa-91ab-4c1e-8676-1830058001ca" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FWP3lI5mQW2EHB79qqgDz%2Fimage.png?alt=media&amp;token=55cf3189-e100-419c-a615-024b45948284" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fn8DZddDODQZGCP8giKYY%2Fimage.png?alt=media&amp;token=996c8cb9-d199-4045-90f0-408690e02667" alt="" width="563"><figcaption></figcaption></figure></div>

## 📊 基准测试

### Unsloth GGUF 基准测试

我们对各提供方的 Qwen3.6-35-A3B GGUF 做了平均 KL 散度基准测试，以帮助你选择最佳量化。

* KL 散度使几乎所有 Unsloth GGUF 都位于最优的 Pareto 前沿
* KLD 用于衡量量化模型与原始 BF16 输出分布的匹配程度，反映保留的准确率。
* 这使得 Unsloth 在 22 种尺寸中的 21 种上都表现最佳
* 只有 Q6\_K 更新了更多动态层，并且我们引入了一个新的 `UD-IQ4_NL_XL` 量化

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FHq98A18pHA2ePwlInrFG%2Fqwen36_mean_q6k_corrected_arrow_pareto_fixed.png?alt=media&amp;token=a5190c8a-4d04-4d4d-be94-dd15214e6687" alt=""><figcaption><p>35B-A3B - KLD 基准（越低越好）</p></figcaption></figure></div>

### MTP 基准

我们对为 27B 和 35B MoE 制作的新量化进行了基准测试。总体而言，稠密模型在使用 MTP 时的加速幅度更大（1.4-2x），而 MoE 模型为（1.15-1.25x）。

有了它，Qwen3.6 27B 现在可以用 UD-Q2\_K\_XL 达到 140 token/s 的生成速度，而 Qwen3.6 35B-A3B 可达到 220 token/s！部分吞吐量数据存在噪声，所以不要据此推断某些量化一定比其他量化更慢。

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FfXF043cvTRVLrH2MLqHg%2FQwen36_mtp_spec_throughput_side_by_side.png?alt=media&amp;token=d2275610-fe4e-4af0-973b-0881a044f775" alt=""><figcaption></figcaption></figure>

就平均加速而言，稠密模型在 draft tokens = 2 时可达到 1.4x，而 MoE 大约为 1.15 到 1.2x。

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F7arbIuA74e9Tbv7ISRcJ%2FQwen36_mtp_spec_speedup_side_by_side_black_solid_average.png?alt=media&amp;token=92bd8705-3842-4aef-90e7-0e61b9d50fba" alt=""><figcaption></figcaption></figure>

我们不建议使用超过 2 个 draft tokens，因为当 draft tokens 为 4 时，接受率会从 83% 骤降到 50%，而 MTP 的前向传递也会变得不那么有益。

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F0n6KhVbrWqhwBbSUj0JJ%2Foutput(34).png?alt=media&amp;token=aa6adf45-f3d6-4541-bab0-8f9697c0e66c" alt=""><figcaption></figcaption></figure>

### 官方 Qwen 基准

#### Qwen3.6-27B

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FlvrSCq6GKFGADGSOTE9W%2Fqwen3.6_27b_score.png?alt=media&amp;token=6f1abf24-6a15-4988-a305-acd5638aaf0d" alt=""><figcaption></figcaption></figure></div>

#### Qwen3.6-35B-A3B

<div data-with-frame="true"><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F25aKI2tJR2PNfGfwnbZi%2Fqwen3.6_35b_a3b_score(2).png?alt=media&amp;token=f296d01d-311d-413e-8c62-122728e33008" alt=""><figcaption></figcaption></figure></div>

这些结果让取舍很简单：如果你想要内存和质量的最佳平衡，就用 Dynamic GGUF；如果你想要更快生成，就用 MTP；如果你想要在 Blackwell GPU 上获得最高吞吐量，就用 NVFP4。如果你想走最简单的路线，就在 [Unsloth Studio](#unsloth-studio-guide) 中运行模型并保持推荐的默认设置。


---

# 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.6.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.
