Change8

3.0.0

Breaking Changes
📦 dspyView on GitHub →
4 breaking13 features🐛 7 fixes3 deprecations🔧 23 symbols

Summary

DSPy 3.0 introduces powerful new optimizers, extensible adapters and types, async execution, and native MLflow 3.0 observability, while removing community retrievers, dropping Python 3.9 support, and cleaning up legacy APIs.

⚠️ Breaking Changes

  • Community retriever integrations have been removed (see #8073). Migrate to custom code or use Tool/MCP integrations.
  • Support for Python 3.9 has been dropped; only Python 3.10–3.13 are supported.
  • The alias `dspy.Program` has been removed. Replace any usage with the actual program class or refactor code accordingly.
  • Legacy modules `functional/` and `dsp/` clients, as well as old cache implementations, have been removed.

Migration Steps

  1. Remove any usage of community retriever integrations and replace them with custom retriever code or Tool/MCP integrations.
  2. Replace `dspy.Program` references with the concrete program class or refactor to the new API.
  3. Update imports from the removed `functional/` and `dsp/` client modules to the new locations or equivalents.
  4. Rename `BaseType` to `Type` in all type annotations and imports.
  5. Review adapter usage for async paths and streaming; adjust code if you relied on the previous streaming implementation.
  6. If you used legacy cache APIs, switch to the new configurable cache system.
  7. Verify optimizer configurations; `MIPROv2` now selects hyperparameters automatically.

✨ New Features

  • Built-in adapters: `dspy.ChatAdapter`, `dspy.JSONAdapter`, `dspy.XMLAdapter`, and `dspy.BAMLAdapter` with token/status streaming, async paths, and fallback to native LLM structured outputs.
  • New multimodal types: `dspy.Image`, `dspy.Audio`, composite types (e.g., `list[dspy.Image]`), Pydantic model support, and higher-level I/O types `dspy.History` and `dspy.ToolCalls`.
  • `dspy.Adapter` and `dspy.Type` provide extensibility without prompt plumbing.
  • Integration with MCP servers and LangChain tools out-of-the-box.
  • `Module.batch` added for thread-safe batch execution; native async support and high-concurrency configurable caches.
  • Status and output streaming from any layer, usage tracking, per-module history, and rich callbacks for improved developer experience.
  • Stable save/load of programs and ability to export the prompt management layer via adapters.
  • New/updated modules: `dspy.CodeAct`, `dspy.Refine`, improved `ReAct`, and a more reliable `PythonInterpreter`.
  • Native observability integration with MLflow 3.0 (tracing, optimizer tracking, deployment flows).
  • Optimizers: enhanced `MIPROv2` with automatic hyperparameter selection, new RL optimizer `dspy.GRPO` (via Arbor), `dspy.SIMBA` for feedback-driven optimization, and the genetic-Pareto optimizer `dspy.GEPA`.
  • `dspy.syncify` added to run optimizers on async DSPy programs.
  • Windows support for `MIPROv2` and faster image JSON parsing.
  • Mark `gpt-5` as a reasoning model and vendor a lighter internal hasher.

🐛 Bug Fixes

  • Reliability fixes for `MIPROv2` optimizer.
  • Updated Arbor integration for `GRPO`.
  • Streaming end-marker implementation to correctly terminate streams.
  • Performance improvements in image JSON parsing.
  • Error-message and quality-of-life updates across adapters.
  • Windows compatibility fixes for `MIPROv2`.
  • General clean-ups and removal of dead code.

🔧 Affected Symbols

dspy.ChatAdapterdspy.JSONAdapterdspy.XMLAdapterdspy.BAMLAdapterdspy.Imagedspy.Audiodspy.Historydspy.ToolCallsdspy.Adapterdspy.Typedspy.BaseTypedspy.ProgramModule.batchdspy.CodeActdspy.Refinedspy.ReActdspy.PythonInterpreterdspy.MIPROv2dspy.GRPOdspy.SIMBAdspy.GEPAdspy.syncifydspy.Code

⚡ Deprecations

  • Old `functional/` and `dsp/` client APIs are deprecated and have been removed.
  • `BaseType` has been renamed to `Type`; the old name is deprecated.
  • Legacy caches, examples, and tests have been deprecated.