开源模型

Mistral Devstral 2 2

Devstral系列 · Mistral AI · 2025-12发布

开源支持本地部署长上下文代码专用

模型介绍

Mistral 面向代码智能体的开源模型,123B 稠密参数、256K 上下文,SWE-bench Verified 72.2%,专为自主软件工程与终端编程助手设计。

模型基础信息

模型系列Devstral系列
开发机构Mistral AI
发布时间2025-12
参数规模123B(Dense)
上下文窗口256K
模型类型文本(代码 Agent)
中文能力良好
使用方式网页体验 / API调用 / 本地部署

免费额度与收费政策

开源权重免费

免费规则详情

权重 Modified MIT 开源免费下载,自行部署;API 按量计费。

收费标准简介

API 按量计费;开源权重免费(以 console.mistral.ai 为准)。

模型能力介绍

✅ 核心优势

  • SWE-bench Verified 72.2%
  • 123B 稠密,256K 上下文
  • 代码库级工具调用与多文件编辑
  • 配套 Mistral Vibe CLI

⚠️ 短板与局限

  • 现已宣布弃用,推荐 Medium 3.5
  • 123B 部署需多卡
  • 中文生态较弱

🎯 适用场景

  • 仓库级编程 Agent
  • 多文件修改与错误修复
  • 遗留系统维护
  • 终端编程助手

模型使用教程

本章节整理 Mistral Devstral 2 的在线体验、API调用、本地部署全套入门教程,快速上手使用该模型。

  • 体验网址:通过 [Mistral Vibe CLI](https://github.com/mistralai/mistral-vibe) 在终端体验,或在 [Mistral API](https://console.mistral.ai) 试用。
  • 能力简介:Mistral 面向代码智能体的开源模型,123B 稠密参数,256K 上下文,SWE-bench Verified 72.2%,专为自主软件工程设计。
  • 适用场景:代码仓库级编程 Agent、多文件修改、错误修复、遗留系统维护。
  • 使用建议:推荐搭配 Mistral Vibe 使用,温度建议 0.2。
  • 开发接入:API 模型名 devstral-medium-latest;权重已开源。
  1. 注册 [Mistral Platform](https://console.mistral.ai) 获取 API Key。
  2. 权重下载:[Hugging Face](https://huggingface.co/mistralai/Devstral-2-123B-Instruct-2512)。
  3. Devstral 2 采用 Modified MIT 许可(月收入超 2000 万美元的公司需商用授权);Devstral Small 2 为 Apache-2.0。

Python 调用

from mistralai import Mistral
client = Mistral(api_key="YOUR_API_KEY")
resp = client.chat.complete(
    model="devstral-medium-latest",
    messages=[{"role": "user", "content": "阅读 ./src 下的代码并修复测试失败的 bug"}],
    temperature=0.2,
)
print(resp.choices[0].message.content)

curl 调用

curl https://api.mistral.ai/v1/chat/completions \
  -H "Authorization: Bearer $MISTRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"devstral-medium-latest","temperature":0.2,"messages":[{"role":"user","content":"分析这个仓库的架构"}]}'

> 提示:Devstral 2 现已弃用,新项目推荐使用 Mistral Medium 3.5。

  • 部署方式:开源权重,支持 vLLM(推荐)、SGLang、Transformers。
  • 硬件要求:123B 模型需至少 4 张 H100 级 GPU;Small 2(24B)可单卡运行。
  • 推荐配置
vllm serve mistralai/Devstral-2-123B-Instruct-2512 \
  --tool-call-parser mistral --enable-auto-tool-choice --tensor-parallel-size 8
  • 配套工具:Mistral Vibe CLI(Apache-2.0)可作终端编程助手。

💡 使用小技巧

推荐搭配 Mistral Vibe 使用,温度建议 0.2;新项目建议改用 Mistral Medium 3.5。

❓ 常见问题 FAQ

Q1:Devstral 2 还推荐使用吗?

A1:已弃用,新项目推荐 Mistral Medium 3.5。

Q2:Devstral Small 2 许可?

A2:Small 2 为 Apache-2.0,Devstral 2 为 Modified MIT。

访问备注与注意事项