A prompt language model generates candidate instructions during optimization. A separate task model evaluates those candidates and handles production requests, so a more capable, potentially more expensive model can be reserved for the less frequent optimization calls. MIPROv2 can also use the task model for instruction proposals when no separate prompt model is specified. section 6.1.4 section 6.2
Listing 6.3 Using the COPRO optimizer with prompt_lm
lm_5 = dspy.LM(model='gpt-5', temperature=1.0, max_tokens=30000)
copro = dspy.COPRO(prompt_model=lm_5, init_temperature=1.0,
metric=validate_answer,
breadth=2, depth=2, track_stats=True)
prog_copro_2 = copro.compile(intent_classifier, trainset=val_set,
eval_kwargs={"num_threads": 3,
'display_progress': True})
This COPRO configuration assigns GPT-5 to propose instructions during compilation. section 6.1.4
