> 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/zh/mo-xing/minimax-m3.md).

# MiniMax M3 - 如何本地运行

MiniMax M3 是一个新的 **\~428B（23B 激活）** 用于编码、智能体工作流、协作任务和多模态聊天的开源模型。该多模态模型支持文本、图像和视频输入，并且有一个 **100 万上下文** **窗口**。未量化的 bf16 权重约为**855GB** 而 1 位 GGUF 将其降至仅 **128GB（-85%）**: [**MiniMax-M3 GGUF**](https://huggingface.co/unsloth/MiniMax-M3-GGUF)

该模型表现与 Gemini 3.1 Pro 不相上下——得分为 在 SWE-Bench Pro 上为 59%，在 Terminal-Bench 2.1 上为 66%，在 SWE-fficiency 上为 34.8%，在 KernelBench Hard 上为 28.8%。感谢 MiniMax 提供首日访问权限。

{% columns %}
{% column width="50%" %}
{% hint style="info" %}
MiniMax-M3 GGUF 目前仍处于实验阶段。MiniMax-M3 本身原生支持多模态，但当前实验性的 GGUF 是 **仅文本** 且不支持 MiniMax Sparse Attention。
{% endhint %}
{% endcolumn %}

{% column width="50%" %}

<figure><img src="/files/f598ea156f105075cb87accb02f9c06deaa176b3" alt="" width="375"><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

#### :gear: 使用指南

最小的 GGUF 量化版本， `UD-IQ1_M`，占用 **128GB** 磁盘空间。由于文件大小不包含 KV 缓存和上下文分配，请尽量至少拥有 **133GB RAM** 来运行该模型。建议使用 `UD-IQ3_XXS` 它是 **159GB** 以获得最佳效果。

该 **4-bit** `UD-IQ4_XS` 量化版本为 **208GB**，而 `UD-Q4_K_XL` 为 **265GB**。这些更适合 256GB 以上或 512GB 级系统、多 GPU 服务器，或者带有 CPU RAM 加 GPU 卸载的系统。

**表：推理硬件要求** (单位 = 总内存：RAM + VRAM，或统一内存)

<table><thead><tr><th>1 位</th><th>2 位</th><th width="128">3 位</th><th>4-bit</th><th>5 位</th><th>8-bit</th></tr></thead><tbody><tr><td>133 GB</td><td>148 GB</td><td>164-200 GB</td><td>213-270 GB</td><td>325 GB</td><td>460-470 GB</td></tr></tbody></table>

{% hint style="success" %}
为获得最佳性能，请确保总可用内存（包括 VRAM 和系统 RAM）比量化模型文件大小充裕地大出一截。
{% 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 %}

* **最大上下文窗口：** `1,048,576`
* 默认系统提示词：

{% code overflow="wrap" %}

```
你是一个乐于助人的助手。你的名字是 MiniMax-M3，由 MiniMax 构建。
```

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

## 运行 MiniMax-M3 教程：

在本教程中，我们将使用当前最小的量化版本 UD-IQ1\_M，因为 MiniMax-M3 体积很大。如果你的机器内存足够，请将 UD-IQ1\_M 替换为 UD-IQ4\_XS、UD-Q4\_K\_XL 或其他量化版本。现在你可以在 Unsloth 中运行 MiniMax-M3。

Unsloth 指南

#### 下载 Unsloth

#### 下载 Unsloth

<https://unsloth.ai/download>

<https://unsloth.ai/download>

### Unsloth 指南

#### 下载 Unsloth

<https://unsloth.ai/download>

{% hint style="success" %}
你现在可以通过以下方式运行 MiniMax M3： [Unsloth](#unsloth-studio-guide) ✨。请确保你使用 > [`v0.1.463-beta`](https://github.com/unslothai/unsloth/tree/v0.1.462-beta) 或 `2026.6.6`.
{% endhint %}

MiniMax M3 可在 MacOS、Windows 和 Linux 上通过 Unsloth 运行。你可以：

{% columns %}
{% column %}

* 搜索、下载、 [运行 GGUF](/docs/zh/xin/studio.md#run-models-locally) 和 safetensor 模型
* [**自我修复** 工具调用](/docs/zh/xin/studio.md#execute-code--heal-tool-calling) + **网页搜索**
* [**代码执行**](/docs/zh/xin/studio.md#run-models-locally) （Python、Bash）
* [自动推理](https://unsloth.ai/docs/desktop#feature-deep-dive) 参数调优（temp、top-p 等）
* 通过 llama.cpp 实现快速 CPU + GPU 推理
* [训练 LLM](/docs/zh/xin/studio.md#no-code-training) 速度快 2 倍，VRAM 占用减少 70%
  {% endcolumn %}

{% column %}

<div data-with-frame="true"><figure><img src="/files/1bbdb052f36c70a05af0a94756a76e8ee3fc3288" alt=""><figcaption></figcaption></figure></div>
{% endcolumn %}
{% endcolumns %}

{% stepper %}
{% step %}

#### 安装 Unsloth

请确保你使用最新的 [`v0.1.463-beta`](https://github.com/unslothai/unsloth/tree/v0.1.462-beta) 或 `2026.6.6`。在终端中运行：

**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：**
{% endstep %}

{% step %}

#### 搜索并下载 MiniMax M3

然后前往 [Unsloth Chat](/docs/zh/xin/studio/chat.md) 标签页中，在搜索栏搜索 MiniMax M3，并下载你想要的模型和量化版本。

<figure><img src="/files/9734cf235f002a13747b8d82e6df9936270d3f51" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### 运行 MiniMax M3

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

### 🦙 Llama.cpp 指南

{% stepper %}
{% step %}
获取指定的 `llama.cpp` PR 于 [**GitHub 这里**](https://github.com/ggml-org/llama.cpp/pull/24523)。你也可以按照下面的构建说明操作。将 `-DGGML_CUDA=ON` 改为 `-DGGML_CUDA=OFF` 如果你没有 GPU，或者只想进行 CPU 推理。 **对于 Apple Mac / Metal 设备**，设置 `-DGGML_CUDA=OFF` 然后按常规继续——Metal 支持默认开启。

```bash
git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
git fetch origin pull/24523/head:minimax-m3
git checkout minimax-m3
cmake -B build -DGGML_CUDA=ON
cmake --build build --config Release -j --target llama-cli llama-server
```

{% endstep %}

{% step %}
你现在可以使用 `llama.cpp` 直接加载和下载模型，就像 `ollama run`。首先，选择你想要的量化类型，例如 `Q2_K_XL`。还可以使用 `export LLAMA_CACHE="folder"` 来强制 `llama.cpp` 来保存到指定位置。注意，此下载过程可能非常慢，因此最好使用下一节中的手动下载方式。

```bash
export LLAMA_CACHE="unsloth/MiniMax-M3-GGUF"
./build/bin/llama-cli \\
    -hf unsloth/MiniMax-M3-GGUF:UD-IQ1_M \\
    --temp 1.0 \
    --top-p 0.95 \\
    --top-k 40
```

{% hint style="info" %}
注意：MiniMax Sparse Attention 目前尚不支持，因此推理会回退到稠密注意力。
{% endhint %}
{% endstep %}

{% step %}
如果你想手动下载模型，我们可以通过下面的代码下载模型（在安装 `pip install huggingface_hub`）之后。如果下载卡住，请查看： [Hugging Face Hub，XET 调试](/docs/zh/ji-chu/troubleshooting-and-faqs/hugging-face-hub-xet-debugging.md)

```bash
hf download unsloth/MiniMax-M3-GGUF \\
    --local-dir unsloth/MiniMax-M3-GGUF \\
    --include "*UD-IQ1_M*" # 4 位请使用 "*UD-IQ4_XS*"
```

{% endstep %}

{% step %}
你可以修改 `--threads 32` 以设置 CPU 线程数， `--ctx-size 32768` 以设置上下文长度， `--n-gpu-layers 2` 用于 GPU 卸载的层数。若 GPU 显存不足，请尝试调整它。如果你只有 CPU 推理，也请将其移除。请记住 MSA 仍不受支持，所以请保持 `--ctx-size` 适度——在非常长的上下文中，稠密注意力会消耗大量内存。

{% code overflow="wrap" %}

```bash
./build/bin/llama-cli \\
    --model unsloth/MiniMax-M3-GGUF/UD-IQ1_M/MiniMax-M3-UD-IQ1_M-00001-of-00004.gguf \\
    --temp 1.0 \
    --top-p 0.95 \\
    --top-k 40
```

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

## 📊 基准测试

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

<figure><img src="/files/2599fa61aade8f6fde4f89dc38bd3a7fdaf0c448" 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/zh/mo-xing/minimax-m3.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.
