LeRobot 旨在为 PyTorch 中的现实世界机器人技术提供模型、数据集和工具。其目标是降低使用门槛,让每个人都能为共享数据集和预训练模型做出贡献并从中受益。
🤗 一个硬件无关、原生 Python 的接口,可标准化各种平台的控制,从低成本机械臂(SO-100)到类人机器人。
🤗 一种标准化、可扩展的 LeRobotDataset 格式(Parquet + MP4 或图像),托管在 Hugging Face Hub 上,支持海量机器人数据集的高效存储、流式传输和可视化。
🤗 已被证明可迁移到现实世界的最先进策略,随时可供训练和部署。
🤗 对开源生态系统的全面支持,以推动物理人工智能的普及。
快速开始
LeRobot 可直接从 PyPI 安装。
pip install lerobot
lerobot-info
Important
有关详细的安装指南,请参见 安装文档。
机器人与控制
LeRobot 提供了统一的 Robot 类接口,将控制逻辑与硬件细节解耦。它支持多种机器人和遥操作设备。
from lerobot.robots.myrobot import MyRobot
# Connect to a robot
robot = MyRobot(config=...)
robot.connect()
# Read observation and send action
obs = robot.get_observation()
action = model.select_action(obs)
robot.send_action(action)
支持的硬件: SO100、LeKiwi、Koch、HopeJR、OMX、EarthRover、Reachy2、游戏手柄、键盘、手机、OpenARM、Unitree G1。
虽然这些设备已原生集成到 LeRobot 代码库中,但该库设计为可扩展的。您可以轻松实现 Robot 接口,以便将 LeRobot 的数据收集、训练和可视化工具用于您自己的定制机器人。
有关详细的硬件设置指南,请参阅 硬件文档。
LeRobot 数据集
为解决机器人领域的数据碎片化问题,我们采用了 LeRobotDataset 格式。
- 结构: 用于视觉的同步 MP4 视频(或图像)以及用于状态/动作数据的 Parquet 文件。
- HF Hub 集成: 在 Hugging Face Hub 上探索数千个机器人数据集。
- 工具: 无缝删除片段、按索引/比例拆分、添加/移除特征以及合并多个数据集。
from lerobot.datasets.lerobot_dataset import LeRobotDataset
# Load a dataset from the Hub
dataset = LeRobotDataset("lerobot/aloha_mobile_cabinet")
# Access data (automatically handles video decoding)
episode_index=0
print(f"{dataset[episode_index]['action'].shape=}\n")
在 LeRobotDataset Documentation 中了解更多相关信息。
最先进模型
LeRobot 以纯 PyTorch 实现了最先进的策略,涵盖模仿学习、强化学习和视觉-语言-动作(VLA)模型,更多模型即将推出。它还为您提供了用于监控和检查训练过程的工具。
训练策略就像运行脚本配置一样简单:
lerobot-train \
--policy=act \
--dataset.repo_id=lerobot/aloha_mobile_cabinet
| 类别 | 模型 |
|---|---|
| 模仿学习 | ACT、Diffusion、VQ-BeT、Multitask DiT Policy |
| 强化学习 | HIL-SERL、TDMPC 及 QC-FQL(即将推出) |
| VLAs 模型 | Pi0Fast、Pi0.5、GR00T N1.5、SmolVLA、XVLA |
与硬件部分类似,您可以轻松实现自己的策略,并利用 LeRobot 的数据收集、训练和可视化工具,还能将您的模型分享到 HF Hub。
有关详细的策略设置指南,请参阅 策略文档。有关各策略的 GPU/RAM 要求和预期训练时间,请参阅 计算硬件指南。
推理与评估
使用统一的评估脚本在仿真环境或真实硬件上评估您的策略。LeRobot 支持 LIBERO、MetaWorld 等标准基准测试,更多基准测试即将推出。
# Evaluate a policy on the LIBERO benchmark
lerobot-eval \
--policy.path=lerobot/pi0_libero_finetuned \
--env.type=libero \
--env.task=libero_object \
--eval.n_episodes=10
通过查阅 EnvHub 文档,了解如何实现您自己的仿真环境或基准测试,并从 HF Hub 进行分发。
资源
- 文档: 包含教程和 API 的完整指南。
- 中文教程:LeRobot+SO-ARM101中文教程-同济子豪兄 详细介绍组装、遥操作、数据集、训练和部署的文档。已通过 Seed Studio 和 5 位全球黑客松选手的验证。
- Discord: 加入
LeRobot服务器,与社区进行讨论。 - X: 关注我们的 X 账号,及时了解最新动态。
- 机器人学习教程: 免费的实践课程,学习如何使用 LeRobot 进行机器人学习。
引用
如果您在项目中使用了 LeRobot,请引用 GitHub 仓库,以认可其持续的开发工作和贡献者:
@misc{cadene2024lerobot,
author = {Cadene, Remi and Alibert, Simon and Soare, Alexander and Gallouedec, Quentin and Zouitine, Adil and Palma, Steven and Kooijmans, Pepijn and Aractingi, Michel and Shukor, Mustafa and Aubakirova, Dana and Russi, Martino and Capuano, Francesco and Pascal, Caroline and Choghari, Jade and Moss, Jess and Wolf, Thomas},
title = {LeRobot: State-of-the-art Machine Learning for Real-World Robotics in Pytorch},
howpublished = "\url{https://github.com/huggingface/lerobot}",
year = {2024}
}
如果您引用我们的研究或学术论文,请同时引用我们在ICLR上发表的文章:
ICLR 2026 论文
@inproceedings{cadenelerobot,
title={LeRobot: An Open-Source Library for End-to-End Robot Learning},
author={Cadene, Remi and Alibert, Simon and Capuano, Francesco and Aractingi, Michel and Zouitine, Adil and Kooijmans, Pepijn and Choghari, Jade and Russi, Martino and Pascal, Caroline and Palma, Steven and Shukor, Mustafa and Moss, Jess and Soare, Alexander and Aubakirova, Dana and Lhoest, Quentin and Gallou\'edec, Quentin and Wolf, Thomas},
booktitle={The Fourteenth International Conference on Learning Representations},
year={2026},
url={https://arxiv.org/abs/2602.22818}
}
贡献
我们欢迎社区中的每一个人参与贡献!开始之前,请阅读我们的 CONTRIBUTING.md 指南。无论您是添加新功能、改进文档,还是修复错误,您的帮助和反馈都非常宝贵。我们对开源机器人技术的未来感到无比兴奋,迫不及待地想与您携手共创未来——感谢您的支持!
下载使用量
项目总下载次数(含Clone、Pull、 zip 包及 release 下载),每日凌晨更新