Skip to main content

TL;DR

  • Multi-Stage Optimizers: Both MIPRO and GEPA now support multi-stage pipeline optimization
  • GEPA Algorithm: Genetic Evolution for Prompt Optimization now available
  • Expanded Model Support: Google Gemini and OpenAI models added
  • Enhanced SDK validation with comprehensive error checking

Multi-Stage Optimizers & Expanded Model Support

Both prompt optimization algorithms now support multi-stage pipeline optimization for complex workflows with multiple processing stages.

MIPRO Multi-Stage

  • Generates per-stage instruction proposals with automatic stage detection via LCS (Longest Common Subsequence) matching
  • Each stage gets stage-specific meta-prompts including pipeline overview, stage role, and baseline performance
  • Supports per-module configuration with max_instruction_slots and max_demo_slots for fine-grained control

GEPA Multi-Stage

  • Uses module-aware evolution where each pipeline module gets its own gene
  • Mutations target specific modules, uniform crossover combines parent genes per module
  • Aggregated scoring sums module lengths for Pareto optimization
  • Supports per-module max_instruction_slots, max_tokens, and allowed_tools configuration

Configuration

Both algorithms support pipeline_modules metadata in initial prompts and module-specific settings in their respective config sections (prompt_learning.gepa.modules and prompt_learning.mipro.modules).

GEPA: Genetic Evolution for Prompt Optimization

GEPA algorithm is now available for prompt optimization jobs.

Key Features

  • Evolutionary Algorithms: Uses mutation, crossover, and selection to optimize prompts across multiple generations
  • Multi-Objective Optimization: Maintains a Pareto front balancing accuracy, token count, and task-specific metrics
  • Prompt ID-Based URLs: Prompt transformations use versioned URLs (/v1/{prompt_version_id}/chat/completions) for better traceability
  • Validation Scoring: Job results distinguish between prompt_best_train_score and prompt_best_validation_score

Integration Testing

Added comprehensive integration tests for GEPA training workflows with Banking77 task app.

Gemini Model Support

Added comprehensive support for Google Gemini models as policy models for both GEPA and MIPRO algorithms.
  • Supported Models: gemini-2.5-pro (≤200k tokens), gemini-2.5-pro-gt200k (>200k tokens), gemini-2.5-flash, and gemini-2.5-flash-lite
  • Provider Integration: Full SDK validation and backend support for provider = "google" with automatic pricing calculation
  • Example Configs: Added example configurations demonstrating Gemini usage

OpenAI Model Support

Expanded OpenAI model support for prompt optimization with comprehensive coverage of latest models.
  • Supported Models: gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, gpt-5, gpt-5-mini, and gpt-5-nano
  • Model Validation: SDK-side validation with clear error messages for unsupported models
  • Explicit Rejection: gpt-5-pro rejected due to high cost (15/15/120 per 1M tokens)
  • Provider Prefix Support: Models can be specified with or without provider prefix

SDK Validation Enhancements

Improved config validation with comprehensive error checking before sending to backend.
  • Multi-Stage Validation: Validates that pipeline_modules match module configs, checks for missing or extra modules
  • Model Validation: Provider-aware model validation with detailed error messages listing supported models
  • Nano Model Restrictions: Clear validation that nano models are allowed for policy models but rejected for mutation/meta models

Documentation

  • Multi-Stage Pipeline Guide: Updated documentation with examples and configuration details
  • Model Support Reference: Complete documentation of supported models for each provider
  • GEPA Guide: Complete documentation with quick start, configuration examples, and troubleshooting
  • Example Configurations: Added example configs demonstrating multi-stage optimization

Use Cases

  • Complex Pipelines: Optimize multi-stage workflows with stage-specific prompt improvements
  • Evolutionary Optimization: Use GEPA for population-based prompt optimization
  • Multi-Provider Support: Choose from OpenAI, Google, or Groq models based on your needs
  • Cost Optimization: Use nano models for policy evaluation while using larger models for generation