MIPROv2Optimizer
MIPRO v2 optimizer that tunes instructions and demonstrations via a 3-stage pipeline:
Demo generation: creates diverse candidate demo sets via bootstrapping.
Instruction proposal: generates instruction variants via a meta-LLM.
Grid search: evaluates random (instruction, demo set) combinations on a validation set.
Produces an OptimizationArtifact with the best-scoring instruction and demo set for each optimizable module (strategy-level and per-subgraph).
Parameters
LLM model for meta-LLM calls (instruction proposal, dataset summarization).
Preset mode controlling defaults (LIGHT/MEDIUM/HEAVY).
Manual override for number of candidates per module.
Manual override for grid search trials.
Max demos per bootstrap run.
Total demo slots (bootstrapped and labeled).
Whether bootstrap uses labeled fallback.
Configuration for an instruction proposal.
File path to save/load the optimization artifact.
Seed for reproducibility.
Max concurrent operations (bootstrap runs, instruction proposals).
Constructors
Types
Persistence helpers for the optimized OptimizationArtifact.
Functions
Trains the agent using the provided session, which gives access to a TrainingSession.use block where the training scope (agent, dataset, tracked execution methods) is available.