YiVal is an open-source automatic prompt engineering assistant for generative AI applications. With around 2,100 stars on GitHub, it automates the tedious loop of tweaking prompts and application configs by hand: you define your task and evaluation data, and YiVal iteratively optimizes prompts for models like GPT-4, Midjourney, and Stable Diffusion.
Prompt tuning is usually trial and error. YiVal treats it as an optimization problem: it generates candidate prompts, evaluates them against your dataset with automatic and human-in-the-loop scoring, and keeps the variants that perform best. Beyond text prompts, it can tune other configuration in the loop of a GenAI app, and it provides experiment tracking so you can compare runs instead of guessing.
Under the hood, YiVal borrows ideas from evolutionary search: it maintains a population of prompt variants, applies variation operators to create new candidates, and selects the fittest according to your evaluators. That framing makes it effective for image-generation prompts as well as text, since the same loop can score Midjourney or Stable Diffusion outputs. For teams shipping prompt-driven features, it provides a repeatable process where prompt changes are validated by data rather than vibes.
YiVal provides both a Python API and configuration files for defining experiments, and it logs intermediate results so you can watch optimization progress rather than waiting for a single final answer. It also supports generating evaluation datasets with LLMs, which helps teams bootstrap the test data that prompt optimization depends on when no labeled examples exist yet.
YiVal is free and open source under the Apache-2.0 license. Costs are limited to the model API calls used during optimization runs.
GenAI application developers and prompt engineers who want systematic, data-driven prompt improvement instead of manual guesswork.