> For the complete documentation index, see [llms.txt](https://docs.clore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clore.ai/guides/guides_v2-zh/yu-yan-mo-xing/mistral-small4.md).

# Mistral Small 4（119B MoE，6.5B 活跃）

在 Clore.ai 市场上的两块消费级 GPU 上部署 Mistral Small 4（119B MoE，6.5B 活跃）——Apache 2.0 许可、256K 上下文、视觉与推理合一的模型

{% hint style="info" %}
**状态（2026年8月）：** Mistral 发布 **Small 4** 于 **2026年3月16日** 采用 **Apache 2.0**。权重： [mistralai/Mistral-Small-4-119B-2603](https://huggingface.co/mistralai/Mistral-Small-4-119B-2603). **总参数119B，仅6.5B激活** （128个专家，每个 token 激活4个）， **256K 上下文**，原生 **视觉**，以及按请求切换推理的开关。它将 Mistral 之前的三条路线——Instruct、Magistral 推理和 Devstral 编码——合并为一个检查点。
{% endhint %}

“Small” 以参数规模来说名不副实，但按成本来说又恰如其分。只有 **每个 token 激活 6.5B 参数**，因此解码速度感觉像 7B 模型，而质量则来自 119B 的参数池。量化到 Q2 后，它是 **40GB** ——两张 RTX 4090；Clore.ai 市场上为此有 322 台服务器规模的空闲容量。到 Q3–Q4 时为 54–59GB，适合两张 RTX 5090。

如果你想要一个开放模型：简单提示能立即回答、需要时会更认真思考、还能读图并写代码，那么它目前是你能够按分钟租用的硬件的最佳选择。

### 关键规格

| 属性    | 数值                                                  |
| ----- | --------------------------------------------------- |
| 参数    | 总计119B，激活6.5B（128个专家，4个激活）                          |
| 模态    | 文本 + 图像输入 → 文本输出                                    |
| 上下文   | 262,144 个 token（256K）                               |
| 许可证   | Apache 2.0                                          |
| 发布日期  | 2026年3月16日                                          |
| 权重    | 官方约242GB · Q3\_K\_M GGUF 54GB · Q2\_K\_XL GGUF 40GB |
| 推理    | `reasoning_effort`: `none` （即时）或 `高` （测试时计算）        |
| 主要工具链 | vLLM、llama.cpp、Transformers                         |

***

## 需求

| 构建           | 大小     | Clore.ai 配置                                            |
| ------------ | ------ | ------------------------------------------------------ |
| `UD-IQ1_M`   | 32GB   | 1× RTX PRO 6000 96GB，或 2× RTX 4090                     |
| `UD-Q2_K_XL` | 40GB   | **2× RTX 4090 / 3090（48GB）** — 在 ≥48GB 条件下有 322 台服务器空闲 |
| `UD-Q3_K_M`  | 54GB   | 2× RTX 5090（64GB）                                      |
| `UD-IQ4_NL`  | 59GB   | 2× RTX 5090（64GB）                                      |
| 官方检查点        | 约242GB | 8× RTX 5090（248GB）                                     |

为 KV 缓存预留余量：在 256K 上下文下，即使是这么稀疏的 MoE 也会占用不少。先从 32–64K 开始，等看到实际使用情况后再提高。

***

## 使用 llama.cpp 部署（两张消费级显卡）

```bash
huggingface-cli download unsloth/Mistral-Small-4-119B-2603-GGUF \\
  --include "*UD-Q2_K_XL*" --local-dir /workspace/ms4

llama-server -m /workspace/ms4/*UD-Q2_K_XL*-00001-of-*.gguf \\
  --host 0.0.0.0 --port 8080 \\
  -ngl 999 --split-mode layer \\
  -c 65536 --flash-attn
```

## 使用 vLLM 部署

```bash
vllm serve mistralai/Mistral-Small-4-119B-2603 \\
  --tensor-parallel-size 8 \\
  --tokenizer-mode mistral \\
  --config-format mistral \\
  --load-format mistral \\
  --max-model-len 262144 \\
  --enable-expert-parallel
```

官方 NVFP4 构建（[`mistralai/Mistral-Small-4-119B-2603-NVFP4`](https://huggingface.co/mistralai/Mistral-Small-4-119B-2603-NVFP4)）面向 Blackwell 显卡——在 RTX 50 系列和 RTX PRO 6000 设备上很有用。

## 按需推理

```python
client.chat.completions.create(
    model="mistral-small-4",
    messages=[{"role": "user", "content": "找出这个调度器中的死锁。"}],
    extra_body={"reasoning_effort": "high"},   # "none" 表示即时回复
    temperature=0.7,                            # 关闭推理时为 0.0–0.7
)
```

Mistral 建议在开启推理时将 temperature 设为 0.7。关闭推理时，根据你对输出确定性的要求，将其保持在 0.0 到 0.7 之间。

***

## Clore.ai GPU 推荐

| 配置              | 显存    | 构建                 | 上下文     | Clore.ai 成本       |
| --------------- | ----- | ------------------ | ------- | ----------------- |
| **2× RTX 4090** | 48GB  | Q2\_K\_XL          | \~64K   | **$0.28–0.84/小时** |
| 2× RTX 3090     | 48GB  | Q2\_K\_XL          | \~64K   | $0.14–0.42/小时     |
| **2× RTX 5090** | 64GB  | Q3\_K\_M / IQ4\_NL | \~96K   | **$0.50–1.54/小时** |
| 1× RTX PRO 6000 | 96GB  | Q3\_K\_M，单卡        | \~131K  | $0.92–1.38/小时     |
| 8× RTX 5090     | 248GB | 官方检查点              | 完整 256K | 约$2.00–3.50/小时    |

{% hint style="success" %}
**一对 RTX 3090 是性价比之选** ——约 $0.14–0.42/小时总价，提供 48GB VRAM，运行一个 119B 模型。使用 [部分 GPU 租用](/guides/guides_v2-zh/ru-men-zhi-nan/partial-gpu-rental.md) 从更大的机架中取出两张卡，而不是去找专门的双 3090 机器。
{% endhint %}

***

## 应用场景

* **一个模型覆盖整个产品** ——聊天、编码和推理，无需三套部署
* **文档和图像提取** ——视觉能力加上 256K 上下文，可处理超长扫描文档
* **预算有限的编码代理** ——继承自 Devstral 体系，每个 token 仅 6.5B 激活参数
* **按延迟分层服务** — `reasoning_effort: none` 用于快速路径， `高` 用于困难路径，同一端点
* **商业产品** ——Apache 2.0，无收入条款，无地区限制

***

## 故障排查

| 问题              | 修复                                                                                                      |
| --------------- | ------------------------------------------------------------------------------------------------------- |
| vLLM 分词器错误      | Mistral 模型需要 `--tokenizer-mode mistral --config-format mistral --load-format mistral`                   |
| 256K 时 OOM      | 是 KV 缓存，不是权重——降低 `--max-model-len`                                                                      |
| 推理从不触发          | `reasoning_effort` 是按请求设置的；检查你的客户端是否传递了 `extra_body`                                                    |
| 两卡上的首个 token 很慢 | 通过 PCIe 跨卡分层拆分 GGUF 会增加延迟；优先选择带 x8/x16 连接的机器                                                            |
| NVFP4 构建无法加载    | 需要 Blackwell——见 [CUDA 与 PyTorch 兼容性](/guides/guides_v2-zh/ru-men-zhi-nan/cuda-pytorch-compatibility.md) |

***

## 下一步

* **较小的兄弟模型：** [Mistral Small 3.1](/guides/guides_v2-zh/yu-yan-mo-xing/mistral-small.md) ——24B 稠密模型，单卡
* **更大的兄弟模型：** [Mistral Large 3](/guides/guides_v2-zh/yu-yan-mo-xing/mistral-large3.md) ——675B MoE
* **稠密替代方案：** [Qwen3.8-27B](/guides/guides_v2-zh/yu-yan-mo-xing/qwen38-27b.md) ——27B，单卡，Apache 2.0
* **微调它：** [Unsloth](/guides/guides_v2-zh/xun-lian/unsloth-finetune.md) · [LLaMA-Factory](/guides/guides_v2-zh/xun-lian/llama-factory.md)

### 链接

* [Hugging Face 上的 Mistral Small 4](https://huggingface.co/mistralai/Mistral-Small-4-119B-2603) · [GGUF](https://huggingface.co/unsloth/Mistral-Small-4-119B-2603-GGUF)
* [Mistral 公告](https://mistral.ai/news/mistral-small-4/)
* **租用 GPU：** [RTX 4090](https://clore.ai/rent-4090.html) · [RTX 5090](https://clore.ai/rent-5090.html) · [市场](https://clore.ai/marketplace)


---

# 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://docs.clore.ai/guides/guides_v2-zh/yu-yan-mo-xing/mistral-small4.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.
