Contributing to LitGPT

We welcome all contributions, regardless of your level of experience or hardware. Whether it's a bug fix, a new feature, or an improvement to the docs — we appreciate your help!

How to contribute

  1. Open an issue — describe the bug or feature before writing code. This helps us align on scope early.
  2. Fork the repo and create a branch from main.
  3. Make your changes and add or update relevant tests.
  4. Open a pull request against main. Include a clear description of what changed and why.

Development setup

git clone https://github.com/<your-username>/litgpt
cd litgpt
# using uv (recommended)
uv sync --all-extras

# using pip
pip install -e ".[extra,compiler,test]"

Install pre-commit hooks to catch style issues before pushing:

# using uvx
uvx pre-commit install        # install hooks
uvx pre-commit run --all-files  # run manually

# using pip
pip install pre-commit
pre-commit install            # install hooks
pre-commit run --all-files    # run manually

Running tests

pytest tests/

Guidelines

  • Keep pull requests focused — one logical change per PR.
  • Write tests for new functionality.
  • Follow the existing code style (enforced via ruff and pre-commit).
  • All code should be your own original work; third-party snippets must be attributed.

Community