> 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/jp/moderu/qwen3.6.md).

# Qwen3.6 - ローカルでの実行方法

Qwen3.6 は Alibaba の新しいマルチモーダル・ハイブリッド思考モデル群で、以下を含みます: **Qwen3.6-27B** と **35B-A3B**。そのサイズに対して最高レベルの性能を発揮し、201言語で 256K コンテキストをサポートします。エージェント型コーディング、ビジョン、チャットタスクで優れた性能を発揮します。Qwen3.6-27B は **18GB RAM** の構成で動作し、35B-A3B は **22GB**で動作します。これでモデルを [Unsloth Studio](#unsloth-studio-guide).

{% hint style="success" %}
**新着:** [**Qwen3.6 MTP が登場**](#mtp-guide)**！MTP により、精度を落とさずに 1.4〜2.2 倍高速な推論が可能になります。MTP を直接** [**Unsloth Studio**](#unsloth-studio-mtp-guide)**.**

私たちは [Qwen3.6 GGUF ベンチマークを実施しました](#unsloth-gguf-benchmarks) 。最適な量子化を選ぶために。
{% endhint %}

<a href="/pages/b1345d93eb2f70a681e5a0bf731e28a576f0f428#qwen3.6-inference-tutorials" class="button primary">Qwen3.6 チュートリアルを実行</a><a href="/pages/b1345d93eb2f70a681e5a0bf731e28a576f0f428#mtp-guide" class="button primary">MTP ガイド</a>

{% columns %}
{% column %}
Qwen3.6 の GGUF は Unsloth を使用します [Dynamic 2.0](/docs/jp/ji-ben/unsloth-dynamic-2.0-ggufs.md) を使うことで、最先端の量子化性能を実現しています。そのため、量子化は実世界のユースケースデータセットで較正され、重要な層は上位精度に変換されます。 *初日アクセスを提供してくれた Qwen に感謝します。*

* **developer ロールのサポート** Codex、OpenCode など向け:\
  私たちのアップロードは今や `developer ロール` に対応しており、エージェント型コーディングツールで利用できます。
* **ツール呼び出し:** 同様に [Qwen3.5](/docs/jp/moderu/qwen3.5.md)、入れ子のオブジェクトの解析を改善し、ツール呼び出しがより成功しやすくなりました。
  {% endcolumn %}

{% column %}

<div data-with-frame="true"><figure><img src="/files/aefe9115149da8c8069575f294893ffc6e2b9d80" 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-bit</th><th>4-bit</th><th width="128">6-bit</th><th>8-bit</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）が、ダウンロードする量子化済みモデルファイルのサイズを上回っていることを確認してください。上回っていない場合でも、llama.cpp は SSD/HDD オフロード経由で実行できますが、推論は遅くなります。
{% endhint %}

{% hint style="warning" %}
CUDA 13.2 は使わないでください。意味不明な出力になる可能性があります。CUDA 13.2 未満または CUDA 13.3 を使用してください。
{% endhint %}

**Qwen3.6 を学習するには、以前の** [**Qwen3.5 ファインチューニングガイド**](/docs/jp/moderu/qwen3.5/fine-tune.md)**.**

### 推奨設定

* **最大コンテキストウィンドウ:** `262,144` (YaRN により 1M まで拡張可能)
* `presence_penalty = 0.0 〜 2.0` デフォルトではオフですが、繰り返しを減らすために使用できます。ただし、より高い値を使うと **性能がわずかに低下する可能性があります**
* **十分な出力長**: `32,768` ほとんどのクエリでのトークン数

{% 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 %}

#### Instruct（非思考）モードの設定:

| 一般的なタスク                     |
| --------------------------- |
| 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 %}

一般的なタスク向けの Instruct（非思考）:

{% 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="/pages/0af04e20683a2825742edd360e0a15913f42c5a8#unsloth-studio-guide" class="button primary">Unsloth Studio で実行</a><a href="/pages/b1345d93eb2f70a681e5a0bf731e28a576f0f428#llama.cpp-guides" class="button secondary">llama.cpp で実行</a><a href="/pages/b1345d93eb2f70a681e5a0bf731e28a576f0f428#mtp-guide" class="button primary">MTP ガイド</a><a href="/pages/b1345d93eb2f70a681e5a0bf731e28a576f0f428#nvfp4" class="button secondary">NVFP4 ガイド</a>

{% hint style="warning" %}
CUDA 13.2 は使わないでください。意味不明な出力になる可能性があります。CUDA 13.2 未満または CUDA 13.3 を使用してください。
{% endhint %}

### 🦥 Unsloth Studio ガイド

Qwen3.6 と Qwen3.6 MTP は現在、 [Unsloth Studio](/docs/jp/xin-zhe/studio.md)は、ローカル AI 向けの新しいオープンソース Web UI です。Unsloth Studio を使えば、モデルを **macOS、Windows**、Linux などでローカル実行できます:

{% columns %}
{% column %}

* 検索、ダウンロード、 [GGUF を実行](/docs/jp/xin-zhe/studio.md#run-models-locally) および safetensors モデル
* [**自己修復** ツール呼び出し](/docs/jp/xin-zhe/studio.md#execute-code--heal-tool-calling) + **Web 検索**
* [**コード実行**](/docs/jp/xin-zhe/studio.md#run-models-locally) (Python、Bash)
* [自動推論](/docs/jp/xin-zhe/studio.md#model-arena) パラメータ調整（temp、top-p など）
* llama.cpp による高速な CPU + GPU 推論
* [LLM を学習](/docs/jp/xin-zhe/studio.md#no-code-training) VRAM を 70% 削減しながら 2 倍高速
  {% endcolumn %}

{% column %}

<div data-with-frame="true"><figure><img src="/files/2c86177fef09b636c736623bc2c2908ac9873309" alt=""><figcaption></figcaption></figure></div>
{% endcolumn %}
{% endcolumns %}

{% 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
```

{% 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="/files/698ae7636b7c9b8a8122c6fbdabc1bd2273fdb2c" alt="" width="375"><figcaption></figcaption></figure></div>

その後、 `http://127.0.0.1:8888` （または専用 URL）をブラウザで開きます。
{% endstep %}

{% step %}

#### Qwen3.6 または Qwen3.6 MTP を検索してダウンロード

初回起動時には、アカウントを保護するためのパスワードを作成し、後で再度サインインする必要があります。その後、 [Studio Chat](/docs/jp/xin-zhe/studio/chat.md) タブを開き、検索バーで Qwen3.6 または Qwen3.6 MTP を検索して、希望のモデルと量子化をダウンロードしてください。

<div data-with-frame="true"><figure><img src="/files/6c4204f32f4f7345f45f031004057c2e0d798d91" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Qwen3.6 を実行

推論パラメータは Unsloth Studio 使用時に自動設定されるはずですが、手動で変更することもできます。コンテキスト長、チャットテンプレート、その他の設定も編集できます。

詳細については、次をご覧ください: [Unsloth Studio 推論ガイド](/docs/jp/xin-zhe/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（Multi Token Prediction） 推測的デコーディングにより、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 は現在 160 tokens/s、Qwen3.6 35B-A3B は RTX 6000 GPU 上で 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="/pages/b1345d93eb2f70a681e5a0bf731e28a576f0f428#unsloth-studio-mtp-guide" class="button primary">Unsloth Studio で実行</a><a href="/pages/b1345d93eb2f70a681e5a0bf731e28a576f0f428#llama.cpp-mtp-guide" class="button secondary">llama.cpp で実行</a><a href="/pages/b1345d93eb2f70a681e5a0bf731e28a576f0f428#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="/files/79b0e64b0c4c5291d7ca2efbc1d52ed6ecc127e2" alt=""><figcaption></figcaption></figure> <figure><img src="/files/0561a4e8c87a3ade89ad713eb2897e3967a03b52" alt=""><figcaption></figcaption></figure></div>

実際には、MTP はいくつか先のトークンを予測し、その後メインモデルがそれらのトークンを並列に検証します。これにより生成時に必要な順伝播回数が減り、出力が高速になります。 **私たちは `--spec-draft-n-max 2` が、ほとんどの環境で最もよく動作することを確認しました。** **ただし、 `2` が最適だと決めつけないでください。性能はハードウェア依存です。次の値を試してください: `1` から `6` まで**

、そしてご自身のシステムで最も速いものを使用してください。 [MTP GGUF をアップロードしました](https://huggingface.co/unsloth/models?search=mtp) 次の [**Qwen3.5**](/docs/jp/moderu/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-bit</th><th>4-bit</th><th width="128">6-bit</th><th>8-bit</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 を検索してダウンロード

初回起動時には、アカウントを保護するためのパスワードを作成し、後で再度サインインする必要があります。その後、 [Studio Chat](/docs/jp/xin-zhe/studio/chat.md) タブを開き、検索バーで Qwen3.6 MTP を検索して、希望のモデルと量子化をダウンロードしてください。

<div data-with-frame="true"><figure><img src="/files/3d9052ef233d9a70773230b1cab0b1212d78b4b3" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Qwen3.6 MTP を実行

推論パラメータは Unsloth Studio 使用時に自動設定されるはずですが、手動で変更することもできます。コンテキスト長、チャットテンプレート、その他の設定も編集できます。

詳細については、次をご覧ください: [Unsloth Studio 推論ガイド](/docs/jp/xin-zhe/studio/chat.md)。以下では、2-bit Qwen3.6 MTP GGUF が 10 回以上のツール呼び出しを行い、10 のサイトを検索し、Python コードを実行しました:

<div data-with-frame="true"><figure><img src="/files/27973fefe5b7ff34e02e2db67d51a11ac926e6a1" 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/b1345d93eb2f70a681e5a0bf731e28a576f0f428#mtp-qwen3.6-27b" class="button primary">27B MTP</a><a href="/pages/b1345d93eb2f70a681e5a0bf731e28a576f0f428#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 quant を使用することを推奨します `UD-Q2_K_XL` サイズと精度のバランスを取るためです。ダウンロードが止まる場合は、次を参照してください: [Hugging Face Hub、XETデバッグ](/docs/jp/ji-ben/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*" # Dynamic 2bit には "*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 %}

### 🦙 Llama.cpp ガイド

このガイドでは Dynamic 4-bit を使用します。これは 24GB RAM / Mac デバイスでの次の高速推論に最適です [llama.cpp](llama.cpphttps://github.com/ggml-org/llama.cpp)。モデルは F16 の完全精度でも約 72GB しかないため、性能についてあまり心配する必要はありません。 [GGUF コレクションをご覧ください](https://huggingface.co/collections/unsloth/qwen36).

<a href="/pages/b1345d93eb2f70a681e5a0bf731e28a576f0f428#qwen3.6-27b" class="button primary">27B</a><a href="/pages/b1345d93eb2f70a681e5a0bf731e28a576f0f428#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/b1345d93eb2f70a681e5a0bf731e28a576f0f428#qwen3.5-27b" class="button primary">27B</a><a href="/pages/b1345d93eb2f70a681e5a0bf731e28a576f0f428#qwen3.5-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 quant を使用することを推奨します `UD-Q2_K_XL` サイズと精度のバランスを取るためです。ダウンロードが止まる場合は、次を参照してください: [Hugging Face Hub、XETデバッグ](/docs/jp/ji-ben/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*" # Dynamic 2bit には "*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 %}

#### Llama-server と OpenAI completion ライブラリ

本番環境で Qwen3.6 を展開するには、 `llama-server` 新しい端末で、tmux などを使って、次でモデルを展開します:

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-server \\
--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 \\
    --alias "unsloth/Qwen3.6-35B-A3B" \\
    --temp 0.6 \
    --top-p 0.95 \\
    --ctx-size 16384 \\
    --top-k 20 \\
    --min-p 0.00 \\
    --port 8001
```

{% endcode %}

その後、新しい端末で、次を実行したあとに `pip install openai`、次を実行します:

{% code overflow="wrap" %}

```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",
    messages = [{"role": "user", "content": "Create a Snake game."},],
)
print(completion.choices[0].message.content)
```

{% endcode %}

### 🍎 MLX 動的量子化

macOS デバイス向けに、動的な Qwen3.6 4bit および 8bit 量子化もアップロードしました！MLX の量子化アルゴリズムはまだ進化中で、改善できる点は積極的に磨き続けています。

すべての MLX モデルを [Unsloth Studio](#unsloth-studio-guide)!

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

| [3-bit](https://huggingface.co/unsloth/Qwen3.6-27B-UD-MLX-3bit) | [4-bit](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-bit](https://huggingface.co/unsloth/Qwen3.6-27B-UD-MLX-6bit) | [8-bit](https://huggingface.co/unsloth/Qwen3.6-27B-MLX-8bit) |
| --------------------------------------------------------------- | --------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------ |

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

| [3-bit](https://huggingface.co/unsloth/Qwen3.6-35B-A3B-UD-MLX-3bit) | [4-bit](https://huggingface.co/unsloth/Qwen3.6-35B-A3B-UD-MLX-4bit) | [8-bit](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-bit](https://huggingface.co/unsloth/Qwen3.6-27B-MLX-8bit)     | 0.0028 | 0.0003 | 4.812 | 0.0019  | 0.192     | 34.7 GB |
| [6-bit](https://huggingface.co/unsloth/Qwen3.6-27B-UD-MLX-6bit)  | 0.0037 | 0.0007 | 4.809 | 0.0032  | 0.343     | 30.5 GB |
| [4-bit](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-bit](https://huggingface.co/unsloth/Qwen3.6-27B-UD-MLX-3bit)  | 0.0734 | 0.0223 | 4.976 | 0.1261  | 5.529     | 24.1 GB |

### ⚡️NVFP4

これで、NVFP4 quant 内に MTP テンソルが直接統合された NVFP4 quant を実行できるようになりました。どちらも [vLLM](/docs/jp/ji-ben/inference-and-deployment/vllm-guide.md) と [SGLang](/docs/jp/ji-ben/inference-and-deployment/sglang-guide.md) これに使えます。試したのは `vllm==0.22.0` と `sglang==0.5.9` （SGLang の main を使う必要があるかもしれません。）

* Qwen3.6-35B-A3B NVFP4: [huggingface.co/unsloth/Qwen3.6-35B-A3B-NVFP4](https://huggingface.co/unsloth/Qwen3.6-35B-A3B-NVFP4)
* Qwen3.6-27B NVFP4: [huggingface.co/unsloth/Qwen3.6-27B-NVFP4](https://huggingface.co/unsloth/Qwen3.6-27B-NVFP4)

#### **vLLM:**

```shell
vllm serve unsloth/Qwen3.6-35B-A3B-NVFP4 --trust-remote-code --dtype bfloat16 --moe-backend marlin \\
     --speculative-config '{"method":"mtp","num_speculative_tokens":3,"moe_backend":"triton"}'
```

#### **SGLang:**

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

### 💡 Thinking: 有効化/無効化 + Thinking の保持

Qwen3.6 にはまた **思考保持** 前回の会話の思考トレースを残すものがあります。これにより使用トークン数は増えますが、継続会話で精度が向上する可能性があります。Unsloth Studio には Qwen3.6 用の 'Think' と Preserved Thinking のトグルがあります:

<div data-with-frame="true"><figure><img src="/files/2c86177fef09b636c736623bc2c2908ac9873309" 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`を同じように使えます。&#x20;

<table data-full-width="false"><thead><tr><th width="197.76666259765625">llama-server OS:</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` （ `--alias` の上の値、たとえば `unsloth/Qwen3.6-35B-A3B-GGUF`）。正しい Qwen3.6 のパラメータと使用手順に従ってください。

{% columns %}
{% column %}
{% content-ref url="/pages/ee610b22aa43d29d8415fd27eb7de15ba88f7385" %}
[Claude Code](/docs/jp/ji-ben/claude-code.md)
{% endcontent-ref %}
{% endcolumn %}

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

例えば Claude Code の手順に従った後、次のように表示されます:

<div data-with-frame="true"><figure><img src="/files/ac5ba4dbc7b649aceacab8fa5ec1e8616642acf6" alt="" width="563"><figcaption></figcaption></figure></div>

その後、たとえば `チェスの Python ゲームを作成して` :

<div><figure><img src="/files/ad665850d5315c4be5a608351515356ff59d082b" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="/files/e66b5d09d577fb36f0dc6f8e34d987a9ae0dbbaf" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="/files/03a03b0c279f2ea141b94abfad9dec6275485ba1" alt="" width="563"><figcaption></figcaption></figure></div>

## 📊 ベンチマーク

### Unsloth GGUF ベンチマーク

最適な quant を選べるように、プロバイダ横断で Qwen3.6-35-A3B GGUF の平均 KLダイバージェンス ベンチマークを実施しました。

* KLダイバージェンスは、ほぼすべての Unsloth GGUF を SOTA のパレートフロンティア上に置きます
* KLD は、量子化モデルが元の BF16 出力分布にどれだけ一致しているかを示し、保持された精度を示します。
* これにより、Unsloth は 22 サイズ中 21 で最高性能となっています
* Q6\_K だけはより多くの Dynamic layers に更新され、新しい `UD-IQ4_NL_XL` quant

<div data-with-frame="true"><figure><img src="/files/4c08db77b028c47fb00e50cef262107be104ee6c" alt=""><figcaption><p>35B-A3B - KLD ベンチマーク（低いほど良い）</p></figcaption></figure></div>

### MTP ベンチマーク

27B と 35B MoE 向けに作成した新しい quant をベンチマークしました。一般に、dense モデルは MTP によりはるかに高速化され（1.4〜2倍）、MoE モデルは（1.15〜1.25倍）です。

これにより、Qwen3.6 27B は UD-Q2\_K\_XL で 140 トークン/秒、Qwen3.6 35B-A3B は 220 トークン/秒の生成が可能になりました！ いくつかのスループット数値にはノイズがあるため、ある quant が別の quant より遅いと推測しないでください。

<figure><img src="/files/0be40c03eed7eba6a93166c2930703af56a05dc1" alt=""><figcaption></figcaption></figure>

平均的な高速化としては、draft tokens = 2 の dense モデルで 1.4 倍、MoE では約 1.15〜1.2 倍が見られます。

<figure><img src="/files/9ad74ac0817971a8d639515bbe05713c590a910c" alt=""><figcaption></figcaption></figure>

draft tokens を 2 以上にすることは推奨しません。なぜなら、4 draft tokens では受理率が 83% から 50% に急落し、MTP の順伝播の利点が小さくなるためです。

<figure><img src="/files/f405e08baa16d30163fa4b56f824461d0d58a16a" alt=""><figcaption></figcaption></figure>

### 公式 Qwen ベンチマーク

#### Qwen3.6-27B

<div data-with-frame="true"><figure><img src="/files/ae8cf9759eda9c2bf4a7855b693e4094d1cfc401" alt=""><figcaption></figcaption></figure></div>

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

<div data-with-frame="true"><figure><img src="/files/a243f47e131f6935101027836cee3daef8054df9" alt=""><figcaption></figcaption></figure></div>


---

# 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/jp/moderu/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.
