Imp.Optimizer.BootstrapFinetune (Imp v0.5.0)

Copy Markdown View Source

Builds SFT jobs from successful, predictor-attributed teacher traces.

With multitask: true, predictors sharing an LM share one job and every unique-LM job receives all accepted module calls. With multitask: false, each predictor receives an independent job containing only its calls. Jobs are rebound only when every entry has a succeeded provider artifact.

DSPy 3.2.1 accidentally shadows its pred_ind filter and feeds every call to every predictor-specific job. Imp intentionally corrects that bug by attributing trace calls to stable Imp.ProgramParameters predictor names. :num_threads, DSPy's name for it, controls teacher trace workers and must also cover the number of provider jobs.

timeout bounds each teacher trace-collection execution (default 5000ms) and is a BEAM-native execution option: pass a larger value or :infinity when teacher programs are slow — agentic or environment-backed teachers routinely run for minutes and would otherwise be killed at the 5s default.

Summary

Functions

new(metric, opts \\ [])