Skip to content
ToolOpen-source agent

gepa

Python library that optimises prompts and code with reflective evolutionary search

Pricing
Open source
Platforms
API, CLI
GitHub stars
7.5K
Last commit
8 days ago
Language
Jupyter Notebook
License
MIT

About gepa

gepa is an open-source AI tool for ai models and llm tooling. It is available on API and CLI.

The method treats any text parameter, such as a prompt, code or configuration, as something to improve by trial. An LLM reflects on run traces and proposes edits, while Pareto-efficient selection keeps diverse good candidates.

Usage is a single optimize call: give it a seed candidate, training and validation sets, a task model and a reflection model. The site's example reports a rise from 46.6% to 56.6% on AIME 2025 with GPT-4.1 Mini.

It is also built into DSPy, and a custom adapter lets you plug in any system that can be scored. Headline claims on the site (cost, speed against RL, named users) are the vendor's own.

What it does

Reflective optimisation
An LLM reads traces and proposes better candidates.
Pareto selection
Keeps varied high performers instead of one winner.
Optimises any text
Prompts, code, configurations and agent architectures.
DSPy built-in
Available as dspy.GEPA.
Custom adapters
Wrap any system with an evaluate function.
pip install
Distributed on PyPI.

Good for

  • Improve a system prompt against a dataset
  • Tune a DSPy program
  • Optimise code against a metric
  • Evolve agent configurations

Pricing

Open source

MIT

Prices change. Check gepa-ai.github.io before you buy.

gepa FAQ

How do I install it?

pip install gepa.

Does it work with DSPy?

Yes, it is built into DSPy.

What does it need?

A metric, datasets and a reflection model.

Is gepa free?

Yes. gepa is open source, so you can use and self-host it for free.

What are the best alternatives to gepa?

The closest alternatives to gepa are ECC, ponytail, graphify, ragflow and Agent-Reach.

Alternatives to gepa

  1. Skills, hooks, memory and security layer for coding agent harnesses

    • Freemium
    • Open-source agent
    • 305K GitHub stars
    • AI models and LLM tooling
  2. Ruleset that makes AI coding agents write less code that still works

    • Open source
    • Open-source agent
    • 192K GitHub stars
    • AI models and LLM tooling
  3. Code knowledge graph that gives coding assistants shared, source-linked context

    • Freemium
    • Open-source agent
    • 149K GitHub stars
    • Knowledge and memory
  4. Open-source RAG engine with a document pipeline, hybrid search and visual agent workflows

    • Freemium
    • Open-source agent
    • 94.3K GitHub stars
    • Knowledge and memory
  5. Command-line channels that let AI agents read X, Reddit, YouTube and Chinese platforms

    • Open source
    • Open-source agent
    • 112K GitHub stars
    • AI models and LLM tooling
  6. Self-hosted AI gateway routing many providers through one local endpoint with fallback

    • Freemium
    • Open-source agent
    • 88.1K GitHub stars
    • AI models and LLM tooling