What is OpenEvolve?
OpenEvolve is an open-source implementation of AlphaEvolve — an evolutionary coding agent. It sits in the Autonomous Coding Agents category of the AI Coding tools and is open-source, written in Python and licensed Apache-2.0. To get started: install from PyPI.
Overview
OpenEvolve is an open-source implementation of AlphaEvolve — an evolutionary coding agent. You hand it a starting program and an evaluator that returns one or more scores; it then loops, asking an LLM to produce variants, running your evaluator on each, and keeping the ones that score better. The loop is what distinguishes it from a chat-based refactor: the model proposes, a program you wrote judges, and only measured improvements survive.
Because the selection signal is your evaluator rather than a human reading diffs, OpenEvolve is aimed at problems where "better" is a number you can compute: a kernel that runs faster, a packing that fits more circles, a filter with less error. The project runs evolution across parallel islands and supports multi-objective runs with automatic Pareto selection, so several competing metrics can be optimised at once. The repository's own example gallery covers GPU kernel discovery with MLX Metal shaders, circle packing, adaptive sorting in Rust, and automated signal-processing filter design, spanning Python, Rust, R and Metal.
It works either as a CLI over files — an initial program, an evaluator and a YAML config — or as a library, where `run_evolution` takes inline source and a callable evaluator and `evolve_function` evolves a Python function directly against test cases. The shipped example config targets Google Gemini by default, but any OpenAI-compatible provider can be used by editing the config.
What it does
- Evolutionary loop: an LLM proposes program variants, your evaluator scores them, and the best are carried forward
- Parallel evolution across islands, so exploration is not a single hill-climbing chain
- Multi-objective runs with automatic Pareto selection when you return several metrics
- Language-agnostic — the shipped examples evolve Python, Rust, R and Metal shader code
- Usable as a CLI over program/evaluator/config files, or as a library with inline code and a callable evaluator
- Any OpenAI-compatible provider can drive the evolution by editing the YAML config
Getting started
OpenEvolve is on PyPI. The quickest route is to run one of the bundled examples so you can see the loop before writing your own evaluator.
Install from PyPI
A pip install is all that is needed; Docker options are documented in the repository's installation section.
pip install openevolvePoint it at a model
The bundled example config uses Google Gemini by default and still reads the key from OPENAI_API_KEY. Any OpenAI-compatible provider works if you edit config.yaml.
export OPENAI_API_KEY="your-gemini-api-key"Run a bundled example
The runner takes the initial program, the evaluator, a config and an iteration budget. Function minimization is the smallest example.
python openevolve-run.py examples/function_minimization/initial_program.py \
examples/function_minimization/evaluator.py \
--config examples/function_minimization/config.yaml \
--iterations 50Or drive it from Python
The library API needs no external files: pass the starting source and an evaluator callable, or evolve a function directly against test cases.
from openevolve import run_evolution, evolve_function
result = run_evolution(
initial_program='''
def fibonacci(n):
if n <= 1: return n
return fibonacci(n-1) + fibonacci(n-2)
''',
evaluator=lambda path: {"score": benchmark_fib(path)},
iterations=100,
)
result = evolve_function(
bubble_sort,
test_cases=[([3, 1, 2], [1, 2, 3]), ([5, 2, 8], [2, 5, 8])],
iterations=50,
)
print(f"Evolved sorting algorithm: {result.best_code}")Write your own evaluator
The evaluator is the whole design decision: it receives a candidate program path and returns the metric dict that decides what survives. Return several keys to get multi-objective Pareto selection.
Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Search for a faster GPU or CPU kernel when you can benchmark candidates but can't see the optimum by inspection
- Attack a combinatorial or geometric optimisation problem where a scorer is easy to write and the algorithm is not
- Tune a numerical routine — a filter, a solver, a heuristic — against a fixed error or throughput target
- Trade several metrics off at once (speed against accuracy, say) and read the Pareto front instead of picking a weighting up front
How OpenEvolve compares
OpenEvolve alongside other open-source autonomous coding agents tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| opencode | ★ 230k | OpenCode is an open source AI coding agent that runs in your terminal, with built-in build and plan agents and an optional desktop app. |
| Claude Code | ★ 158k | Anthropic's agentic coding tool for the terminal, IDE and GitHub: it understands your codebase, executes routine tasks, explains code and handles git workflows from natural-language commands. |
| Orca | ★ 147k | Open-source desktop workspace that runs Claude Code, Codex, OpenCode and other CLI coding agents in parallel, each in its own git worktree, with a mobile companion app. |
| OpenAI Codex | ★ 137k | OpenAI's cloud and CLI coding agent that writes features, fixes bugs, and proposes code changes across a repo, running tasks in parallel. |
| Pi | ★ 125k | Minimal terminal coding agent harness with four built-in tools, extended through TypeScript extensions, skills and prompt templates instead of forks. |
| Gemini CLI | ★ 109k | An open-source command-line AI agent from Google that connects your terminal to Gemini models for reading code, editing files, running shell commands, and searching the web. |
| autoresearch | ★ 101k | Karpathy's minimal harness that hands a coding agent a single-GPU LLM training script and lets it run fixed five-minute experiments, keeping or discarding each change on its own. |
| OpenEvolve | ★ 7.9k | Evolutionary coding agent that has an LLM mutate a program until a scorer says it improved |
