--- id: gepa version: "0.1.4" license: MIT license_treatment: permissive maintenance: active --- # gepa — A framework for optimizing textual system components (AI prompts, code snippets, etc.) using LLM-based reflection and Pareto-efficient evolutionary search. License: permissive · Maintenance: active · Downloads: 6.6M/mo ## What it is and what it does GEPA is a framework for automatically improving textual system components by treating optimization as a search problem guided by LLM reflection. Rather than collapsing execution outcomes into a single scalar reward, it reads full execution traces—error messages, profiling data, reasoning logs—to diagnose why a candidate failed and propose targeted improvements. The system uses Pareto-efficient evolutionary search to evolve high-performing variants with minimal evaluations, supporting optimization of prompts, code, agent architectures, scheduling policies, and other text-based artifacts. The framework integrates with major AI platforms including DSPy, MLflow, Comet ML Opik, and Pydantic, offering both a standalone API and adapters for specialized tasks like RAG optimization, MCP tool descriptions, and LangChain pipelines. It requires Python 3.10+ and access to LLM APIs for reflection; the base package has no runtime dependencies, making installation straightforward. Use it for: - Optimize system prompts for classification or reasoning tasks to improve accuracy without manual prompt engineering. - Evolve entire DSPy programs including signatures and control flow to discover better architectures automatically. - Improve RAG retrieval and generation by optimizing prompts across vector store backends like ChromaDB or Weaviate. - Discover cloud scheduling policies or other configuration parameters that beat expert heuristics on your workload. - Tune agent tool descriptions and system prompts for tool-using agents in LangChain or MCP environments. - Automatically learn and refine coding agent skills to improve task resolution rates on specialized domains. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. GEPA optimizes textual system components—prompts, code, agent architectures, configurations—using LLM-based reflection and Pareto-efficient evolutionary search to improve performance against any measurable metric. Yes. GEPA is actively maintained, has no runtime dependencies, and offers a permissive MIT license. It solves a real problem—systematic optimization of textual system components—with a novel LLM-reflection approach that avoids the evaluation overhead of traditional RL methods. Integrations with DSPy, MLflow, and other major frameworks lower adoption friction. Primary constraint is the need for external LLM API access; evaluate whether your use case justifies the API costs. ## Install pip install gepa uv add gepa poetry add gepa ## Installing gepa Before you install: Low friction installation with no runtime dependencies. Active maintenance—last commit 2026-08-14, released 2025-08-11, 6117 GitHub stars. Supports Python 3.10+. License in practice: MIT license permits commercial and private use with minimal restrictions, making it suitable for production deployment in most contexts. Quickstart: pip install gepa import gepa result = gepa.optimize( seed_candidate={"system_prompt": "You are a helpful assistant."}, trainset=trainset, valset=valset, task_lm="openai/gpt-4.1-mini", max_metric_calls=150, reflection_lm="openai/gpt-5", ) print(result.best_candidate['system_prompt']) Requires Python 3.10 or later; LLM API access (e.g., OpenAI) needed for reflection and task evaluation. Verify before relying: - Whether the package requires external LLM API credentials to be pre-configured or if it handles credential management internally. - Performance characteristics and typical optimization time for different problem scales. - Whether adapters like ConfidenceAdapter and LangChain require separate installation steps beyond the base package. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 6.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags prompt optimization framework, LLM-based evolutionary search, text parameter tuning, AI system optimization, Pareto frontier search, automated prompt improvement, genetic algorithm for prompts, prompt-optimization, evolutionary-search, llm-reflection [View on SkillFed](https://skillfed.io/packages/gepa) · [View on PyPI](https://pypi.org/project/gepa/)