Migrating to DSPy 3.1.0
Version 3.1.0 introduces 1 breaking change. This guide details how to update your code.
Released: 1/6/2026
1
Breaking Changes
5
Migration Steps
11
Affected Symbols
⚠️ Check Your Code
If you use any of these symbols, you need to read this guide:
dspy.settings.configuredspy.settings.contextChatAdapterdspy.Filedspy.Reasoningload_memory_cacheExample.toDictXMLAdapterdspy.evaluateToolCall.executegepaBreaking Changes
●Issue #1
The settings API was renamed: dspy.settings.configure and dspy.settings.context have been removed and replaced by dspy.configure and dspy.context. Update imports and calls accordingly.
Migration Steps
- 1Replace any usage of dspy.settings.configure and dspy.settings.context with dspy.configure and dspy.context.
- 2If you relied on automatic loading of .pkl files via load_memory_cache, pass the new explicit flag (e.g., load_memory_cache(..., allow_pickle=False)) or adjust your code accordingly.
- 3Upgrade GEPA dependency to version >=0.0.22 to match the updated requirements.
- 4Ensure your environment uses Python 3.10+ (Python 3.14 is now supported) if you want to take advantage of new features.
- 5Review any custom stream listener implementations to confirm they handle arbitrary data types.
Release Summary
DSPy 3.1.0 officially releases the beta, adding new adapters, file handling, reasoning support, Python 3.14 compatibility, and several optimizer and security enhancements, while fixing numerous bugs and renaming the settings API.
Need More Details?
View the full release notes and all changes for DSPy 3.1.0.
View Full Changelog