# MiniMax-M2.5：运行指南

MiniMax-M2.5 是一款全新的开放 LLM，在编程、智能体式工具使用、搜索和办公工作中达到了 SOTA，在 [SWE-Bench](#benchmarks) Verified、Multi-SWE-Bench 中达到 51.3%，在 BrowseComp 中达到 76.3%。

这些 **2300亿参数** （100亿活跃）模型拥有 **20万上下文** 窗口，未量化的 bf16 需要 **457GB**。Unsloth Dynamic **3-bit** GGUF 将大小降至 **101GB** **(-62%):** [**MiniMax-M2.5 GGUF**](https://huggingface.co/unsloth/MiniMax-M2.5-GGUF)

所有上传都使用 Unsloth [Dynamic 2.0](https://unsloth.ai/docs/zh/ji-chu/unsloth-dynamic-2.0-ggufs) ，以获得 SOTA 量化性能——因此 3-bit 会将重要层上转为 8 位或 16 位。你也可以通过 Unsloth 使用多 GPU 对模型进行微调。

{% hint style="success" %}
**2月26日：** 看看我们的 GGUF 量化 [在基准测试中的表现](#unsloth-gguf-benchmarks).
{% endhint %}

### :gear: 使用指南

3-bit 动态量化 UD-Q3\_K\_XL 使用 **101GB** 磁盘空间——这非常适合 **128GB 统一内存的 Mac** ，可实现约 20+ tokens/s，而且在以下配置下也能更快运行： **1x16GB GPU 和 96GB RAM** ，可达到 25+ tokens/s。 **2-bit** 量化版本，或者最大的 2-bit 版本可安装在 96GB 设备上。

对于接近 **全精度**，请使用 `Q8_0` （8-bit），它占用 243GB，可安装在 256GB RAM 的设备 / Mac 上，速度可达 10+ tokens/s。

{% 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`               |
| `repeat penalty = 1.0` 或禁用 |
| {% endcolumn %}            |

{% column %}

* **最大上下文窗口：** `196,608`
* `Min_P = 0.01` （默认值可能为 0.05）
* 默认系统提示词：

{% code overflow="wrap" %}

```
你是一个有帮助的助手。你的名字是 MiniMax-M2.5，由 MiniMax 构建。
```

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

## 运行 MiniMax-M2.5 教程：

在这些教程中，我们将使用 3-bit [UD-Q3\_K\_XL](https://huggingface.co/unsloth/MiniMax-M2.5-GGUF?show_file_info=UD-Q3_K_XL%2FMiniMax-M2.5-UD-Q3_K_XL-00001-of-00004.gguf) 量化版本，它可适配 128GB RAM 设备。

#### ✨ 直接在 llama.cpp 中运行

{% 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` 直接加载模型，你可以执行以下操作：（:Q3\_K\_XL）是量化类型。你也可以通过 Hugging Face 下载（见第3点）。这类似于 `ollama run` 类似。使用 `export LLAMA_CACHE="folder"` 以强制 `llama.cpp` 保存到指定位置。请记住，该模型的最大上下文长度只有 20 万。

针对 **大多数默认** 用例：

```bash
export LLAMA_CACHE="unsloth/MiniMax-M2.5-GGUF"
./llama.cpp/llama-cli \
    -hf unsloth/MiniMax-M2.5-GGUF:UD-Q3_K_XL \\
    --ctx-size 16384 \
    --flash-attn on \\
    --temp 1.0 \
    --top-p 0.95 \\
    --min-p 0.01 \\
    --top-k 40
```

{% endstep %}

{% step %}
通过以下方式下载模型（安装完 `pip install huggingface_hub hf_transfer` ）。你可以选择 `UD-Q3_K_XL` （动态 4-bit 量化）或其他量化版本，例如 `UD-Q6_K_XL` 。我们建议使用我们的 4bit 动态量化 `UD-Q3_K_XL` 来平衡大小和准确率。如果下载卡住，请参见 [hugging-face-hub-xet-debugging](https://unsloth.ai/docs/zh/ji-chu/troubleshooting-and-faqs/hugging-face-hub-xet-debugging "mention")

```bash
hf download unsloth/MiniMax-M2.5-GGUF \\
    --local-dir unsloth/MiniMax-M2.5-GGUF \\
    --include "*UD-Q3_K_XL*" # 8-bit 请使用 "*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.5-GGUF/UD-Q3_K_XL/MiniMax-M2.5-UD-Q3_K_XL-00001-of-00004.gguf \\
    --temp 1.0 \
    --top-p 0.95 \\
    --min-p 0.01 \\
    --top-k 40 \\
    --ctx-size 16384 \
    --seed 3407
```

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

### 🦙 Llama-server 和 OpenAI 的 completion 库

为了将 MiniMax-M2.5 部署到生产环境，我们使用 `llama-server` 或 OpenAI API。在一个新的终端中，例如通过 tmux，使用以下方式部署模型：

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-server \\
    --model unsloth/MiniMax-M2.5-GGUF/UD-Q3_K_XL/MiniMax-M2.5-UD-Q3_K_XL-00001-of-00004.gguf \\
    --alias "unsloth/MiniMax-M2.5" \\
    --prio 3 \\
    --temp 1.0 \
    --top-p 0.95 \\
    --min-p 0.01 \\
    --top-k 40 \\
    --ctx-size 16384 \
    --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.5",
    messages = [{"role": "user", "content": "Create a Snake game."},],
)
print(completion.choices[0].message.content)
```

{% endcode %}

## 📊 基准测试

### Unsloth GGUF 基准测试

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FhfO2gsbz2lWrZXg3ojyE%2FHCGBTzgboAASv_A.png?alt=media&#x26;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`.**\
  它最接近原始模型：只低了 **6.0 分** ，而且“仅仅” **+22.8%** 比基线多出更多错误。
* **其他 Unsloth Q4 量化版本的表现非常接近（约 64.5–64.9 准确率）。**\
  `IQ4_NL`, `MXFP4_MOE`，以及 `UD-IQ2_XXS` 在这个基准上基本属于同一质量水平，且比原始模型 **约 33–35%** 有更多错误。
* Unsloth GGUF 的表现比其他非 Unsloth GGUF 好得多，例如见 `lmstudio-community - Q4_K_M` （尽管体积小 8GB）以及 `AesSedai - IQ3_S`.

### 官方基准

你可以在下方查看表格形式的基准测试：

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FHtuBCFNe7qeVG538VVQV%2F97f76950-2c60-4a9b-bb96-228454afabe9.png?alt=media&#x26;token=a16edc7e-db1a-4052-aa99-1b516539b896" alt="" width="563"><figcaption></figcaption></figure>

<table data-full-width="true"><thead><tr><th>基准</th><th>MiniMax-M2.5</th><th>MiniMax-M2.1</th><th>Claude Opus 4.5</th><th>Claude Opus 4.6</th><th>Gemini 3 Pro</th><th>GPT-5.2（thinking）</th></tr></thead><tbody><tr><td>AIME25</td><td>86.3</td><td>83.0</td><td>91.0</td><td>95.6</td><td>96.0</td><td>98.0</td></tr><tr><td>GPQA-D</td><td>85.2</td><td>83.0</td><td>87.0</td><td>90.0</td><td>91.0</td><td>90.0</td></tr><tr><td>SciCode</td><td>44.4</td><td>41.0</td><td>50.0</td><td>52.0</td><td>56.0</td><td>52.0</td></tr><tr><td>IFBench</td><td>70.0</td><td>70.0</td><td>58.0</td><td>53.0</td><td>70.0</td><td>75.0</td></tr><tr><td>AA-LCR</td><td>69.5</td><td>62.0</td><td>74.0</td><td>71.0</td><td>71.0</td><td>73.0</td></tr><tr><td>SWE-Bench Verified</td><td>80.2</td><td>74.0</td><td>80.9</td><td>80.8</td><td>78.0</td><td>80.0</td></tr><tr><td>SWE-Bench Pro</td><td>55.4</td><td>49.7</td><td>56.9</td><td>55.4</td><td>54.1</td><td>55.6</td></tr><tr><td>Terminal Bench 2</td><td>51.7</td><td>47.9</td><td>53.4</td><td>55.1</td><td>54.0</td><td>54.0</td></tr><tr><td>不使用工具的 HLE</td><td>19.4</td><td>22.2</td><td>28.4</td><td>30.7</td><td>37.2</td><td>31.4</td></tr><tr><td>Multi-SWE-Bench</td><td>51.3</td><td>47.2</td><td>50.0</td><td>50.3</td><td>42.7</td><td>—</td></tr><tr><td>SWE-Bench 多语言</td><td>74.1</td><td>71.9</td><td>77.5</td><td>77.8</td><td>65.0</td><td>72.0</td></tr><tr><td>VIBE-Pro（平均）</td><td>54.2</td><td>42.4</td><td>55.2</td><td>55.6</td><td>36.9</td><td>—</td></tr><tr><td>BrowseComp（含上下文）</td><td>76.3</td><td>62.0</td><td>67.8</td><td>84.0</td><td>59.2</td><td>65.8</td></tr><tr><td>宽泛搜索</td><td>70.3</td><td>63.2</td><td>76.2</td><td>79.4</td><td>57.0</td><td>—</td></tr><tr><td>RISE</td><td>50.2</td><td>34.0</td><td>50.5</td><td>62.5</td><td>36.8</td><td>50.0</td></tr><tr><td>BFCL 多轮</td><td>76.8</td><td>37.4</td><td>68.0</td><td>63.3</td><td>61.0</td><td>—</td></tr><tr><td>τ² Telecom</td><td>97.8</td><td>87.0</td><td>98.2</td><td>99.3</td><td>98.0</td><td>98.7</td></tr><tr><td>MEWC</td><td>74.4</td><td>55.6</td><td>82.1</td><td>89.8</td><td>78.7</td><td>41.3</td></tr><tr><td>GDPval-MM</td><td>59.0</td><td>24.6</td><td>61.1</td><td>73.5</td><td>28.1</td><td>54.5</td></tr><tr><td>金融建模</td><td>21.6</td><td>17.3</td><td>30.1</td><td>33.2</td><td>15.0</td><td>20.0</td></tr></tbody></table>

<div><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FfHyJbhPs4k10iiauD3zo%2F1f5a4e78-1a5c-4263-8a65-36c6fe703041.png?alt=media&#x26;token=346519a3-5dee-4ea1-b395-c7de12b6f6cd" alt="" width="563"><figcaption><p>编程核心基准得分</p></figcaption></figure> <figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FhJmbCVK6CNZPw2FSJLPT%2F2003295c-001c-4381-af89-8859c197b5a0.png?alt=media&#x26;token=aaa9968d-f694-4b1e-b734-086c2cf8988b" alt="" width="563"><figcaption><p>搜索与工具使用</p></figcaption></figure></div>

<div><figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FaG1VqXpVwoCWG3RxMWDL%2F91c4825c-1813-4cad-9e36-4b69c6cd0272.png?alt=media&#x26;token=ae956a3f-a25e-4ebc-80cb-97733573e654" alt=""><figcaption><p>每 100 个任务完成数</p></figcaption></figure> <figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fj2PwoDid8zWRyYnXA6of%2F8c25f392-275d-4730-aa92-e9ea27315d83.png?alt=media&#x26;token=a59cf4d3-ff63-4383-90c8-2d089db19b50" alt=""><figcaption><p>办公能力</p></figcaption></figure></div>


---

# Agent Instructions: 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:

```
GET https://unsloth.ai/docs/zh/mo-xing/tutorials/minimax-m25.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
