Applies evolutionary algorithms to automatically optimize LLM prompts. Define a task, provide test cases (or let the system generate them), and watch evolution find a better prompt — generation by generation.
Based on EvoPrompt (ICLR 2024) and OPRO (Google DeepMind).
- Seed a population of prompts from your input + LLM-generated variations
- Evaluate each prompt against test cases using an LLM-as-Judge (scored 0.0-1.0)
- Select the fittest via tournament selection
- Crossover + Mutate to create the next generation (7 mutation operators, section-aware crossover)
- Repeat with adaptive mutation and elite re-evaluation
- Result — the best prompt with fitness metrics and full genealogy DAG
Define your prompt using a guided framework: Persona, Task, Steps, Context & Constraints, Goal, and Output Format. The system auto-generates diverse test cases and assembles everything into an optimized prompt.
Full control over population size, generations, mutation rate, elite count, evaluation method, crossover strategy, and 7 mutation operators. Add custom seed prompts or let the system generate the initial population.
Run locally with Ollama (zero cost, no rate limits), or connect to Google AI Studio or OpenRouter for cloud inference. Select compute backend (Auto/GPU/CPU/Hybrid) and test connection before starting.
Watch the population improve in real-time. The fitness chart tracks best, mean, and worst scores across all generations.
Interactive directed acyclic graph showing the full evolutionary lineage — which prompts were seeds, which came from crossover or mutation, and how elites carried forward. Click any node to inspect the prompt.
Detailed table showing best, mean, and worst fitness for each generation with population counts.
Browse, compare, and revisit all past evolution runs with status, fitness scores, and timing.
Next.js 16 | React 19 | TypeScript | Tailwind CSS 4 | shadcn/ui | SQLite + Drizzle ORM | Zustand | Recharts | React Flow | Zod | Vitest
- Node.js 20+
- npm
- Ollama (for local inference) or a Google AI Studio / OpenRouter API key
git clone https://github.com/Blizzeq/Prompt-Evolution-Engine.git
cd Prompt-Evolution-Engine
npm install
cp .env.local.example .env.local # configure your provider
npx drizzle-kit migrate
npm run devOpen http://localhost:3000.
The SQLite database is created automatically at ./data/evolution.sqlite by default. Override it with DB_PATH in .env.local if needed.
ollama serve
ollama pull gemma4 # Gemma 4 26B — MoE, activates 4B params/tokenSet GOOGLE_AI_API_KEY or OPENROUTER_API_KEY in .env.local.
- EvoPrompt — LLMs with Evolutionary Algorithms (ICLR 2024)
- OPRO — Optimization by PROmpting (Google DeepMind)
- DSPy MIPROv2 — Bayesian prompt optimization (Stanford NLP)
- GAAPO — GA-based Automated Prompt Optimization
MIT







