optimize_anything: one API to optimize code, prompts, agents, configs — if you can measure it, you can optimize it

February 22, 2026
optimize_anything: one API to optimize code, prompts, agents, configs — if you can measure it, you can optimize it

Here’s something that caught my attention — there’s now an open-source API called 'optimize_anything' that aims to make optimizing pretty much anything a breeze. And get this — according to /u/LakshyAAAgrawal, it can handle everything from code and prompts to agent architectures and scheduling policies. The secret sauce? It combines diagnostic feedback — like stack traces and profiler output — with Pareto-efficient search, so it doesn’t just average out metrics but finds a balanced sweet spot. Now, here’s where it gets impressive — across eight different domains, it helped improve agent skills, cut cloud costs, and even beat baselines for CUDA kernels and circle packing. What I love is that it’s built to be flexible — if you can measure it, it can be optimized. As Lakshy explains, this isn’t just hype; the results speak for themselves. And if you want to try it out, there’s a detailed blog with all the code and case studies. So, the future of optimization is looking smarter and more adaptable than ever.

2-Cc1NyTxl7z1zJSDNsCfv2lkMJD9O4gdY-5mJfi

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="", 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

submitted by /u/LakshyAAAgrawal
[link] [comments]
Audio Transcript

2-Cc1NyTxl7z1zJSDNsCfv2lkMJD9O4gdY-5mJfi

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="", 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

submitted by /u/LakshyAAAgrawal
[link] [comments]
0:00/0:00