Skip to content
chchenhuiPublic

About

Official implementation of "FrugalEvo: Towards Cost-Aware LLM-Guided Program Evolution"

Resources

Stars

14 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

FrugalEvo: Towards Cost-Aware LLM-Guided Program Evolution

Paper Apache 2.0

FrugalEvo is a cost-aware evolutionary framework for computational optimization. It uses a stronger, higher-cost LLM to explore solution strategies, and a cheaper LLM to implement them and iteratively refines the resulting code.



Figure 1: The FrugalEvo framework.

📦 Installation

This repository requires Python 3.10 to 3.13 and uv.

git clone https://github.com/chchenhui/frugalevo.git
cd frugalevo
uv sync

Install frugalevo as a package:

uv pip install -e .

Please set up your API keys before starting the experiments:

export OPENAI_API_KEY="your-openai-api-key-here"
export ANTHROPIC_API_KEY="your-anthropic-api-key-here"
export GOOGLE_API_KEY="your-google-api-key-here"
export OPENROUTER_API_KEY="your-openrouter-api-key-here"

🛠️ External backends

Install with uv sync --extra external, then use the corresponding flag:

Backend Flag Source
OpenEvolve --search openevolve codelion/openevolve
ShinkaEvolve --search shinkaevolve SakanaAI/ShinkaEvolve (manual install)
ShinkaEvolve manual install
git clone --depth 1 https://github.com/SakanaAI/ShinkaEvolve.git external_repos/ShinkaEvolve
uv pip install -e external_repos/ShinkaEvolve

🚀 Quick Start

If you want to try FrugalEvo, run the circle packing benchmark with the commands below:

# Try the circle packing benchmark
uv sync --extra math
uv run skydiscover-run benchmarks/math/circle_packing/initial_program.py \
  benchmarks/math/circle_packing/evaluator.py \
  --config configs/budget2_gpt56_circle_packing/circle_packing/frugalevo.yaml \
  --search frugalevo

Alternatively, after installing the math dependencies and setting your API key, use the helper script:

bash scripts/run_frugalevo.sh

# Override the iteration limit and output directory
bash scripts/run_frugalevo.sh --iterations 100 --output runs/my_circle_packing

# Run your own optimization task
bash scripts/run_frugalevo.sh \
  --initial-program path/to/initial_program.py \
  --evaluator path/to/evaluator.py \
  --config path/to/frugalevo.yaml

scripts/run_frugalevo.sh defaults to the circle packing configuration above. Customize the models, API endpoint, and budget in the YAML configuration for your provider and task. Run bash scripts/run_frugalevo.sh --help for usage details.

📖 Command-line Options

CLI flags
uv run skydiscover-run [INITIAL_PROGRAM] EVALUATOR [options]
Flag Description
-c, --config FILE Config YAML
-i, --iterations N Number of iterations
-m, --model MODEL LLM model (overrides config)
-s, --search TYPE Search algorithm
-o, --output DIR Output directory
--api-base URL Override LLM API endpoint
--checkpoint DIR Resume from checkpoint
--agentic Enable agentic mode (LLM can read your files)
-l, --log-level LEVEL DEBUG, INFO, WARNING, or ERROR

🔗 Acknowledgement

FrugalEvo is adapted from the SkyDiscover framework, which is also inspired by AlphaEvolve and incorporates useful code components from open-source efforts such as OpenEvolve. Its interface is compatible with the optimize_anything API.

✍️ Citation

Please cite our paper if you find our work helpful:

@article{chen2026frugalevo,
      title={FrugalEvo: Towards Cost-Aware LLM-Guided Program Evolution}, 
      author={Chen, Hui and Qi, Xuan and Zhao, James Xu and Feng, Zhaopeng and Liu, Shilong and Xu, Kuang and Koh, Pang Wei and Hooi, Bryan},
      journal={arXiv preprint arXiv:2610.03675},
      year={2026}
}

📬 Contact Us

If you have any questions or feedback, please reach out to: [email protected]

About

Official implementation of "FrugalEvo: Towards Cost-Aware LLM-Guided Program Evolution"

Resources

Stars

14 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages