> 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/dynamic-3.0-ggufs.md) SOTAな量子化性能のため、重要な層はより高いビット数（例：8ビットまたは16ビット）へアップキャストされます。初日アクセスを提供してくれたMiniMaxに感謝します。

{% hint style="success" %}
NEW 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）
* [自動推論](https://unsloth.ai/docs/desktop#feature-deep-dive) パラメータ調整（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` 。サイズと精度のバランスを取るため、4ビット動的量子化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": "Create a Snake game."},],
)
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`.**\
  元版に最も近く、わずか **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.
