Skip to content

Gemini Optimization Guide

This guide runs real GEPA reflection optimization with Gemini Flash using small budget.

Set API Key

export GOOGLE_API_KEY=your_key_here

Run Low Cost Demo

python examples/optimize_gemini_flash.py --max-metric-calls 4

Docker Backend (Optional)

python examples/optimize_gemini_flash.py --executor-backend docker --max-metric-calls 4

Important Note

In adapter mode with current GEPA API:

  • task_lm is not used
  • reflection_lm drives optimization

This is expected behavior.

Increase Quality If Needed

python examples/optimize_gemini_flash.py --max-metric-calls 12

Higher budgets can find better candidates but cost more.