**GEPA** logo

**GEPA**

Free

![](https://img.shields.io/github/stars/gepa-ai/gepa?style=flat-square)

FreeFree tier
Inputs: textOutputs: text
Type
Open Source

About **GEPA**

GEPA (Genetic-Pareto) is an open-source framework for optimizing any system with textual parameters against any evaluation metric. Unlike RL or gradient-based methods that collapse execution traces into a single scalar reward, GEPA uses LLMs to read full execution traces—including error messages, profiling data, and reasoning logs—to diagnose why a candidate failed and propose targeted fixes. Through iterative reflection, mutation, and Pareto-aware selection, GEPA evolves high-performing variants with minimal evaluations. It has demonstrated 90x cost savings compared to proprietary models, 35x faster optimization than RL, and accuracy improvements from 32% to 89% on tasks such as prompt optimization (e.g., AIME benchmark), agent architecture discovery (ARC-AGI), cloud scheduling policy optimization, and coding agent skill learning. GEPA is used in production by companies including Shopify, Databricks, Dropbox, OpenAI, Pydantic, MLflow, and Comet ML.

Key Features

Optimizes any textual parameter (prompts, code, agent architectures, configurations, vector graphics, etc.)
Uses LLMs to read full execution traces (error messages, profiling data, reasoning logs) for diagnosis and targeted fixes
Iterative reflection, mutation, and Pareto-aware selection to evolve high-performing variants
Works with any evaluation metric; requires only 100–500 metric calls vs. 5,000–25,000+ for RL
90x cheaper than proprietary models (open-source models + GEPA beat Claude Opus 4.1 at Databricks)
35x faster than RL (GRPO) on typical optimization tasks
Integrated with DSPy as dspy.GEPA for AI pipeline optimization
Proven in production at Shopify, Databricks, Dropbox, OpenAI, Pydantic, MLflow, Comet ML
Open-source with community support on GitHub (5.8k stars, 475 forks)
Simple pip install with quick start examples

Pros & Cons

Pros
  • Highly cost-effective: 90x cheaper than using proprietary models for comparable quality
  • Fast convergence: requires only 100–500 evaluations vs. 5,000–25,000+ for RL
  • Open-source and free to use (MIT license)
  • Proven in production by major companies (Shopify, Databricks, Dropbox, OpenAI)
  • Easy to install (pip) and integrate with existing workflows (e.g., DSPy)
  • Self-diagnostic: uses LLMs to read execution traces and propose informed improvements
  • Active community with extensive documentation, examples, and a research paper
Cons
  • Requires access to LLMs for the reflection step, incurring API costs or need for local LLM hosting
  • Optimization relies on a measurable metric; defining a good metric is essential
  • May require careful tuning of mutation and selection parameters for optimal results
  • Currently focused on textual parameters; not suited for optimizing numeric or non-textual systems directly

Best For

Prompt optimization for LLMs (e.g., AIME benchmark: GPT-4.1 Mini improved from 46.6% to 56.6%)Code optimization and bug fixing via auto-learned skills (e.g., Jinja resolve rate from 55% to 82%)Agent architecture discovery (e.g., ARC-AGI accuracy from 32% to 89%)Cloud scheduling policy optimization (e.g., 40.2% cost savings)Optimizing AI pipeline components with DSPy integrationGeneral optimization of any system with textual parameters and measurable performance

FAQ

What is GEPA?
GEPA (Genetic-Pareto) is an open-source framework for optimizing any system with textual parameters (prompts, code, agent architectures) using LLM-based reflection and Pareto-efficient evolutionary search. It reads execution traces to diagnose failures and propose targeted improvements.
How do I install GEPA?
Install via pip: pip install gepa. To install the latest development version: pip install git+https://github.com/gepa-ai/gepa.git.
What can I optimize with GEPA?
Any textual parameter can be optimized, including system prompts, code snippets, agent architectures, scheduling policies, vector graphics instructions, and more. The only requirements are a measurable evaluation metric and the ability to run the candidate.