Skip to content

Latest commit

 

History

History
170 lines (125 loc) · 6.56 KB

CONTRIBUTING.md

File metadata and controls

170 lines (125 loc) · 6.56 KB

Contributing Guide

Welcome! We are glad that you want to contribute to OpenRL. 💖

As you get started, you are in the best position to give us feedback on areas of the project that we need help with, including:

  • Problems found while setting up a new development environment
  • Gaps in the Quick Start or documentation
  • Bugs in our automation scripts

If anything doesn't make sense, or doesn't work when you run it, please open an issue and let us know.

Please note that this project has a Code of Conduct that all contributors are expected to follow.

Ways to Contribute

We welcome many different types of contributions, including:

  • New features
  • Bug fixes
  • Builds and CI/CD
  • Documentation, guides, and example recipes
  • Issue triage
  • Answering questions from other users
  • Release management

Not everything happens through a GitHub pull request. If you would like to discuss an idea before writing code, open a GitHub issue and let's talk it through.

Find an Issue

Issues labelled good first issue have extra context to help you make your first contribution. help wanted issues are suitable for anyone who isn't a core maintainer and are a good next step after your first pull request.

Sometimes there won't be any issues with these labels. That's OK — there is likely still something for you to work on. If you want to contribute but can't find a suitable issue, open an issue describing what you would like to work on and a maintainer will help you scope it.

Once you find an issue you'd like to work on, please comment on it saying so, to avoid duplicate effort.

Ask for Help

The best way to reach us with a question is to comment on the relevant GitHub issue or pull request. If there isn't one yet, open a new issue.

Development Environment Setup

OpenRL uses uv for environment isolation. There are two primary environments:

  • Server (src/server) — the API server server and worker controllers.
  • Client / examples (examples) — recipes, client SDK compatibility checks, and end-to-end integration test scripts.

Most tasks are driven through the Makefile, which invokes uv under the hood. Make sure uv is on your PATH (typically ~/.local/bin):

export PATH=$PATH:$HOME/.local/bin

Run make help to see the available targets and their default knobs.

Running the server locally

make server                                   # one process on CPU, google/gemma-4-e2b, port 23500
REDIS_URL=redis://127.0.0.1:6379/0 make server  # trainer and vLLM sampler workers on GPUs (needs redis-server)

Running tests

make test                                     # fast unit tests
make test piglatin                            # pig-latin example end-to-end tests

End-to-end GPU integration tests boot a real backend and run actual SFT/RL training. They require a GPU and use the gpu extra:

make test e2e tiny-lora                       # minimal LoRA overfit test
make test e2e tiny-fft                        # full fine-tuning (requires redis-server)
make test e2e tiny-rl                         # sample -> reward -> train loop

Most contributors develop on a machine without a local NVIDIA GPU and use a remote GPU VM as the test target. make push-vm REMOTE_HOST=<host> and make pull-vm REMOTE_HOST=<host> sync your workspace to and from that host. On a fresh GPU VM you may also need redis-server and python3-dev installed.

Linting and formatting

The project uses Ruff for both linting and formatting, and CI enforces both on every pull request:

make lint
make fmt

You can have this run automatically on every commit by installing the pre-commit hooks:

pre-commit install

Pull Request Lifecycle

  1. Open an issue first for anything larger than a small fix, so the approach can be agreed on before you invest time in it.
  2. Fork the repository and create a branch for your change.
  3. Make your change, including tests and documentation updates.
  4. Run make lint and make test locally.
  5. Open a pull request against main. Describe what changed and why, and link the issue it addresses.
  6. A maintainer will review your pull request. All submissions, including those from project members, require review. Expect a first response within a few business days; feel free to ping the pull request if it goes quiet.
  7. Address review feedback by pushing additional commits to your branch. Once approved and with CI green, a maintainer will merge it.

Sign Your Commits

OpenRL uses the Developer Certificate of Origin (DCO). Signing off a commit certifies that you wrote the change, or otherwise have the right to submit it, under the project's Apache-2.0 license. You keep the copyright to your contribution.

Sign off every commit with git commit -s (or --signoff), which appends a line like:

Signed-off-by: Jane Doe <jane@example.com>

The name and email must match the commit author (git config user.name and user.email; GitHub noreply addresses work). The DCO check on every pull request fails if any commit is missing the line. To fix commits already on your branch, run git rebase --signoff main and force-push.

Pull Request Checklist

When you submit your pull request, our automated systems will run checks on your code. We require that your pull request passes these checks. Before submitting, please check the following locally:

  • Every commit is signed off (git commit -s), so the DCO check passes.
  • make lint passes (Ruff lint and format checks).
  • make test passes.
  • New code has tests covering it.
  • Documentation under docs/ or examples/ is updated if behavior changed.
  • The pull request description explains what changed and why, and links the related issue.
  • Commits are scoped and have clear messages.