Agent学习——小米MiMo-V2-Flash使用方法

一、MiMo-V2-Flash的亮点

①API 定价为输入 $0.1/M tokens,输出 $0.3/M tokens,且目前限时免费,推理成本仅为Claude 4.5 Sonnet的2.5%。

②在多个Agent测评基准中保持全球开源模型Top 2,代码能力强。

③使用场景多为智能通场景设计,支持深度思考和联网搜索。

④架构上使用混合注意力机制和多层MTP进行推理加速。

⑤模型权重和推理代码使用的是MIT协议,适用商业场景。
二、技术剖析

①窗口大小为128

②原生支持32K 上下文,外扩技术支持可达256K的上下文处理

多层MIT推理加速,并行效率倍增
三、在线体验

①体验链接:https://aistudio.xiaomimimo.com

②API地址(限时免费哦!各位白嫖党抓紧机会!!!):https://platform.xiaomimimo.com/

③收费定价:输入 0.1/M tokens,输出 0.3/M tokens

③本地部署:

a.模型权重:https://hf.co/XiaomiMiMo/MiMo-V2-Flash

b.GitHub仓库:https://github.com/xiaomimimo/MiMo-V2-Flash

四、模型效果

从公布的基准测试图中看,性能上有了些许提升,主要的提升应该还是在Agent场景、推理效率的提升和价格吧!但是目前架不住他免费呀!!!
五、调用方法

由于MiMo-V2-Flash 已封装成 OpenAI-Compatible HTTP 服务,启动后直接用**OpenAI SDK 或curl -i http://localhost:9001/v1/chat/completions**,模型路径、推理参数全部在启动命令里一次性配好,无需再写 .from_pretrained()。以下是四种不同场景的调用方式:

python 复制代码
# ①启动服务
pip install sglang
python3 -m sglang.launch_server \
  --model-path XiaomiMiMo/MiMo-V2-Flash \
  --served-model-name mimo-v2-flash \
  --tp-size 8 --trust-remote-code \
  --host 0.0.0.0 --port 9001


# ②API调用
from openai import OpenAI

client = OpenAI(base_url="http://localhost:9001/v1", api_key="dummy")

response = client.chat.completions.create(
    model="mimo-v2-flash",
    messages=[{"role": "user", "content": "Nice to meet you MiMo"}],
    max_tokens=4096,
    temperature=0.8,
    top_p=0.95,
    stream=True,
    extra_body={"chat_template_kwargs": {"enable_thinking": True}}
)

for chunk in response:
    print(chunk.choices[0].delta.content or "", end="")

# ③curl方式
curl http://localhost:9001/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mimo-v2-flash",
    "messages": [{"role": "user", "content": "Nice to meet you MiMo"}],
    "max_tokens": 4096,
    "temperature": 0.8,
    "top_p": 0.95,
    "stream": true,
    "chat_template_kwargs": {"enable_thinking": true}
  }'


# ④JaveScript方式
const { OpenAI } = require('openai');
const client = new OpenAI({ baseURL: 'http://localhost:9001/v1', apiKey: 'dummy' });

const stream = await client.chat.completions.create({
  model: 'mimo-v2-flash',
  messages: [{ role: 'user', content: 'Nice to meet you MiMo' }],
  max_tokens: 4096,
  temperature: 0.8,
  top_p: 0.95,
  stream: true,
  chat_template_kwargs: { enable_thinking: true }
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content || '');
}

使用流程:启动服务一次 → 拿到 http://localhost:9001/v1 → 当成 OpenAI 接口 用即可,模型、推理参数全部在启动命令里配置完成,无需再加载模型或写 .from_pretrained(

重要的事情说三遍:限时免费!限时免费!!限时免费!!!

相关推荐
蜘蛛侠..1 天前
Skills 和 Prompt、MCP、Function Calling 有什么区别?
ai·prompt·agent·skill·functioncalling·mcp·skills
忆想不到的晖1 天前
Codex 探索:别急着调 Prompt,先把工作流收住
后端·agent·ai编程
梦想很大很大1 天前
从 0 到 1 实现 AI Agent(02):设计可扩展的 Tool 调用系统
人工智能·llm·agent
泯仲1 天前
项目实践|ETL Pipeline 完整解析:从多源文档到向量库的全链路实现
数据仓库·agent·etl·rag
吴佳浩1 天前
Claude Code 源码泄露事件深度剖析
人工智能·npm·agent
超爱柠檬1 天前
LangGraph 多智能体协作系统
openai·agent·ai编程
若水坤1 天前
51万行代码全网疯传:Claude Code源码泄露始末
agent·claude
beiju1 天前
Agent Loop:AI Agent 的最小实现结构
后端·agent
韦东东1 天前
RAGFlow v0.19图文混排:详细拆解+预处理增强案例
人工智能·大模型·agent·ragflow·图文混排
LuoQuHen1 天前
第八章:多Agent系统—— 当智能体开始“分工协作“
人工智能·ai·agent