Lakshya A Agrawal

GEPA's optimize_anything: one API to optimize code, prompts, agents, and configs

We open-sourced optimize_anything, an API that optimizes any text artifact. You provide a starting artifact (or just describe what you want) and an evaluator — it handles the search.

import gepa.optimize_anything as oa

result = oa.optimize_anything(
    seed_candidate="<your artifact>",
    evaluator=evaluate,  # returns score + diagnostics
)

It extends GEPA (our state of the art prompt optimizer) to code, agent architectures, scheduling policies, and more. Two key ideas:
(1) diagnostic feedback (stack traces, rendered images, profiler output) is a first-class API concept the LLM proposer reads to make targeted fixes, and
(2) Pareto-efficient search across metrics preserves specialized strengths instead of

averaging them away.

Results across 8 domains:

  • learned agent skills pushing Claude Code to near-perfect accuracy simultaneously making it 47% faster,

  • cloud scheduling algorithms cutting costs 40%,

  • an evolved ARC-AGI agent going from 32.5% → 89.5%,

  • CUDA kernels beating baselines,

  • circle packing outperforming AlphaEvolve's solution,

  • and blackbox solvers matching andOptuna.

pip install gepa | Detailed Blog with runnable code for all 8 case studies | Website

10 views

Add a comment

Replies

Be the first to comment