Try it out: https://github.com/codelion/openevolve
What is this?
OpenEvolve evolves entire codebases (not just single functions) by leveraging an ensemble of LLMs combined with automated evaluation. It follows the evolutionary approach described in the AlphaEvolve paper but is fully open source and configurable.
I built this because I wanted to experiment with evolutionary code generation and see if I could replicate DeepMind's results. The original system successfully improved Google's data centers and found new mathematical algorithms, but no implementation was released.
How it works:
The system has four main components that work together in an evolutionary loop:
1. Program Database: Stores programs and their metrics in a MAP-Elites inspired structure
2. Prompt Sampler: Creates context-rich prompts with past solutions
3. LLM Ensemble: Generates code modifications using multiple models
4. Evaluator Pool: Tests programs and provides feedback metrics
What you can do with it:
- Run existing examples to see evolution in action
- Define your own problems with custom evaluation functions
- Configure LLM backends (works with any OpenAI-compatible API)
- Use multiple LLMs in ensemble for better results
- Optimize algorithms with multiple objectives
Two examples I've replicated from the AlphaEvolve paper:
- Circle Packing: Evolved from simple geometric patterns to sophisticated mathematical optimization, reaching 99.97% of DeepMind's reported results (2.634 vs 2.635 sum of radii for n=26).
- Function Minimization: Transformed a random search into a complete simulated annealing algorithm with cooling schedules and adaptive step sizes.
Technical insights:
- Low latency LLMs are critical for rapid generation cycles
- Best results using Gemini-Flash-2.0-lite + Gemini-Flash-2.0 as the ensemble
- For the circle packing problem, Gemini-Flash-2.0 + Claude-Sonnet-3.7 performed best
- Cerebras AI's API provided the fastest inference speeds
- Two-phase approach (exploration then exploitation) worked best for complex problems
Getting started (takes < 2 minutes)
# Clone and install
git clone https://github.com/codelion/openevolve.git
cd openevolve
pip install -e .
# Run the function minimization example
python openevolve-run.py
examples/function_minimization/initial_program.py \
examples/function_minimization/evaluator.py \
--config examples/function_minimization/config.yaml \
--iterations 50
All you need is Python 3.9+ and an API key for an LLM service. Configuration is done through simple YAML files.I'll be around to answer questions and discuss!