> 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-bit 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%" %}
你现在可以直接在 [Unsloth Studio](#unsloth-studio-guide)中运行 MiniMax M3。下面是在单台 M3 Ultra 512GB 上通过 Unsloth Studio 本地运行 5-bit MiniMax M3 的示例：

{% 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 内存** 来运行该模型。建议使用 `UD-IQ3_XXS` 其大小为 **159GB** 以获得最佳效果。

这个 **4 位** `UD-IQ4_XS` 量化版本为 **208GB**，而 `UD-Q4_K_XL` 为 **265GB**。这些更适合 256GB+ 或 512GB 级别的系统、多 GPU 服务器，或具有 CPU 内存加 GPU 卸载的系统。

**表：推理硬件需求** （单位 = 总内存：RAM + VRAM，或统一内存）

<table><thead><tr><th>1 位</th><th>2 位</th><th width="128">3 位</th><th>4 位</th><th>5 位</th><th>8 位</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 Studio](#run-in-unsloth-studio).

<a href="/pages/c93747ce9d408969d5a40287410c760083372c5c#unsloth-studio-guide" class="button primary">🦥 Unsloth Studio 指南</a><a href="/pages/c93747ce9d408969d5a40287410c760083372c5c#llama.cpp-guide" class="button primary">🦙 Llama.cpp 指南</a>

### 🦥 Unsloth Studio 指南

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

MiniMax M3 现在可以在 [Unsloth Studio](/docs/zh/xin-zeng/studio.md)中运行和训练，这是我们用于本地 AI 的全新开源 Web UI。Unsloth Studio 让你能够在本地运行模型，支持 **MacOS**, **Windows**、Linux 以及：

{% columns %}
{% column %}

* 搜索、下载， [运行 GGUF](/docs/zh/xin-zeng/studio.md#run-models-locally) 和 safetensor 模型
* [**自愈式** 工具调用](/docs/zh/xin-zeng/studio.md#execute-code--heal-tool-calling) + **网页搜索**
* [**代码执行**](/docs/zh/xin-zeng/studio.md#run-models-locally) （Python、Bash）
* [自动推理](/docs/zh/xin-zeng/studio.md#model-arena) 参数调优（temp、top-p 等）
* 通过 llama.cpp 实现快速 CPU + GPU 推理
* [训练 LLM](/docs/zh/xin-zeng/studio.md#no-code-training) 速度提升 2 倍，同时减少 70% 的 VRAM
  {% 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：**

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

然后打开 `http://127.0.0.1:8888` （或你的特定 URL）在浏览器中打开。
{% endstep %}

{% step %}

#### 搜索并下载 MiniMax M3

首次启动时，你需要创建一个密码来保护你的账户，然后再次登录。

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

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

{% step %}

#### 运行 MiniMax M3

使用 Unsloth Studio 时，推理参数应会自动设置，不过你仍然可以手动更改。你还可以编辑上下文长度、聊天模板和其他设置。

欲了解更多信息，你可以查看我们的 [Unsloth Studio 推理指南](/docs/zh/xin-zeng/studio/chat.md).

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

### 🦙 Llama.cpp 指南

{% stepper %}
{% step %}
获取特定的 `llama.cpp` 在 [**这里的 GitHub PR**](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:

```
GET https://unsloth.ai/docs/zh/mo-xing/minimax-m3.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.
