用 LFM2.5-24B-A2B 在端侧跑又快又私密的 Agent

HuggingFace Blog · 原文 2026-10-13 · 译文 2026-10-14 · 难度 入门
精读 · 译文(非本站原创)
来自资源池 · HuggingFace Blog ↗ · 原文:Run fast, private agents on-device with LFM2.5-24B-A2B ↗ · 版权归 HuggingFace Blog 所有 · 译文为个人学习的非官方翻译,以原文为准;如权利方有疑虑可联系公众号「疯了再说」删除
导读 · LiquidAI 端侧推理 agent 模型:24B 总参只激活 2B,工具调用基准以小胜大

为什么精读这篇它把「推理模型贵在思考 token」的成本公式打穿了:MoE 只激活 2B 参数,每个推理 token 便宜到可以常驻你自己的设备——端侧私有 agent 从愿景变成配置清单。训练配方里「在四个真实 agent harness 里做 RL」也值得注意:智能体能力开始直接在生产级 harness 里养成,而不是纯基准里刷题。

  • 一句话架构:24B 总参、每 token 只激活 2B 的 MoE(40 层、64 专家取 top-4、门控短卷积+GQA 混合),永远先思考再回答并调用工具——推理 token 便宜是「agent 常驻端侧」的前提
  • 规格升级:上下文 32K→131K,词表就地扩容 65K→128K(非拉丁语系 token 效率翻倍);预训练 17T→33T token,中期训练补 2T@32K+300B@131K
  • 五阶段后训练:SFT→教师特化→两轮多域在策略蒸馏 MOPD(非智能体→智能体)→ 智能体强化学习——RL 直接在 OpenClaw、Hermes Agent、Pi、OpenCode 四个真实 agent harness 里做
  • 基准以小胜大:对手是总参与激活参数都多约 50% 的 Qwen3.6-35B-A3B 等;工具使用 8 项基准 5 项领先或持平(AutomationBench 超第二名 3 倍以上、LiveClaw 48.09 vs 38.19),指令遵循 3/3 全领先;知识型(GPQA Diamond/HLE)与编码(SWE-Bench Verified)仍让位大模型——知识密集任务配检索
  • 速度:Apple M5 Max 184 tok/s、Ryzen AI Max+ 395 上 114 tok/s(比次快 MoE 快至 1.7 倍且内存最省),单张 B300 高并发 21K output tok/s;llama.cpp/MLX/vLLM/SGLang/ONNX 第一天支持
17 段 · 约 10 分钟

LFM2.5-24B-A2B is a 24B-parameter reasoning model with just 2B active parameters, built for fast, private agents on-device. It thinks before it answers, calls tools, and works through multi-step tasks inside popular agent harnesses. Because only 2B parameters are active per token, each reasoning token is cheap, so you can run agents continuously on your own hardware.

LFM2.5-24B-A2B 是一个 24B 参数的推理模型(reasoning model),每 token 只激活 2B 参数,为快速、私密的端侧 agent 而造。它先思考再回答、会调用工具,能在主流 agent harness 里完成多步任务。因为每个 token 只激活(active)2B 参数,每个推理 token 都很便宜——你可以在自己的硬件上持续运行 agent。

Best-in-class agent: Competitive with Qwen3.6-35B-A3B, a model with ~50% more total and active parameters, on agentic and tool-use tasks, scoring 48.09 on LiveClaw versus 38.19.

同级最佳的 agent 能力:在智能体与工具使用(tool use)任务上与 Qwen3.6-35B-A3B 掰手腕——后者总参与激活参数都比它多约 50%——LiveClaw 得分 48.09 对 38.19。

Reasoning at MoE speed: Always thinks before it answers. With only 2B active parameters per token, each reasoning token is cheap.

MoE 速度的推理:永远先思考再回答。每 token 只激活(active)2B 参数,每个推理 token 都便宜。

Efficient inference: 184 tok/s on an Apple M5 Max and up to 21K output tok/s on a single NVIDIA B300 GPU.

高效推理:Apple M5 Max 上 184 tok/s,单张 NVIDIA B300 GPU 上高并发最高 21K output tok/s。

How we built a reasoning agent with 2B active parameters · 我们怎么造出 2B 激活参数的推理 agent

LFM2.5-24B-A2B builds on LFM2-24B-A2B and keeps its architecture: 40 layers, 64 experts per MoE block with top-4 routing, and the same hybrid of gated short convolutions and GQA. The context window grows from 32K to 131K tokens, and an in-place tokenizer expansion doubles the vocabulary from 65K to 128K tokens for better non-Latin tokenization. Unlike its predecessor, it is a reasoning-only model that produces an explicit chain of thought before its final answer.

LFM2.5-24B-A2B 在 LFM2-24B-A2B 基础上构建并沿用其架构:40 层、每个 MoE 块 64 专家取 top-4 路由、同样的门控短卷积(gated short convolution)与 GQA 混合。上下文窗口从 32K 扩到 131K token;tokenizer 就地扩容把词表从 65K 翻倍到 128K token,非拉丁语系的切词效率更好。与前代不同,它是纯推理模型——在最终答案之前先产出显式的思维链。

Pre-training was scaled up from ~17T to ~33T tokens. Mid-training then adds 2T tokens at 32K context, weighted toward reasoning, math, code, instruction following, and multilingual text, and 300B tokens at 131K context, weighted toward long-context data. Tool calls and multi-turn trajectories appear throughout both phases.

预训练从约 17T 扩到约 33T token。中期训练再加 2T token(32K 上下文,权重偏向推理、数学、代码、指令遵循与多语言文本)和 300B token(131K 上下文,偏向长上下文数据)。工具调用与多轮轨迹贯穿两个阶段。

Post-training turns the base model into an agent in five stages. Supervised fine-tuning (SFT). Teacher specialization. Multi-domain on-policy distillation (MOPD), non-agentic: distill the specialist teachers on non-agentic tasks. MOPD, agentic: a second distillation stage focused on agentic tasks. Agentic reinforcement learning (Agentic RL): train the model inside agent harnesses, such as OpenClaw, Hermes Agent, Pi, and OpenCode.

后训练分五个阶段把基座变成 agent:监督微调(SFT);教师特化;多域在策略蒸馏(MOPD)非智能体阶段——在非智能体任务上蒸馏各科专家教师;MOPD 智能体阶段——第二轮蒸馏聚焦智能体任务;智能体强化学习(Agentic RL)——把模型放进真实的 agent harness 里训练,比如 OpenClaw、Hermes Agent、Pi 与 OpenCode。

Benchmark results · 基准结果

We evaluated LFM2.5-24B-A2B against Qwen3.6-35B-A3B, Gemma-4-26B-A4B-it, and Nemotron-3.5-Lightning on 16 benchmarks covering tool use and agentic workflows, knowledge, instruction following, math, and coding. It is the smallest model in the group, yet it is competitive with MoEs with ~50% more total and active parameters.

我们让 LFM2.5-24B-A2B 对阵 Qwen3.6-35B-A3B、Gemma-4-26B-A4B-it 与 Nemotron-3.5-Lightning,在覆盖工具使用(tool use)与智能体工作流、知识、指令遵循、数学、编码的 16 项基准上评测。它是这组里最小的模型,却能与总参与激活参数都多约 50% 的 MoE 们打得有来有回。

For your app, the strengths are tool use and instruction following. LFM2.5-24B-A2B leads or matches the competition on five of the eight tool-use and agentic benchmarks (AutomationBench, BFCLv4, ToolSandbox, LiveClaw, and τ³-Bench Banking), and on AutomationBench it scores more than three times the next-best model. It also leads on all three instruction-following benchmarks. Larger models keep an edge on knowledge-heavy benchmarks like GPQA Diamond, HLE, and AA-Omniscience, and on coding benchmarks like SWE-Bench Verified (OpenCode) and SciCode, so pair LFM2.5-24B-A2B with retrieval or web search for knowledge-heavy workloads.

对你的应用来说,它的强项是工具使用(tool use)与指令遵循:八项工具使用与智能体基准里五项领先或持平(AutomationBench、BFCLv4、ToolSandbox、LiveClaw、τ³-Bench Banking),其中 AutomationBench 得分是次优模型的 3 倍以上;三项指令遵循基准全部领先。更大的模型在知识型基准(GPQA Diamond、HLE、AA-Omniscience)与编码基准(SWE-Bench Verified (OpenCode)、SciCode)上保持优势——所以知识密集负载请给 LFM2.5-24B-A2B 配上检索或网络搜索。

These results make LFM2.5-24B-A2B a strong foundation for agents that need to reason, call tools, and run reliably on your device.

这些成绩让 LFM2.5-24B-A2B 成为「需要推理、调用工具、在你设备上稳定运行」的 agent 的扎实底座。

Inference speed on CPU and GPU · CPU 与 GPU 上的推理速度

LFM2.5-24B-A2B ships with day-one support across the inference ecosystem, including llama.cpp, MLX, vLLM, SGLang, and ONNX.

LFM2.5-24B-A2B 发布即带全推理生态的第一天支持:llama.cpp、MLX、vLLM、SGLang 与 ONNX。

Edge inference. LFM2.5-24B-A2B is the fastest of the compared MoEs, decoding 184 tokens/s on an M5 Max and 114 tokens/s on a Ryzen AI Max+ 395. That is up to 1.7x faster than the next-best model, while using the least memory.

端侧推理:LFM2.5-24B-A2B 是对比 MoE 里最快的——M5 Max 上解码 184 tokens/s,Ryzen AI Max+ 395 上 114 tokens/s,比次优模型快至 1.7 倍,同时内存占用最少。

GPU inference. LFM2.5-24B-A2B is the fastest model in its size class, reaching over 21K output tokens per second at high concurrency on a single B300.

GPU 推理:LFM2.5-24B-A2B 是同尺寸级别最快的模型——单张 B300 高并发下输出超过 21K tokens/s。

How to use LFM2.5-24B-A2B · 怎么用

Reach for LFM2.5-24B-A2B when you need agents that reason, call tools, and run reliably on your device. Install the latest version of transformers (compatible with transformers>=5.0.0) via pip install -U transformers, then load and run the model with AutoModelForCausalLM and AutoTokenizer from model id LiquidAI/LFM2.5-24B-A2B (device_map="auto", dtype="bfloat16"; compatible GPUs 可开 flash_attention_2), generating with do_sample=True, temperature=0.1, top_k=50, repetition_penalty=1.05, max_new_tokens=512.

当你需要「会推理、会调用工具、在你设备上稳定运行」的 agent 时就选 LFM2.5-24B-A2B。pip install -U transformers 装最新版(兼容 transformers>=5.0.0),然后用 AutoModelForCausalLM 与 AutoTokenizer 从模型 id LiquidAI/LFM2.5-24B-A2B 加载运行(device_map="auto"、dtype="bfloat16";兼容的 GPU 可开 flash_attention_2),生成参数 do_sample=True、temperature=0.1、top_k=50、repetition_penalty=1.05、max_new_tokens=512。

Use it in your agent harness. Serve LFM2.5-24B-A2B locally behind any OpenAI-compatible backend, then point your agent harness at it. For example, with Hermes Agent: hermes config set model.provider custom / model.base_url http://localhost:8080/v1 / model.default LFM2.5-24B-A2B / model.context_length 131072 / model.api_mode chat_completions / agent.tool_use_enforcement true. The port depends on your serving backend: llama.cpp and MLX use 8080, vLLM uses 8000, SGLang uses 30000, and LM Studio uses 1234. See the model card for OpenClaw and Pi configs, and our guide for the full setup. Check out our release blog for video examples.

接进你的 agent harness:把 LFM2.5-24B-A2B 在任意 OpenAI 兼容后端后面本地伺服,再把 harness 指过去。以 Hermes Agent 为例:model.provider 设 custom、model.base_url 设 http://localhost:8080/v1、model.default 设 LFM2.5-24B-A2B、model.context_length 设 131072、model.api_mode 设 chat_completions、agent.tool_use_enforcement 设 true。端口取决于伺服后端:llama.cpp 与 MLX 用 8080,vLLM 用 8000,SGLang 用 30000,LM Studio 用 1234。OpenClaw 与 Pi 的配置见模型卡,完整安装看我们的指南;视频示例见发布博客。

Get Started with LFM2.5-24B-A2B · 上手

Both LFM2.5-24B-A2B and LFM2.5-24B-A2B-Base are open-weight and available on Hugging Face today. Download: LFM2.5-24B-A2B-Base and LFM2.5-24B-A2B on Hugging Face. Use in your harness: follow our guide on how to run a local agent, like OpenClaw, Hermes Agent, and Pi. Fine-tune: adapt LFM2.5-24B-A2B to your task with our fine-tuning tutorials. We can't wait to see what you build.

LFM2.5-24B-A2B 与 LFM2.5-24B-A2B-Base 都是开放权重,今天即上架 Hugging Face。下载:HF 上的两个模型页;接进 harness:看我们「怎么跑本地 agent」的指南(OpenClaw、Hermes Agent、Pi);微调:用我们的微调教程把模型适配到你的任务。等不及看你们造什么了。

Citation · 引用

If you use this work, please cite the release blog: @article{liquidAI202624BA2B, author = {Liquid AI}, title = {LFM2.5-24B-A2B: Built for Fast On-Device Agents}, journal = {Liquid AI Blog}, year = {2026}, note = {www.liquid.ai/blog/lfm2-5-24b-a2b} }.

引用请用发布博客:BibTeX 条目 liquidAI202624BA2B(Liquid AI,《LFM2.5-24B-A2B: Built for Fast On-Device Agents》,Liquid AI Blog,2026,www.liquid.ai/blog/lfm2-5-24b-a2b)。

回忆挑战

先不看答案自己回忆——讲不出来再回正文找。考的是关系,不是标签。

1「每 token 只激活 2B 参数」为什么直接决定了这个模型适合做常驻端侧的 agent,而不是仅仅「跑得快」?

Agent 的工作模式是长时间、高频次、多轮工具调用的连续推理,成本 ≈ 每个推理 token 的价格 × 海量 token 数。24B 稠密模型每次前向都要付 24B 的算力,而 A2B 架构每 token 只激活 2B——思考越多相对越划算。这把「会思考的模型」从按次付费变成近乎包月,agent 才能真正常驻设备随时待命,而不是省着用。

2它的工具调用基准领先(AutomationBench 超第二名 3 倍)但知识基准(GPQA/HLE)落后,这种偏科对部署策略意味着什么?

说明它的能力结构是「过程型」(多步规划、工具编排、指令遵循)而非「知识型」(参数里记住的事实)。部署上应该把它当执行引擎:知识密集的问题外挂检索或网络搜索补足,让模型负责推理与调用——原文自己也给了同样的配对建议。反过来说,如果你的场景是纯知识问答,选更大参数的模型更合理。

3后训练最后一步「在 OpenClaw、Hermes、Pi、OpenCode 里做 RL」与在标准答题基准里做 RL 有什么本质区别?

环境 不同:真实 harness 里有真实的工具接口、多轮状态、报错与恢复——模型学到的是「在一个会失败的循环里把任务推到完成」,而不是「输出一个正确答案」。这直接对齐部署形态(这些模型将被接进同样的 harness),也解释了它工具调用基准的领先;代价是需要真实可执行的环境,比静态数据集的 RL 贵得多。