EvoToolkit¶
LLM-driven solution evolutionary optimization toolkit
EvoToolkit is a Python library that leverages Large Language Models (LLMs) to evolve solutions for optimization problems. It combines the power of evolutionary algorithms with LLM-based solution generation and refinement, supporting code, text, and other evaluable representations.
β¨ Key Features¶
- π€ LLM-Driven Evolution: Use state-of-the-art language models to generate and evolve solutions
- π¬ Multiple Algorithms: Support for EoH, EvoEngineer, and FunSearch evolutionary methods
- π Task-Agnostic: Supports any evaluable optimization task (code, text, math expressions, etc.)
- π― Extensible Framework: Easy-to-extend task system for custom optimization problems
- π Simple API: High-level
evotoolkit.solve()function for quick prototyping - π οΈ Advanced Customization: Low-level API for fine-grained control
Built-in Task Types¶
| Task Type | Description | Details |
|---|---|---|
| π¬ Scientific Regression | Symbolic regression on real scientific datasets | Scientific Regression Tutorial |
| π¬ Prompt Engineering | Optimize LLM prompts for downstream tasks | Prompt Engineering Tutorial |
| π‘οΈ Adversarial Attacks | Evolve adversarial attack algorithms | Adversarial Attack Tutorial |
| β‘ CUDA Code Evolution | Evolve and optimize CUDA kernels | CUDA Task Tutorial |
π Quick Start¶
Installation¶
For detailed installation instructions, see the Installation Guide.
Your First Optimization¶
import evotoolkit
from evotoolkit.task.python_task.scientific_regression import ScientificRegressionTask
from evotoolkit.task.python_task import EvoEngineerPythonInterface
from evotoolkit.tools import HttpsApi
# 1. Create a task
task = ScientificRegressionTask(dataset_name="bactgrow")
# 2. Create an interface
interface = EvoEngineerPythonInterface(task)
# 3. Solve with LLM
llm_api = HttpsApi(
api_url="https://api.openai.com/v1/chat/completions",
key="your-api-key-here",
model="gpt-4o"
)
result = evotoolkit.solve(
interface=interface,
output_path='./results',
running_llm=llm_api,
max_generations=5
)
That's it! EvoToolkit will use the LLM to evolve mathematical equations to fit your scientific data.
For a complete walkthrough, check out the Getting Started Guide.
π Available Algorithms¶
| Algorithm | Description |
|---|---|
| EvoEngineer | Main LLM-driven evolutionary algorithm |
| FunSearch | Function search optimization method |
| EoH | Evolution of Heuristics |
See the Tutorials section for more usage examples.
π Documentation¶
- Installation: Installation instructions and setup
- Getting Started: Quick start guide and basic usage
- Tutorials: Step-by-step tutorials for common tasks
- API Reference: Detailed API documentation
- Development: Contributing guidelines and architecture
π Links¶
- GitHub: https://github.com/pgg3/evotoolkit
- PyPI: https://pypi.org/project/evotoolkit/
- Paper: arXiv (submitted)
π License¶
EvoToolkit is dual-licensed:
- Academic & Open Source Use: Free for academic research, education, and open source projects. Citation required for academic publications.
- Commercial Use: Requires a separate commercial license. Contact pguo6680@gmail.com for licensing.
See LICENSE for full terms.
π Citation¶
If you use EvoToolkit in your research, please cite:
@article{guo2025evotoolkit,
title={evotoolkit: A Unified LLM-Driven Evolutionary Framework for Generalized Solution Search},
author={Guo, Ping and Zhang, Qingfu},
journal={arXiv preprint arXiv:XXXX.XXXXX},
year={2025},
note={Submitted to arXiv}
}
π¬ Getting Help¶
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: pguo6680@gmail.com