optimization

Run Optimization

Trigger a GEPA prompt optimization run.

post/api/v1/optimization/run

Request body

dataset_pathstring required

Path to the exported MLflow trace dataset (JSON).

program_specstring required

DSPy program specification string to optimize in module:attr form.

output_pathstring nullable

Optional filesystem path to save the optimized program.

auto'light' | 'medium' | 'heavy'

GEPA optimization intensity level.

train_rationumber

Fraction of examples to use for training (remainder used for validation).

Response

Successful Response

okboolean

Whether the optimization run completed successfully.

optimizerstring

Optimizer backend that was used.

program_specstring required

DSPy program specification that was optimized.

train_examplesinteger required

Number of training examples used.

validation_examplesinteger required

Number of validation examples used.

validation_scorenumber nullable

Validation score from the optimized program, when available.

output_pathstring nullable

Filesystem path where the optimized program was saved.

errorstring nullable

Error message when the optimization run failed.

Changes