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.
This repository requires Python 3.10 to 3.13 and uv.
git clone https://github.com/chchenhui/frugalevo.git
cd frugalevo
uv syncInstall 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"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/ShinkaEvolveIf 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 frugalevoAlternatively, 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.yamlscripts/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.
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 |
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.
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}
}If you have any questions or feedback, please reach out to: [email protected]
