LFM2.5-2.6B vs DeepSeek-V4-Flash 工具调用平手,吞吐量 3.7 倍 · 干货攻略
- 链接:https://x.com/atomic_chat_hq/status/2085405031474343963
- 分类:x-tips
- 来源:X @atomic_chat_hq(转自 @maximelabonne)
- 作者:Jay
- 更新:2026-08-17
- 仓库:LiquidAI/LFM2.5-2.6B(Hugging Face,无 GitHub 仓库)
这是什么
LFM2.5-2.6B 是 Liquid AI 在 2026 年 8 月初开源的一个 2.6B 参数端侧 Agent 模型,DeepSeek-V4-Flash-0731 是 DeepSeek 同月发布的一个 284B 总参数 / 13B 激活参数 MoE 推理优化模型(2026-07-31 发布)。2026 年 8 月 6 日,atomic.chat 在 4× RTX 5090 单机上对两者做了相同的 3 项工具调用任务实测,结果:两项均 35/35 全对,LFM 吞吐量 366 tok/s 总耗时 19 秒,DeepSeek-V4-Flash 吞吐量 77 tok/s 总耗时 70 秒,LFM 快 3.7 倍。
原始数据来自 @atomic_chat_hq 的 X 帖子(@maximelabonne 转推确认),非官方基准测试。
为什么值得关注
谁分享的、解决了什么问题
@atomic_chat_hq(atomic.chat 团队)做了这次对比实测,@maximelabonne(Liquid AI 研究员)转推并附评论"对于简单工具调用,你根本不需要 DeepSeek-V4-Flash。端侧模型可以免费跑,加上 harness 还能更强"。这直接回答了一个工程选型中的常见困惑:我是否必须调用昂贵的云端大模型 API 才能可靠地调用工具?
实测证明,对于需要连续精确执行多个工具调用的任务(如天气查询、多币种换算、酒店预订),2.6B 的端侧模型不仅精度不输 13B 激活参数的 MoE 大模型,速度还快 3.7 倍,且无 API 调用成本。
核心数据(均来自上述 X 帖子)
| 指标 | LFM2.5-2.6B | DeepSeek-V4-Flash |
|---|---|---|
| 参数规模 | 2.6B(dense) | 284B 总 / 13B 激活(MoE) |
| 工具调用正确数 | 35/35 | 35/35 |
| 吞吐量 | 366 tok/s | 77 tok/s |
| 3 项任务总耗时 | 19 秒 | 70 秒 |
| 单轮最多工具调用 | 12 个 | 12 个 |
| 运行硬件 | 4× RTX 5090 | 4× RTX 5090 |
| 任务类型 | 天气/时间 6 城、多币种换算、酒店预订 | 同左 |
⚠️ 重要说明:这是 atomic.chat 团队在同一硬件上手工运行的对比测试,3 项任务共 35 次工具调用。不是官方评测基准,结果受任务设计、prompt 工程和 harness 配置影响,不代表所有工具调用场景。
核验过程
读过的官方来源
-
Liquid AI 官方博客(https://www.liquid.ai/blog/lfm2-5-2-6b) - 确认 LFM2.5-2.6B 规格:2.69B 参数、30 层(22 双门控短卷积块 + 8 GQA)、128K 词汇量、131072 token 上下文窗口、34T token 预训练 - 确认 M5 Max CPU 推理速度 220 tok/s、内存 < 2.5 GB - 确认 4 阶段后训练:SFT → 教师专精 → MOPD(多域在线策略蒸馏) → Agentic RL - 确认官方工具调用基准:Multi-IF 80.07、IFBench 59.17、ToolSandbox 77.83、BrowseComp+ 26.89(OpenClaw harness 内) - 确认 LFM2.5-2.6B 在所有指令跟随基准上领先,在大多数工具调用基准上领先 - ⚠️ 官方博客的基准对比表中没有 DeepSeek-V4-Flash,无法交叉验证两者的直接对比数据
-
Liquid AI 官方文档(https://docs.liquid.ai/lfm/models/lfm25-2.6b) - 确认工具调用采用
<|tool_call_start|>/<|tool_call_end|>特殊 token 格式,默认输出 Pythonic 函数调用 - 确认 SGLang 支持lfm2工具调用解析器:--tool-call-parser lfm2- 确认 llama.cpp、vLLM、SGLang、Transformers、MLX、ONNX 均支持 -
Hugging Face 模型卡(https://huggingface.co/LiquidAI/LFM2.5-2.6B) - 确认 LFM2.5-2.6B 是"纯推理模型"(always thinks before answering),会在回复前插入
<think>标签 - 确认推荐用途:Agent 工作流、工具使用、数据提取、RAG、长上下文 - 不推荐用于 Agent 编程和知识密集型任务(这与 DeepSeek-V4-Flash 的定位差异明显) -
NVIDIA NIM Model Card(https://build.nvidia.com/deepseek-ai/deepseek-v4-flash/modelcard) - 确认 DeepSeek-V4-Flash 总参 284B、激活 13B、MoE 架构 - 确认最大上下文 1,048,576 token,支持函数/工具调用 - 确认 3 种推理模式:Non-think(快速)、Think High(逻辑分析)、Think Max(完整推理)
交叉验证结论
- LFM2.5-2.6B 规格(2.6B dense,128K 上下文,220 tok/s M5 Max):三方来源(博客、文档、HuggingFace)完全一致 ✅
- DeepSeek-V4-Flash 规格(284B 总 / 13B 激活,1M 上下文):NVIDIA NIM model card 确认 ✅
- 实测数字(35/35、366 tok/s、77 tok/s):来自 @atomic_chat_hq X 帖子,非官方数据,由 @maximelabonne 转推确认,未在 Liquid AI 官方博客或文档中提及
- 3.7 倍速度优势:直接来自上述 X 帖子计算(70s / 19s ≈ 3.68),未在官方基准中找到对应数字,标注为"原帖主张"
上手步骤
1. 下载模型
# Hugging Face Transformers(原生格式,推荐配合 agent harness)
huggingface-cli download LiquidAI/LFM2.5-2.6B
# llama.cpp GGUF(CPU/端侧推理)
huggingface-cli download LiquidAI/LFM2.5-2.6B-GGUF
2. 本地 Serving(任选一种)
Transformers(适合调试):
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "LiquidAI/LFM2.5-2.6B"
model = AutoModelForCausalLM.from_pretrained(
model_id, device_map="auto", dtype="bfloat16"
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
inputs = tokenizer.apply_chat_template(
[{"role": "user", "content": "What is machine learning?"}],
add_generation_prompt=True, return_dict=True,
).to(model.device)
output = model.generate(**inputs, do_sample=True, temperature=0.1,
top_k=50, repetition_penalty=1.1, max_new_tokens=512)
input_length = inputs["input_ids"].shape[1]
print(tokenizer.decode(output[0][input_length:], skip_special_tokens=True))
SGLang(生产级 GPU Serving,含工具调用解析器):
uv pip install "sglang>=0.5.10"
sglang serve \
--model-path LiquidAI/LFM2.5-2.6B \
--host 0.0.0.0 --port 30000 \
--tool-call-parser lfm2
llama.cpp(CPU/端侧):
brew install llama.cpp
llama-cli -hf LiquidAI/LFM2.5-2.6B-GGUF \
-c 4096 --color -i \
--temp 0.1 --top-k 50 --repeat-penalty 1.1
3. 工具调用格式
LFM2.5-2.6B 使用特殊 token 输出函数调用(<|tool_call_start|> / <|tool_call_end|>),示例:
<|tool_call_start|>[get_weather(city="Tokyo")]<|tool_call_end|>
在 system prompt 中声明工具定义:
[{"name": "get_weather", "description": "Get weather for a city",
"parameters": {"type": "object", "properties": {"city": {"type": "string"}},
"required": ["city"]}}]
4. 连接 Agent Harness
LFM2.5-2.6B 专为 agent harness 设计,开箱即用支持:
# OpenClaw(推荐)
# 安装后配置 endpoint 为 http://localhost:30000/v1
# Hermes Agent
# 配置 LiquidAI/LFM2.5-2.6B 模型,工具定义自动注入
# Pi
# 同上
坑与适用边界
⚠️ 已知限制
-
3.7x 速度对比是单次实测,非官方基准:atomic.chat 在特定 3 项任务上测得,结果受任务设计、prompt 和 harness 配置影响,不代表所有场景。官方博客基准表中也未包含 DeepSeek-V4-Flash,无法交叉验证。
-
DeepSeek-V4-Flash 跑满血 4× RTX 5090 并非最优配置:vLLM recipes 文档显示,V4-Flash 单卡 32GB Q4 GGUF + 部分卸载才适配 RTX 5090,tensor-parallel-size=4 需要 4× 80GB 或更高端 GPU 才能高效运行。这次对比的硬件条件对两者是否公平存疑。
-
LFM2.5-2.6B 定位是端侧工具调用,不擅长代码生成:官方明确标注"不推荐用于 Agent 编程",而 DeepSeek-V4-Flash 在 SWE-Bench Verified 上有 78.4% 的强表现。做代码任务选 DeepSeek-V4-Flash,做高并发轻量工具调用选 LFM2.5-2.6B。
-
纯推理模型(always thinks):LFM2.5-2.6B 会在每次回复前插入
<think>标签,这会增加 token 消耗。对于需要快速响应的简单工具调用场景,可能需要后训练微调来去除 thinking。 -
无 GitHub 仓库:Liquid AI 的 LFM2.5 模型没有公开 GitHub 源码,所有信息来自官方博客和 Hugging Face。
适用场景
✅ 强烈适合: - 需要在本地/边缘设备上跑的高并发工具调用 Agent(如客服机器人、数据录入自动化) - 对 API 调用成本敏感的长期运行 Agent - 隐私敏感场景(数据不离本地)
✅ 可以考虑: - 与 OpenClaw/Hermes Agent/Pi 配合使用本地 Agent 工作流 - 多语言工具调用(RAG 场景的数据提取)
❌ 不适合: - 代码生成 / Software Engineering(SWE-Bench 等场景选 DeepSeek-V4-Flash 或更大模型) - 知识密集型问答(官方明确不推荐) - 需要 1M 以上超长上下文的任务(DeepSeek-V4-Flash 胜出)
一句话结论
LFM2.5-2.6B 在 2.6B 端侧模型上实现了与 DeepSeek-V4-Flash 同精度的工具调用能力(35/35),同时带来约 3.7 倍的吞吐量优势,是免费、高并发、本地 Agent 工具调用场景的有力选择,但代码生成和超长上下文仍是 DeepSeek-V4-Flash 的主场。
📌 选型建议:简单工具调用 + 成本敏感 + 本地部署 → LFM2.5-2.6B;复杂 Agent 任务 + 代码 + 超长上下文 → DeepSeek-V4-Flash;两者也可以在同一系统中分层使用,小任务用端侧模型,大任务路由到云端大模型。