gigaevo-core
Описание
Языки
- Python80,7%
- JavaScript17,7%
- Jinja0,8%
- Shell0,4%
- Jupyter Notebook0,2%
- CSS0,2%
GigaEvo
Evolutionary algorithm that uses Large Language Models (LLMs) to automatically improve programs through iterative mutation and selection.
Demo

Getting Started
- Quick Start - Get running in 5 minutes
- Architecture Guide - Understand the system design
Documentation
- DAG System - Comprehensive guide to GigaEvo's execution engine
- Evolution Strategies - MAP-Elites and multi-island evolution system
- Tools - Helper utilities for analysis, debugging, and problem scaffolding
- Usage Guide - Detailed usage instructions
- Changelog - Version history and changes
- Contributing - Guidelines for contributors
Quick Start
1. Install Dependencies
Requirements: Python 3.12+
2. Set up Environment
Create a file with your OpenRouter API key:
3. Start Redis
4. Run Evolution
That's it! Evolution will start and logs will be saved to .
To study results, check or start / .
Sample analysis code is available at .
What Happens
- Loads initial programs from problems/heilbron/
- Mutates programs using LLMs (GPT, Claude, Gemini, etc.)
- Evaluates fitness by running the programs
- Selects best solutions using MAP-Elites algorithm
- Repeats for multiple generations
Customization
Use a Different Experiment
Change Settings
Configuration
GigaEvo uses a modular configuration system based on Hydra. All configuration is in :
Top-Level Configuration
- Complete experiment templates (start here!)experiment/- Simple single-island evolution (default)base.yaml- Multi-island + multi-LLM explorationfull_featured.yaml- Two islands: performance + simplicitymulti_island_complexity.yaml- Multiple LLMs for diverse mutationsmulti_llm_exploration.yaml
Component Configurations
-
- Evolution algorithmsalgorithm/- Standard MAP-Elitessingle_island.yaml- Multiple independent populations with migrationmulti_island.yaml
-
- Language model setupsllm/- One LLM for all mutationssingle.yaml- Multiple LLMs (GPT, Claude, Gemini, etc.) for diverse mutationsheterogeneous.yaml
-
- DAG execution pipelinespipeline/- Automatically selects pipeline (standard or contextual) based on problemauto.yaml- Basic validation → execution → metricsstandard.yaml- Includes contextual information extractionwith_context.yaml- Template for custom pipelinescustom.yaml
-
- Tunable parameters grouped by domainconstants/- Generation limits, mutation rates, selection pressureevolution.yaml- Temperature, max tokens, retry logicllm.yaml- Island sizes, migration frequency, diversity settingsislands.yaml- Stage timeouts, parallelization settingspipeline.yaml- Connection settings, key patternsredis.yaml- Log levels, output formatslogging.yaml- DAG execution settingsrunner.yaml- API endpoint defaultsendpoints.yaml
Supporting Configurations
-
- Program loading strategiesloader/- Load initial programs from filesystemdirectory.yaml- Load from existing Redis archiveredis_selection.yaml
-
- Logging backendslogging/- TensorBoard integrationtensorboard.yaml- Weights & Biases trackingwandb.yaml
-
- Metric computationmetrics/- Basic fitness metricsdefault.yaml- Includes cyclomatic complexity, LOC, etc.code_complexity.yaml
-
- Redis storage backendredis/ -
- DAG runner configurationrunner/ -
- Core evolution engine settingsevolution/
Configuration Overrides
Override any setting via command line:
See individual YAML files for detailed documentation on each component.
Output
Results are saved to :
- Logs: evolution_YYYYMMDD_HHMMSS.log
- Programs: Stored in Redis for fast access
- Metrics: TensorBoard logs (if enabled)
Troubleshooting
Redis Database Not Empty
If you see:
ERROR: Redis database is not empty!
Flush the database manually:
Or use a different database number:
LLM Connection Issues
Check your API key in :
Verify OpenRouter is accessible:
Architecture
┌─────────────┐
│ Problem │ Define task, initial programs, metrics
└──────┬──────┘
│
v
┌─────────────┐
│ Evolution │ MAP-Elites algorithm
│ Engine │ Selects parents, generates mutations
└──────┬──────┘
│
v
┌─────────────┐
│ LLM │ Generates code mutations
│ Wrapper │ (GPT, Claude, Gemini, etc.)
└──────┬──────┘
│
v
┌─────────────┐
│ Evaluator │ Runs programs, computes fitness
│ (DAG Runner)│ Validates solutions
└──────┬──────┘
│
v
┌─────────────┐
│ Storage │ Redis for fast program access
│ (Redis) │ Maintains archive of solutions
└─────────────┘
Key Concepts
- MAP-Elites: Algorithm that maintains diverse solutions across behavior dimensions
- Islands: Independent populations that can exchange solutions (migration)
- DAG Pipeline: Stages for validation, execution, complexity analysis, etc.
- Behavior Space: Multi-dimensional grid dividing solutions by characteristics
Advanced Usage
Generate Problem with Wizard
Create problem scaffolding from YAML configuration:
See for detailed wizard documentation.
Create Your Own Problem Manually
-
Create directory in
:problems/problems/my_problem/ - validate.py # Fitness evaluation function - metrics.yaml # Metrics specification - task_description.txt # Problem description - initial_programs/ # Directory with initial programs - strategy1.py # Each contains entrypoint() function - strategy2.py - helper.py # Optional: utility functions - context.py # Optional: runtime context builder -
Run:
See for a complete example.
Custom Experiment
Copy an existing experiment and modify:
Tools
GigaEvo includes utilities for analysis and visualization:
- Export evolution data to CSVtools/redis2pd.py- Compare multiple runs with plotstools/comparison.py- Visual DAG pipeline designertools/dag_builder/- Interactive problem setuptools/wizard/
See for detailed documentation.
License
MIT License - see LICENSE file for details.
Citation
If you use GigaEvo in your research, please cite: