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

# Kimi K2.6 - ローカル実行方法

Kimi K2.6はMoonshotによるオープンモデルで、視覚、コーディング、エージェント、長文コンテキスト、チャットの各タスクでSOTA性能を発揮します。1Tパラメータのハイブリッド推論モデルで、コンテキスト長は256Kです。フル精度では610GBのディスク容量が必要で、Dynamic 2-bitでは **350GB（サイズ-43%）**。Unsloth Dynamic経由でKimi K2.6を実行 [**Kimi-K2.6-GGUFs**](https://huggingface.co/unsloth/Kimi-K2.6-GGUF) Unsloth Studioまたはllama.cpp上で。

**Dynamic 2-bit** 重要な層を8-bitにアップキャストし、必要とします **350GB以上のVRAM/RAM** 構&#x6210;**.** 対象: **損失なし** Kimi K2.6では、Q8（`UD-Q8_K_XL`）を使用します。これはわずか **10GB大きい** Q4（`UD-Q4_K_XL`）より大きいだけです。すべてのアップロードは [Dynamic 2.0](/docs/jp/ji-ben/unsloth-dynamic-2.0-ggufs.md) を用いてSOTAな量子化性能を実現します。Kimi-K2.6 GGUFはまた **画像入力にも対応しています。**

**表: ハードウェア要件** (単位 = 総メモリ: RAM + VRAM、または統合メモリ)

| 測定     | Dynamic 2-bit | Q4     | Q8（損失なし） |
| ------ | ------------- | ------ | -------- |
| ディスク容量 | 340 GB        | 584 GB | 595 GB   |
| 困惑度    | 2.4131        | 1.8420 | 1.8419   |

### 📊 量子化分析

`UD-Q8_K_XL` は損失なしです。というのも、KimiはMoEの重みにint4を使い、それ以外にはBF16を使っており、さらに `Q8_K_XL` に従っているからです。 `UD-Q4_K_XL` はそれと似ていますが、残りのテンソルが `Q8_0`です。そのためほぼフル精度で、600GBのRAM/VRAMが必要です。ほかのプロバイダによる非UnslothのGGUFは、 `UD-Q4_K_XL` アプローチではなく「真に損失なし」 `UD-Q8_K_XL`.

私たちは [jukofyork](https://github.com/jukofyork)の発見に従い、 `const float d = max / -7;` デフォルトの `const float d = max / -8;` を、量子化プロセス中にMoE層にのみ適用しました。このINT4ネイティブなMoEへの全単射パッチにより、 `Q4_0` 量子化タイプの絶対誤差を1.8%からほぼ0%（機械イプシロン）まで減らせます。

ただし、他の層はBF16のままにする必要があり、以下ではBF16ベースラインに対する両者の誤差プロットを示します。 `UD-Q8-K_XL` は、Q4\_0をBF16に変換する際に機械イプシロン程度の差はありますが、真に「損失なし」です。 `UD-Q8_K_XL` のパープレキシティは1.8419 ± 0.00721で、 `UD-Q4_K_XL` 1.8420 ± 0.00720でした。下の誤差プロットはRMSEをbfloat16イプシロンで割ったものなので、誤差スケールは小さい点に注意してください。

<div data-with-frame="true"><figure><img src="/files/bc2c63518348079557a3caff73c3e16bc122b6a5" alt=""><figcaption><p>の違いを見てください <code>Q4_K_XL</code> （青）と <code>Q8_K_XL</code> （オレンジ）。これは損失なしで、10GB大きいです。</p></figcaption></figure></div>

### :gear: 使用ガイド

**思考モードと非思考モードでは異なる設定が必要です:**

| デフォルト（思考モード）      | インスタントモード         |
| ----------------- | ----------------- |
| temperature = 1.0 | temperature = 0.6 |
| top\_p = 0.95     | top\_p = 0.95     |

* 推奨コンテキスト長 = `98,304` （最大 `262,144`)

モデルが収まるなら、B200を使うと40トークン/秒以上が得られます。おすすめは `UD-Q2_K_XL` （350GB）で、サイズ/品質のバランスが良いです。大まかな目安としては、RAM+VRAM ≈ 量子化サイズです。それ以外でも動作はしますが、オフロードのため遅くなります。

#### Kimi K2.6のチャットテンプレート

実行中 `tokenizer.apply_chat_template([{\"role\": \"user\", \"content\": \"What is 1+1?\"},])` で次のようになります:

{% code overflow="wrap" %}

```
<|im_system|>system<|im_middle|>あなたはMoonshot AIによって作られたAIアシスタント、Kimiです。<|im_end|><|im_user|>user<|im_middle|>1+1は？<|im_end|><|im_assistant|>assistant<|im_middle|><think>
```

{% endcode %}

## Kimi K2.6実行ガイド

### 🦥 Unsloth StudioでKimi-K2.6を実行

Kimi K2.6は [Unsloth Studio](/docs/jp/xin-zhe/studio.md)で実行できます。これはローカルAI向けのオープンソースWeb UIです。 **Unsloth Studioは自動的にRAMへオフロードし、マルチGPU構成を検出します**。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) + **ウェブ検索**
* [**コード実行**](/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/c32867f999db074387ac16732ce548485cc593de" 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
```

**Unslothを起動**

MacOS、Linux、WSL、およびWindows:

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

次に開きます `http://localhost:8888` をブラウザで。
{% endstep %}

{% step %}
**Kimi-K2.6を検索してダウンロード**

Unsloth Studioは自動的にRAMへオフロードし、マルチGPU構成を検出します。初回起動時には、アカウントを保護するためのパスワードを作成し、後で再度サインインする必要があります。

次に [Studio Chat](/docs/jp/xin-zhe/studio/chat.md) タブへ移動し、 **Kimi-K2.6** を検索バーで検索し、希望するモデルと量子化版をダウンロードしてください。モデルを実行するのに十分な計算資源があることを確認してください。

<div data-with-frame="true"><figure><img src="/files/4f76318291b3d035d42a4d1d2b9c514024f09710" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**Kimi-K2.6を実行**

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

詳細については、以下をご覧ください [Unsloth Studio推論ガイド](/docs/jp/xin-zhe/studio/chat.md).

<div data-with-frame="true"><figure><img src="/files/aefe9115149da8c8069575f294893ffc6e2b9d80" alt="" width="563"><figcaption><p>ツール呼び出しを使って動作するQwen3.6の例</p></figcaption></figure></div>
{% endstep %}
{% endstepper %}

### 🦙 llama.cppでKimi K2.6を実行

このガイドでは、少なくとも350GBのRAMが必要なUD-Q2\_K\_XL量子化版を実行します。量子化タイプは自由に変更してください。GGUF: [**Kimi-K2.6-GGUF**](https://huggingface.co/unsloth/Kimi-K2.6-GGUF)

これらのチュートリアルでは [llama.cpp](llama.cpphttps://github.com/ggml-org/llama.cpp) を使用して、高速なローカル推論を行います。特にCPUしかない場合に有効です。

{% 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` を直接使ってモデルを読み込み、ダウンロードできます。ちょうど `ollama run`のようにです。まず、希望する量子化タイプを選択します。たとえば `Q2_K_XL`。また `export LLAMA_CACHE="folder"` を使うと `llama.cpp` を特定の場所に保存できます。このダウンロードプロセスはかなり遅い可能性があるため、次のセクションの手動ダウンロード手順を使うのがおそらく最善です。

用途に応じて、以下の特定コマンドのいずれかを使用してください:

**思考モード:**

```bash
export LLAMA_CACHE="unsloth/Kimi-K2.6-GGUF"
./llama.cpp/llama-cli \
    -hf unsloth/Kimi-K2.6-GGUF:UD-Q2_K_XL \
    --temp 1.0 \
    --top-p 0.95
```

**非思考モード（インスタント）:**

```bash
export LLAMA_CACHE="unsloth/Kimi-K2.6-GGUF"
./llama.cpp/llama-cli \
    -hf unsloth/Kimi-K2.6-GGUF:UD-Q2_K_XL \
    --temp 0.6 \
    --top-p 0.95 \
    --chat-template-kwargs '{"enable_thinking":false}'
```

{% endstep %}

{% step %}
モデルを手動でダウンロードしたい場合は、以下のコードでダウンロードできます（ `pip install huggingface_hub`をインストールした後）。ダウンロードが止まる場合は、こちらをご覧ください: [Hugging Face Hub、XETデバッグ](/docs/jp/ji-ben/troubleshooting-and-faqs/hugging-face-hub-xet-debugging.md)

```bash
hf download unsloth/Kimi-K2.6-GGUF \
    --local-dir unsloth/Kimi-K2.6-GGUF \
    --include "*mmproj-F16*" \
    --include "*UD-Q2_K_XL*" # フル精度には "*UD-Q8_K_XL*" を使用
```

{% endstep %}

{% step %}
次に、会話モードでモデルを実行します:

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-cli \
    --model unsloth/Kimi-K2.6-GGUF/UD-Q2_K_XL/Kimi-K2.6-UD-Q2_K_XL-00001-of-0008.gguf \
    --mmproj unsloth/Kimi-K2.6-GGUF/mmproj-F16.gguf \
    --temp 1.0 \
    --top-p 0.95
```

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

### 📊 ベンチマーク

ベンチマークの表形式は、さらに下で確認できます:

<div data-with-frame="true"><figure><img src="/files/0fc7f1e7f0d1887f093014d7cdef5eccafc339d8" alt="" width="563"><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/kimi-k2.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.
