Skip to main content
Prerequisites: Python 3.11+, uv installed, Ollama installed.

Contribution pathways

Three pathways exist for contributing to Mellea: Core repository — bug fixes, standard library additions (Requirements, Components, Sampling Strategies), backend improvements, documentation, and tests. Follow the Pull request process below. Applications and libraries — build tools or applications on top of Mellea in your own repository. Use the mellea- prefix for discoverability (e.g., github.com/my-company/mellea-legal-utils). Community components — contribute experimental or specialized components to mellea-contribs. Open an issue first for general-purpose additions to decide whether they belong in the standard library or in mellea-contribs.

Development setup

  1. Fork and clone the repository:
  2. Create a virtual environment:
  3. Install dependencies:
  4. Install pre-commit hooks (required):
Note: Python 3.13+ requires a Rust compiler for the outlines dependency. Use Python 3.12 if you prefer to avoid this.

Set up with conda or mamba

  1. Fork and clone the repository:
  2. Run the installation script:
    The script handles environment setup, dependency installation, and pre-commit hook installation.

Verify the installation

Coding standards

Type annotations

Type annotations are required on all core functions:

Docstrings

Docstrings serve as prompts — the LLM reads them, so be specific. Use Google-style docstrings:

Code style

  • Use Ruff for linting and formatting.
  • Use ... in @generative function bodies.
  • Prefer primitives over classes.
  • Keep functions focused and single-purpose.

Linting and formatting

Development workflow

Commit messages

Follow Angular commit format:
Types: feat, fix, docs, test, refactor, release Example:
Always sign off commits with -s or --signoff:
Branch naming: feat/topic, fix/issue-id, docs/topic

AI coding assistants

AI-assisted development is welcome. You are responsible for reviewing and understanding every change before submitting. AI coding assistants that follow project guidelines automatically add an Assisted-by: trailer to commit messages — one line per tool, using its common name (GitHub Copilot, Cursor, etc.):

Pre-commit hooks

Pre-commit hooks run automatically before each commit and check:
  • Ruff — linting and formatting
  • mypy — type checking
  • uv-lock — dependency lock file sync
  • codespell — spell checking
Run hooks manually:
Warning: pre-commit --all-files may take several minutes. Do not cancel mid-run as it can corrupt state.
Use the -n flag to bypass hooks for intermediate work-in-progress commits:

Testing

The full test guide lives in test/README.md in the repository — classification rules, marker reference (tier definitions, backend matrix, resource predicates), authoring guide, CI pipeline, and GPU/Ollama operational notes. Essential commands:

Pull request process

  1. Create an issue describing your change (if one does not already exist).
  2. Fork the repository.
  3. Create a branch in your fork using the naming convention above.
  4. Make your changes following the coding standards.
  5. Add tests for new functionality.
  6. Run the test suite to confirm everything passes.
  7. Update documentation as needed.
  8. Push to your fork and open a pull request.
  9. Follow the automated PR workflow instructions in the PR template.

Troubleshooting

Debugging tips

Contributing to the docs

Documentation lives in docs/docs/. The writing guide at docs/CONTRIBUTING_DOCS.md covers conventions, the PR checklist, and the review process for documentation contributions. Key points:
  • Start body content with H2 — Mintlify renders the frontmatter title as the page heading.
  • Omit .md extensions from internal links.
  • Tag every fenced code block with a language.
  • Run npx markdownlint-cli2 and fix all warnings before committing.

Getting help


See also: Building Extensions