Contributing to OpenEvolve
Thank you for your interest in contributing to OpenEvolve! This document provides guidelines and instructions for contributing to the project.
Getting Started
- Fork the repository
- Clone your fork:
git clone https://github.com/codelion/openevolve.git - Install the package in development mode:
pip install -e ".[dev]" - Set up environment for testing:
# Unit tests don't require a real API key, but the environment variable must be set export OPENAI_API_KEY=test-key-for-unit-tests - Run the tests to ensure everything is working:
python -m unittest discover tests
Note: The unit tests do not make actual API calls to OpenAI or any LLM provider. However, the OPENAI_API_KEY environment variable must be set to any non-empty value for the tests to run. You can use a placeholder value like test-key-for-unit-tests.
Development Environment
We recommend using a virtual environment for development:
python -m venv env
source env/bin/activate # On Windows: env\Scripts\activate
pip install -e ".[dev]"
# For running tests (no actual API calls are made)
export OPENAI_API_KEY=test-key-for-unit-tests
# For testing with real LLMs during development
# export OPENAI_API_KEY=your-actual-api-key
LLM Configuration for Development
When developing features that interact with LLMs:
- Local Development: Use a mock API key for unit tests
- Integration Testing: Use your actual API key and configure
api_baseif using alternative providers - Cost Management: Consider using cheaper models or optillm for rate limiting during development
Pull Request Process
- Create a new branch for your feature or bugfix:
git checkout -b feat-your-feature-name - Make your changes
- Add tests for your changes
- Run the tests to make sure everything passes:
export OPENAI_API_KEY=test-key-for-unit-tests python -m unittest discover tests - Commit your changes:
git commit -m "Add your descriptive commit message" - Push to your fork:
git push origin feature/your-feature-name - Submit a pull request to the main repository
Adding Examples
We encourage adding new examples to showcase OpenEvolve's capabilities. To add a new example:
- Create a new directory in the
examplesfolder - Include all necessary files (initial program, evaluation code, etc.)
- Add a README.md explaining the example
- Make sure the example can be run with minimal setup
Reporting Issues
When reporting issues, please include:
- A clear description of the issue
- Steps to reproduce
- Expected behavior
- Actual behavior
- Environment details (OS, Python version, etc.)
Feature Requests
Feature requests are welcome. Please provide:
- A clear description of the feature
- The motivation for adding this feature
- Possible implementation ideas (if any)
Code of Conduct
Please be respectful and considerate of others when contributing to the project. We aim to create a welcoming and inclusive environment for all contributors.