Change8

Migrating to DSPy 3.0.0b2

Version 3.0.0b2 introduces 8 breaking changes. This guide details how to update your code.

Released: 7/1/2025

8
Breaking Changes
7
Migration Steps
12
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

dspy.ProgramevaluateHyperparameterinternal_dspydsp.metricsChainOfThoughtWithHintToolCalls.formatStreamListenerJSONAdapterChatAdapterdspy.settings.Assertiondspy.Prediction

Breaking Changes

Issue #1

Removed the dspy.Program alias; code importing or referencing dspy.Program will fail. Replace with the new class or import path as documented.

Issue #2

Changed the output interface of evaluate; callers must adapt to the new return structure.

Issue #3

Removed the Hyperparameter class; any usage must be replaced with the new configuration approach.

Issue #4

Removed the experimental module and several unused files; imports from these modules will break.

Issue #5

Renamed modules to singular "module" and moved internal_dspy outside the dspy package; update import statements accordingly.

Issue #6

Moved dsp/metrics into evaluate/metrics; adjust imports to the new location.

Issue #7

Dropped Python 3.9 support; upgrade to Python >=3.10.

Issue #8

Removed dspy.settings related to dspy.Assertion; code relying on these settings must be updated.

Migration Steps

  1. 1
    Update imports: replace any `dspy.Program` usage with the new class or module as per the updated docs.
  2. 2
    Adjust code that calls `evaluate` to handle the new output interface.
  3. 3
    Remove references to the deprecated `Hyperparameter` class and adopt the new configuration pattern.
  4. 4
    Update import paths for moved modules, e.g., import from `evaluate.metrics` instead of `dsp.metrics` and from `module` instead of the old module names.
  5. 5
    Modify imports that referenced `internal_dspy` now located outside the `dspy` package.
  6. 6
    Remove or replace any usage of the experimental module and deleted settings related to `dspy.Assertion`.
  7. 7
    If using the StreamListener, ensure you reuse it according to the new API.

Release Summary

DSPy 3.0.0b2 introduces new LM providers, async adapters, and extensive cleanup, but also removes several legacy APIs and drops Python 3.9 support, requiring code updates.

Need More Details?

View the full release notes and all changes for DSPy 3.0.0b2.

View Full Changelog