Deploy local agents everywhere with LFM2.5-2.6B
Deploy local agents everywhere with LFM2.5-2.6B
使用 LFM2.5-2.6B 在任何地方部署本地智能体
LFM2.5-2.6B is built to power capable agents entirely on-device. It supports tool calling and multi-step workflows while staying small and fast enough for everyday hardware, from laptops to phones. This enables developers to deploy agents everywhere, keep data private on the device, and scale usage without a cloud inference bill. LFM2.5-2.6B 旨在完全在设备端驱动功能强大的智能体。它支持工具调用和多步工作流,同时保持足够小巧和快速,适用于从笔记本电脑到手机的日常硬件。这使开发者能够在任何地方部署智能体,确保数据在设备上保持私密,并实现规模化使用,而无需支付云端推理费用。
Best-in-class agent: Competitive with models 4x larger on tool use, instruction following, and multi-step agentic tasks. 同类最佳智能体:在工具使用、指令遵循和多步智能体任务方面,可与体积大 4 倍的模型相媲美。
Agentic reinforcement learning: Trained inside the most popular agentic harnesses to improve compatibility. 智能体强化学习:在最流行的智能体框架内进行训练,以提高兼容性。
Efficient inference: 220 tok/s on an Apple M5 Max and 113 tok/s on an AMD Ryzen CPU, in under 2.5 GB of memory. 高效推理:在 Apple M5 Max 上达到 220 tok/s,在 AMD Ryzen CPU 上达到 113 tok/s,且内存占用低于 2.5 GB。
How we built a reliable agentic model for edge devices
我们如何为边缘设备构建可靠的智能体模型
LFM2.5-2.6B is pre-trained on ~34T tokens, with a mid-training phase that extends the context window to 128K. Post-training then turns the base model into an agent in four stages: LFM2.5-2.6B 在约 34T token 上进行了预训练,并在训练中期将上下文窗口扩展至 128K。随后,通过四个阶段的后训练将基础模型转化为智能体:
-
Supervised fine-tuning (SFT): two rounds of SFT, weighted heavily toward agentic data like tool use, web search, and harness trajectories.
-
监督微调 (SFT):进行两轮 SFT,重点加权处理工具使用、网络搜索和框架轨迹等智能体数据。
-
Teacher specialization: train one specialist teacher per domain (math, code, tool use, and more).
-
教师专业化:为每个领域(数学、代码、工具使用等)训练一名专业教师模型。
-
Multi-domain on-policy distillation (MOPD): distill the specialist teachers into a single student.
-
多领域在线策略蒸馏 (MOPD):将专业教师模型蒸馏为单一的学生模型。
-
Agentic Reinforcement Learning (Agentic RL): run multi-turn RL inside real agent harnesses, where the model learns to work across different tools, system prompts, and multi-turn task environments.
-
智能体强化学习 (Agentic RL):在真实的智能体框架内运行多轮强化学习,使模型学习如何跨不同的工具、系统提示词和多轮任务环境进行工作。
The Agentic RL pipeline separates model optimization, inference, and environment execution into distinct components. The Training Engine optimizes the model, while the Rollout Engine generates actions using the latest policy. The RL framework orchestrates the training loop by launching rollouts, collecting trajectories and rewards, and updating the model. Actions are executed within a Sandbox Service, where the Blackbox Harness hosts the agent (e.g., OpenClaw or Hermes Agent) and coordinates interactions with the task environment. The Harness Proxy lets us treat agentic harnesses as black boxes with no modification, while transparently capturing the token-level trajectories needed to reconstruct and validate RL training samples. 智能体强化学习流水线将模型优化、推理和环境执行分离为不同的组件。训练引擎负责优化模型,而部署引擎使用最新策略生成动作。强化学习框架通过启动部署、收集轨迹和奖励并更新模型来编排训练循环。动作在沙盒服务中执行,黑盒框架在此托管智能体(例如 OpenClaw 或 Hermes Agent)并协调与任务环境的交互。框架代理允许我们将智能体框架视为无需修改的黑盒,同时透明地捕获重建和验证强化学习训练样本所需的 token 级轨迹。
Benchmark results
基准测试结果
We evaluated LFM2.5-2.6B against models up to ~4x its size on STEM, instruction following, tool use, and agentic tasks. It is the smallest model in the group, yet it competes with and often beats the rest. 我们在 STEM、指令遵循、工具使用和智能体任务方面,将 LFM2.5-2.6B 与体积大至约 4 倍的模型进行了对比评估。它是该组中最小的模型,但却能与其它模型竞争,并经常超越它们。
For your app, the strengths are instruction following and tool use. LFM2.5-2.6B tops every instruction-following benchmark here, and every tool-use benchmark except BFCLv4, where only the 9.7B Qwen edges ahead. On agentic tasks, it beats both Gemma models and stays even with the Qwens. It also leads on knowledge and stays close on math. Coding is the one place the larger models keep a clear lead, so reach for something bigger there. 对于您的应用而言,其优势在于指令遵循和工具使用。LFM2.5-2.6B 在此处的每一项指令遵循基准测试中均名列前茅,在除 BFCLv4 之外的所有工具使用基准测试中也表现领先(仅 9.7B 的 Qwen 略微领先)。在智能体任务上,它击败了两个 Gemma 模型,并与 Qwen 模型持平。它在知识领域也处于领先地位,在数学方面表现接近。编码是大型模型保持明显优势的领域,因此在编码任务上建议选择更大的模型。
Inference speed on CPU and GPU
CPU 和 GPU 上的推理速度
LFM2.5-2.6B ships with day-one support across the inference ecosystem, including llama.cpp, MLX, vLLM, SGLang, and ONNX. LFM2.5-2.6B 在发布首日即支持整个推理生态系统,包括 llama.cpp、MLX、vLLM、SGLang 和 ONNX。
-
CPU inference: Due to its efficient LFM2 architecture, LFM2.5-2.6B is the fastest model we tested, with decode speeds of 220 tokens/s on an M5 Max and 113 tokens/s on a Ryzen AI Max+ 395. At 30 tokens/s, it allows you to run capable agents even on a phone.
-
CPU 推理: 得益于其高效的 LFM2 架构,LFM2.5-2.6B 是我们测试过的最快模型,在 M5 Max 上解码速度为 220 tokens/s,在 Ryzen AI Max+ 395 上为 113 tokens/s。在 30 tokens/s 的速度下,它甚至可以在手机上运行功能强大的智能体。
-
GPU inference: LFM2.5-2.6B is the fastest model in its size class, reaching almost 15K output tokens per second at high concurrency, roughly 1.3B tokens per day on a single H100.
-
GPU 推理: LFM2.5-2.6B 是同尺寸级别中最快的模型,在高并发下每秒可输出近 1.5 万个 token,在单张 H100 上每天可处理约 13 亿个 token。
How to use LFM2.5-2.6B
如何使用 LFM2.5-2.6B
Reach for LFM2.5-2.6B when you need on-device agents for high-volume workloads. Install the latest version of transformers (compatible with transformers>=5.0.0): 当您需要为高负载工作流使用设备端智能体时,请选择 LFM2.5-2.6B。安装最新版本的 transformers(兼容 transformers>=5.0.0):
pip install -U transformers
Then load and run the model: 然后加载并运行模型:
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)
prompt = "What is C. elegans?"
input_ids = tokenizer.apply_chat_template(
[{"role": "user", "content": prompt}],
add_generation_prompt=True,
return_tensors="pt",
tokenize=True,
).to(model.device)
output = model.generate(
input_ids,
do_sample=True,
temperature=0.2,
top_k=80,
repetition_penalty=1.05,
max_new_tokens=512,
)
print(tokenizer.decode(output[0], skip_special_tokens=False))
LFM2.5-2.6B demo
LFM2.5-2.6B 演示
Check out this browser demo of LFM2.5-2.6B powering a research agent. The agent helps you research specific questions and generates a summary. 查看这个由 LFM2.5-2.6B 驱动的研究智能体浏览器演示。该智能体可以帮助您研究特定问题并生成摘要。
Get Started
开始使用
Both LFM2.5-2.6B and LFM2.5-2.6B-Base are available on Hugging Face today. With LFM2.5, we’re delivering on our vision of AI that runs anywhere. LFM2.5-2.6B 和 LFM2.5-2.6B-Base 现已在 Hugging Face 上线。通过 LFM2.5,我们正在实现让 AI 在任何地方运行的愿景。
- Download: LFM2.5-2.6B-Base and LFM2.5-2.6B on Hugging Face.
- 下载: 在 Hugging Face 上获取 LFM2.5-2.6B-Base 和 LFM2.5-2.6B。
- Try: run the WebGPU demo in your browser, no setup needed.
- 尝试: 在浏览器中运行 WebGPU 演示,无需任何设置。
- Use in your harness: follow our guide on how to run a local agent, like OpenClaw, Hermes Agent, and Pi.
- 在您的框架中使用: 按照我们的指南了解如何运行本地智能体,例如 OpenClaw、Hermes Agent 和 Pi。