2025-12-23 12:10:44 +01:00
# How to contribute to 🤗 LeRobot
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
Everyone is welcome to contribute, and we value everybody's contribution. Code is not the only way to help the community. Answering questions, helping others, reaching out, and improving the documentation are immensely valuable.
2024-04-16 10:33:58 +02:00
2026-03-13 04:46:05 +01:00
Whichever way you choose to contribute, please be mindful to respect our [code of conduct ](https://github.com/huggingface/lerobot/blob/main/CODE_OF_CONDUCT.md ) and our [AI policy ](https://github.com/huggingface/lerobot/blob/main/AI_POLICY.md ).
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
## Ways to Contribute
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
You can contribute in many ways:
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
- **Fixing issues:** Resolve bugs or improve existing code.
- **New features:** Develop new features.
- **Extend:** Implement new models/policies, robots, or simulation environments and upload datasets to the Hugging Face Hub.
- **Documentation:** Improve examples, guides, and docstrings.
- **Feedback:** Submit tickets related to bugs or desired new features.
2025-07-17 14:30:20 +02:00
2026-01-20 15:00:45 +01:00
If you are unsure where to start, join our [Discord Channel ](https://discord.gg/q8Dzzpym3f ).
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
## Development Setup
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
To contribute code, you need to set up a development environment.
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
### 1. Fork and Clone
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
Fork the repository on GitHub, then clone your fork:
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
```bash
git clone https://github.com/<your-handle>/lerobot.git
cd lerobot
git remote add upstream https://github.com/huggingface/lerobot.git
```
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
### 2. Environment Installation
2024-04-16 10:33:58 +02:00
2026-03-13 04:46:05 +01:00
Please follow our [Installation Guide ](https://huggingface.co/docs/lerobot/installation ) for the environment setup & installation from source.
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
## Running Tests & Quality Checks
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
### Code Style (Pre-commit)
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
Install `pre-commit` hooks to run checks automatically before you commit:
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
```bash
pre-commit install
```
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
To run checks manually on all files:
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
```bash
pre-commit run --all-files
```
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
### Running Tests
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
We use `pytest` . First, ensure you have test artifacts by installing **git-lfs ** :
2025-07-17 14:30:20 +02:00
2024-04-16 10:33:58 +02:00
```bash
git lfs install
2025-12-23 12:10:44 +01:00
git lfs pull
2024-04-16 10:33:58 +02:00
```
2025-12-23 12:10:44 +01:00
Run the full suite (this may require extras installed):
2025-07-17 14:30:20 +02:00
2024-04-16 10:33:58 +02:00
```bash
2025-12-23 12:10:44 +01:00
pytest -sv ./tests
2024-04-16 10:33:58 +02:00
```
2025-12-23 12:10:44 +01:00
Or run a specific test file during development:
2025-07-17 14:30:20 +02:00
2024-04-16 10:33:58 +02:00
```bash
2025-12-23 12:10:44 +01:00
pytest -sv tests/test_specific_feature.py
2024-04-16 10:33:58 +02:00
```
2025-12-23 12:10:44 +01:00
## Submitting Issues & Pull Requests
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
Use the templates for required fields and examples.
2026-03-13 04:46:05 +01:00
- **Issues:** Follow the [ticket template ](https://github.com/huggingface/lerobot/blob/main/.github/ISSUE_TEMPLATE/bug-report.yml ).
- **Pull requests:** Rebase on `upstream/main` , use a descriptive branch (don't work on `main` ), run `pre-commit` and tests locally, and follow the [PR template ](https://github.com/huggingface/lerobot/blob/main/.github/PULL_REQUEST_TEMPLATE.md ).
2025-12-23 12:10:44 +01:00
One member of the LeRobot team will then review your contribution.
2024-04-16 10:33:58 +02:00
2025-12-23 12:10:44 +01:00
Thank you for contributing to LeRobot!