> 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/tutorials/minimax-m27.md).

# MiniMax-M2.7 - ローカルでの実行方法

MiniMax-M2.7 は、エージェント型コーディングおよびチャット用途向けの新しいオープンモデルです。このモデルは SWE-Pro (56.22%) と Terminal Bench 2 (57.0%) で SOTA 性能を達成しています。

この **230B パラメータ** （10B アクティブ）モデルは〜の後継です [MiniMax-M25](/docs/jp/moderu/tutorials/minimax-m25.md) そして〜を備えています **200K コンテキスト** ウィンドウ。量子化なしの bf16 では **457GB**。Unsloth Dynamic **4ビット** GGUF はサイズを **108GB** **(-60%)** まで削減するので、 **128GB RAM** 搭載デバイスで実行できま&#x3059;**:** [**MiniMax-M2.7 GGUF**](https://huggingface.co/unsloth/MiniMax-M2.7-GGUF)

すべてのアップロードはUnslothを使用 [Dynamic 2.0](/docs/jp/ji-ben/unsloth-dynamic-2.0-ggufs.md) SOTA の量子化性能のため、重要な層はより高いビット数（例: 8 ビットまたは 16 ビット）にアップキャストされます。初日アクセスを提供してくれた MiniMax に感謝します。

{% hint style="success" %}
MiniMax-M2.7 の新しい GGUF ベンチマークが利用可能になりました！ [こちらを参照](#gguf-benchmarks)
{% endhint %}

### :gear: 使用ガイド

4 ビット動的量子化 `UD-IQ4_XS` 使用します **108GB** のディスク容量 - これは〜にぴったり収まります **128GB 統合メモリ搭載 Mac** で約15トークン/秒以上、さらに〜ではより高速に動作します **1x16GB GPU と 96GB RAM** で25トークン/秒以上。 **2ビット** 量子化版、または最大の 2 ビット版は 96GB デバイスに収まります。

ほぼ **フル精度**、次を使用します `Q8_0` （8 ビット）で、243GB を使用し、256GB RAM デバイス / Mac で 15トークン/秒以上で動作します。

{% hint style="success" %}
最高の性能のために、利用可能な総メモリ（VRAM + システムRAM）が、ダウンロードする量子化済みモデルファイルのサイズを上回っていることを確認してください。そうでない場合でも、llama.cppはSSD/HDDオフロードで実行できますが、推論は遅くなります。
{% endhint %}

### 推奨設定

最高の性能を得るには、MiniMax は次のパラメータの使用を推奨します: `temperature=1.0`, `top_p = 0.95`, `top_k = 40`.

{% columns %}
{% column %}

| デフォルト設定（ほとんどのタスク）   |
| ------------------- |
| `temperature = 1.0` |
| `top_p = 0.95`      |
| `top_k = 40`        |
| {% endcolumn %}     |

{% column %}

* **最大コンテキストウィンドウ：** `196,608`
* デフォルトのシステムプロンプト：

{% code overflow="wrap" %}

```
あなたは役立つアシスタントです。あなたの名前は MiniMax-M2.7 で、MiniMax によって作られています。
```

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

## MiniMax-M2.7 のチュートリアルを実行:

MiniMax-M2.7 を 128GB RAM デバイスで動作させるために、4 ビットを使用します [`UD-IQ4_XS` 量子化版](https://huggingface.co/unsloth/MiniMax-M2.7-GGUF?show_file_info=UD-IQ4_XS%2FMiniMax-M2.7-UD-IQ4_XS-00001-of-00004.gguf)。これで MiniMax-M2.7 を [llama.cpp](#run-in-llama.cpp) と [Unsloth Studio](#run-in-unsloth-studio).

{% hint style="warning" %}
CUDA 13.2 を使用していかなるモデルも実行しないでください。文字化けや品質の低い出力の原因になる可能性があります。NVIDIA は修正に取り組んでいます。
{% endhint %}

### 🦥 Unsloth Studio で実行

MiniMax-M2.7 は現在 [Unsloth Studio](/docs/jp/shii/studio.md)。これはローカルAI向けの新しいオープンソースWeb UIです。Unsloth Studioでは、モデルをローカルで **MacOS、Windows**、Linux、そして：

{% columns %}
{% column %}

* 検索、ダウンロード、 [GGUFの実行](/docs/jp/shii/studio.md#run-models-locally) およびsafetensorモデル
* [**自己修復** ツール呼び出し](/docs/jp/shii/studio.md#execute-code--heal-tool-calling) + **ウェブ検索**
* [**コード実行**](/docs/jp/shii/studio.md#run-models-locally) （Python、Bash）
* [自動推論](/docs/jp/shii/studio.md#model-arena) パラメータ調整（temp、top-pなど）
* 高速な CPU + GPU 推論と CPU オフロードのために llama.cpp を使用します
  {% endcolumn %}

{% column %}

<div data-with-frame="true"><figure><img src="/files/52ac81606e9a31b3f691aabcec5c0ad84f45aee2" 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
```

{% endstep %}

{% step %}

#### Unsloth を起動

**MacOS、Linux、WSL、Windows:**

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

**その後 `http://localhost:8888` をブラウザで開いてください。**
{% endstep %}

{% step %}

#### MiniMax-M2.7 を検索してダウンロード

初回起動時には、アカウントを保護するためのパスワードを作成し、後で再度サインインする必要があります。その後、モデル、データセット、基本設定を選ぶ簡単なオンボーディングウィザードが表示されます。いつでもスキップできます。

選択できます `UD-IQ4_XS` （動的 4 ビット量子化）または次のような他の量子化版 `UD-Q4_K_XL` 。ダウンロードが止まる場合は、 [Hugging Face Hub、XETのデバッグ](/docs/jp/ji-ben/troubleshooting-and-faqs/hugging-face-hub-xet-debugging.md)

その後、 [Unsloth Chat](/docs/jp/shii/studio/chat.md) タブを開き、検索バーで MiniMax-M2.7 を検索して、希望するモデルと量子化版をダウンロードしてください。サイズが大きいためダウンロードには少し時間がかかりますので、お待ちください。高速な推論を確保するには、次のものがあることを確認してください [十分な RAM/VRAM](#usage-guide)が必要です。そうでなくても推論は動作しますが、Unsloth が CPU にオフロードします。

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

{% step %}

#### MiniMax-M2.7 を実行

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

詳細については、 [Unsloth Studio 推論ガイド](/docs/jp/shii/studio/chat.md).
{% endstep %}
{% endstepper %}

### ✨ llama.cpp で実行

{% hint style="warning" %}
CUDA 13.2 を使用していかなるモデルも実行しないでください。文字化けや品質の低い出力の原因になる可能性があります。NVIDIA は修正に取り組んでいます。
{% endhint %}

{% 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 サポートはデフォルトで有効です。

{% 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 %}
もし `llama.cpp` モデルを直接読み込むには、以下のようにします: (:IQ4\_XS) は量子化タイプです。Hugging Face（3 番）経由でもダウンロードできます。これは次と同様です `ollama run` と似ています。 `export LLAMA_CACHE="folder"` を使って `llama.cpp` を特定の場所に保存します。モデルのコンテキスト長は最大 200K しかないことを覚えておいてください。

以下は **ほとんどのデフォルト** ユースケース：

```bash
export LLAMA_CACHE="unsloth/MiniMax-M2.7-GGUF"
./llama.cpp/llama-cli \\
    -hf unsloth/MiniMax-M2.7-GGUF:UD-IQ4_XS \
    --temp 1.0 \\
    --top-p 0.95 \\
    --top-k 40
```

{% endstep %}

{% step %}
モデルをダウンロード（ `pip install huggingface_hub hf_transfer`をインストールした後）。UD-IQ4\_XS（動的 4 ビット量子化）または次のような他の量子化版を選択できます `UD-Q6_K_XL` 。サイズと精度のバランスを取るため、4bit 動的量子化 UD-IQ4\_XS の使用を推奨します。ダウンロードが止まる場合は、以下を参照してください [Hugging Face Hub、XETのデバッグ](/docs/jp/ji-ben/troubleshooting-and-faqs/hugging-face-hub-xet-debugging.md)

```bash
hf download unsloth/MiniMax-M2.7-GGUF \
    --local-dir unsloth/MiniMax-M2.7-GGUF \
    --include "*UD-IQ4_XS*" # 8ビットの場合は "*Q8_0*" を使用
```

{% endstep %}

{% step %}
以下を編集できます `--threads 32` CPUスレッド数として、 `--ctx-size 16384` コンテキスト長として、 `--n-gpu-layers 2` GPUオフロードする層数として指定します。GPUのメモリ不足が起きる場合は調整してみてください。CPUのみで推論する場合は削除してください。

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-cli \\
    --model unsloth/MiniMax-M2.7-GGUF/UD-IQ4_XS/MiniMax-M2.7-UD-IQ4_XS-00001-of-00004.gguf \
    --temp 1.0 \\
    --top-p 0.95 \\
    --top-k 40
```

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

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

MiniMax-M2.7 を本番環境にデプロイするには、 `llama-server` または OpenAI API を使用します。新しいターミナルで、tmux 経由などで、次のようにモデルをデプロイします:

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-server \\
    --model unsloth/MiniMax-M2.7-GGUF/UD-IQ4_XS/MiniMax-M2.7-UD-IQ4_XS-00001-of-00004.gguf \
    --alias "unsloth/MiniMax-M2.7" \
    --prio 3 \
    --temp 1.0 \\
    --top-p 0.95 \\
    --min-p 0.01 \\
    --top-k 40 \
    --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/MiniMax-M2.7",
    messages = [{"role": "user", "content": "Snakeゲームを作成してください。"},],
)
print(completion.choices[0].message.content)
```

{% endcode %}

## 📊 ベンチマーク

### GGUFベンチマーク

以下は MiniMax-M2.7 の KLD 99% ベンチマークです。左下ほど良いです:

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

MiniMax-M2.7 は MiniMax-M2.5 と同じアーキテクチャを使用しているため、M2.7 の GGUF 量子化ベンチマークは M2.5 と非常によく似ているはずです。そのため、M2.5 で実施された以前の量子化ベンチマークも参照します:

<figure><img src="/files/76def291f438cd1ff454aa7c6f1de12650b34040" alt=""><figcaption></figcaption></figure>

[Benjamin Marie（第三者）がベンチマークを実施](https://x.com/bnjmn_marie/status/2027043753484021810/photo/1) **MiniMax-M2.5** 〜を使用して **Unsloth の GGUF 量子化** 〜上で **750プロンプトの混合スイート** （LiveCodeBench v6、MMLU Pro、GPQA、Math500）に対して、両方を報告し： **全体精度** と **相対エラー増加** （量子化モデルが元モデルに比べてどれだけ頻繁に誤るか）。

Unsloth の量子化版は、精度に関係なく、非 Unsloth の対応版よりも精度と相対誤差の両方で大幅に優れています（8GB 小さいにもかかわらず）。

**主な結果:**

* **ここでの最良の品質/サイズ比: `unsloth UD-Q4_K_XL`.**\
  Original に最も近く、わずか **6.0 ポイント** 低く、そして「たった」 **+22.8%** ベースラインよりエラーが多いです。
* **他の Unsloth の Q4 量子化版は互いに非常に近い性能です（精度約64.5〜64.9）。**\
  `IQ4_NL`, `MXFP4_MOE`、そして `UD-IQ2_XXS` は、このベンチマークでは基本的に同じ品質で、 **約33〜35%** Original よりエラーが多いです。
* Unsloth の GGUF は、他の非 Unsloth GGUF よりもはるかに優れています。例: `lmstudio-community - Q4_K_M` （8GB 小さいにもかかわらず）そして `AesSedai - IQ3_S`.

### 公式ベンチマーク

<figure><img src="/files/58e1786b73ed45d87dc0997a20523be11a9391ce" 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/jp/moderu/tutorials/minimax-m27.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.
