Skip to content

EvoToolkit

LLM-driven evolutionary optimization for executable solutions

EvoToolkit is a Python framework for evolving code, symbolic expressions, prompts, and other executable text with large language models. It exposes a reusable Method -> Interface -> Task architecture so that algorithms, adapters, and execution infrastructure can be composed instead of rebuilt from scratch.


Key Features

  • LLM-driven evolution for generating and refining candidate solutions
  • Multiple algorithms: EoH, EvoEngineer, and FunSearch
  • Reusable architecture across algorithms and reference task adapters
  • Simple top-level API via evotoolkit.solve(...)
  • Bilingual documentation with tutorials and API reference

Reference Task Families

Task Family Role Details
Scientific regression CPU-reviewable reference adapter for symbolic regression workflows Scientific Regression Tutorial
Prompt engineering CPU-reviewable reference adapter for string optimization workflows Prompt Engineering Tutorial
Adversarial attacks CPU-reviewable reference adapter for algorithm evolution workflows Adversarial Attack Tutorial
CUDA engineering Optional hardware-backed reference task family; the reviewed surface focuses on task shells and interfaces CUDA Task Tutorial
Control (Box2D) CPU-reviewable reference adapter for control-policy workflows Control Box2D Tutorial
CANN init Experimental adjacent workflow, not part of the primary reviewed surface CANN Init Tutorial

Quick Start

Installation

pip install evotoolkit

# Optional extras
pip install "evotoolkit[scientific_regression]"
pip install "evotoolkit[prompt_engineering]"
pip install "evotoolkit[adversarial_attack]"
pip install "evotoolkit[cuda_engineering]"
pip install "evotoolkit[control_box2d]"
pip install "evotoolkit[cann_init]"
pip install "evotoolkit[all_tasks]"

The public package is tested on Python 3.10-3.12. Optional CUDA and CANN workflows additionally require the corresponding hardware/toolchains.

Your First Optimization

import evotoolkit
from evotoolkit.task.python_task import EvoEngineerPythonInterface
from evotoolkit.task.python_task.scientific_regression import ScientificRegressionTask
from evotoolkit.tools import HttpsApi

task = ScientificRegressionTask(dataset_name="bactgrow")
interface = EvoEngineerPythonInterface(task)

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,
)

For a full walkthrough, see Getting Started.


Algorithms

Algorithm Description
EvoEngineer LLM-driven evolutionary search with structured operators
FunSearch Program search with an island-model database
EoH Evolution of Heuristics with crossover and mutation operators

Documentation

Reviewer-Facing Documents



License

EvoToolkit is released under the MIT License. Optional hardware-backed workflows may depend on separately installed third-party toolchains; see each task guide for those external requirements.


Citation

If you use EvoToolkit in research, please cite the software version or repository snapshot you used. A repository citation entry is:

@software{guo2026evotoolkit,
  author = {Guo, Ping and Zhang, Qingfu},
  title = {evotoolkit},
  year = {2026},
  url = {https://github.com/pgg3/evotoolkit},
  version = {1.0.0}
}

Getting Help