Thanks for your interest in contributing! This document provides guidelines for contributions.
- Check if the bug already exists in Issues
- Use the bug report template
- Include reproduction steps, expected vs actual behavior
- Add relevant logs and environment info
- Check existing Issues and Discussions
- Describe the problem you're solving
- Explain your proposed solution
- Consider backward compatibility
-
Fork the repository
-
Create a branch
git checkout -b feature/your-feature-name
-
Make your changes
- Write clear, documented code
- Add tests for new features
- Update documentation if needed
-
Test your changes
pytest -v black gate/ tests/ ruff check gate/ tests/
-
Commit with clear messages
git commit -m "feat: add new evaluation metric" -
Push and create PR
git push origin feature/your-feature-name
# Clone your fork
git clone https://github.com/your-username/llm-output-stability-gate.git
cd llm-output-stability-gate
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements-dev.txt
# Install package in editable mode
pip install -e .
# Set up OpenAI API key (for tests that require it)
export OPENAI_API_KEY=your_key_here
# Run tests
pytest- Follow PEP 8
- Use type hints where possible
- Write docstrings for functions
- Format with Black:
black gate/ tests/ - Lint with Ruff:
ruff check gate/ tests/
Use conventional commit format:
feat:New featurefix:Bug fixdocs:Documentation changestest:Test additions/changesrefactor:Code refactoringchore:Maintenance tasks
Example: feat(evaluator): add support for custom UQLM scorers
# Run all tests (skips tests requiring API key)
pytest
# Run specific test file
pytest tests/test_policy.py
# Run with coverage
pytest --cov=gate
# Run tests that require API key (if you have one)
pytest -m requires_api_key- Write tests for all new features
- Mock external API calls when possible
- Use
@pytest.mark.requires_api_keyfor tests needing OpenAI - Aim for >80% code coverage
class TestNewFeature:
"""Tests for new feature."""
def test_success_case(self):
"""Test successful execution."""
result = my_function("input")
assert result == "expected"
def test_error_case(self):
"""Test error handling."""
with pytest.raises(ValueError):
my_function("invalid")- Update README.md for user-facing changes
- Add docstrings to new functions/classes
- Update API documentation if endpoints change
- Include examples in docstrings
- Never commit API keys or secrets
- Use
.envfor local development - Report security issues privately via email
- Follow security best practices
- Open a Discussion
- Check existing Issues
- Be respectful and inclusive
- Provide constructive feedback
- Focus on what is best for the community
- Show empathy towards others
Thank you for contributing! 🎉