Development Guide
November 25, 2025 ยท View on GitHub
Thank you for your interest in contributing to bagel!
To contribute, please follow these general steps:
- Fork the repository and clone your fork locally.
- Create a feature branch for your changes.
- Use
uvfor dependency and environment management (see below). - Follow the coding style and linting rules (enforced via pre-commit).
- Submit a pull request (PR) to the main repository for review.
We welcome contributions of all kinds โ new features, bug fixes, documentation improvements, and test coverage.
For more detailed guidelines consult these Notion Docs.
Installation
First, you need to install the development dependencies:
uv sync --extra dev
If you are working on the optimization logic, using Modal should be sufficient; however, if you also need to debug individual Oracles locally, we suggest using a GPU and installing the local dependencies:
uv sync --extra local
# or install all extras
uv sync --all-extras
Documentation [Work In Progress]
Generate documentation:
uv run pydoclint src/bagel/* --style=sphinx
Testing
To run the tests, you must specify how to handle Oracles, i.e. whether to run remotely or not.
# Run tests while skipping Oracle execution
uv run pytest --oracles skip
# Alternative options:
# --oracles modal # Use remote execution via Modal
# --oracles local # Use local GPU-based execution
When using --oracles local, the MODEL_DIR environment variable must be set. You can either:
- Set it in a
.envfile (copy.env.exampleto.envand update the path), or - Set it as an environment variable. If not set, it will default to an XDG-compliant location (
~/.cache/bagel/modelsor$XDG_CACHE_HOME/bagel/models).
Commit Checking
On commit, MyPy, Ruff, and PyTest checks are all run to ensure code quality.
If any of these tests fail, this will be displayed on the corresponding GitHub pull request.
To automatically run code quality checks before each commit (recommended for contributors):
uv run pre-commit install
To disable the hooks:
uv run pre-commit uninstall
You can also run all checks manually at any time:
uv run pre-commit run --all-files