DSPy v3.2.0
DSPy v3.2.0 releases with chainable optimizers in BetterTogether, partial decoupling from LiteLLM via custom BaseLM backends, and type-mismatch warnings for signature fields.
Highlights BetterTogether Allows Chaining Optimizers — @dilarasoylu `BetterTogether` now accepts arbitrary optimizers as keyword arguments and chains them via strategy strings. For example, `BetterTogether(metric=m, p=GEPA(...), w=BootstrapFinetune(...))` with `strategy="p -> w -> p"` will prompt-optimize, fine-tune, then prompt-optimize again -- evaluating each step on a valset and returning the best program. (#9149) There are many promising strategies that may come from running multiple GEPA steps in sequence, or combining prompt and weight optimization steps in sequence, and we are excited to see what the community comes up with.
Beginning of decoupling DSPy from LiteLLM — @MaximeRivest @MaximeRivest has an ongoing effort to decouple DSPy from LiteLLM, making it much easier to use custom LMs with DSPy. In this release, adapters no longer import `litellm` at all -- `BaseLM` now exposes capability properties (`supports_function_calling`, `supports_reasoning`, `supports_response_schema`, `supported_params`) and a new `dspy.ContextWindowExceededError` replaces the `litellm` error throughout. Custom `BaseLM` backends can now integrate with DSPy's retry/truncation logic without any…
- github.comdspy 3.2.0primary