> 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 LLMを自分のデバイスでローカル実行しましょう！

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** デバイ&#x30B9;**:** [**MiniMax-M2.7 GGUF**](https://huggingface.co/unsloth/MiniMax-M2.7-GGUF)

すべてのアップロードは Unsloth の [Dynamic 2.0](/docs/jp/ji-chu/dynamic-3.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以上のトークン/秒を実現し、さらにより高速に動作します **16GB GPU 1基と 96GB の RAM** で25トークン/秒以上です。 **2ビット** 量子化版、または最大の2ビット版は 96GB デバイスに収まります。

ほぼ **完全精度**には、 `Q8_0` （8ビット）は243GBを使用し、15以上のトークン/秒で256GB RAM搭載デバイス／Mac上で動作します。

{% 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) + **web search**
* [**コード実行**](/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="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FstfdTMsoBMmsbQsgQ1Ma%2Flandscape%20clip%20gemma.gif?alt=media&amp;token=eec5f2f7-b97a-4c1c-ad01-5a041c3e4013" 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-chu/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="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fh6qv7Mh2VqtdhZaixrnO%2FScreenshot%202026-04-11%20at%206.46.55%E2%80%AFPM.png?alt=media&amp;token=e2568c00-86eb-452f-a4eb-10bcc0194ddf" 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-chu/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="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FOkxq866NI68lXd0LBcsV%2FCode_Generated_Image(18)(1).png?alt=media&amp;token=ce73524f-1db2-410a-ac2f-a26cba04d270" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FhfO2gsbz2lWrZXg3ojyE%2FHCGBTzgboAASv_A.png?alt=media&amp;token=7d6334ca-4f3c-4946-aacd-d55527375fce" 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="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fn5Xz2P6kzHRH2sQGPsHH%2Fminimaxm2.7%20model.jpg?alt=media&amp;token=04f4b3fd-9d04-4e80-9f06-09afd8ce884d" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://unsloth.ai/docs/jp/moderu/tutorials/minimax-m27.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
