NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI
PyPI, #1725 most downloaded on PyPI
The framework for programming—rather than prompting—language models.
Latest stable
3.5.0
Last release 12 days ago
10 Nov 2026
Release timing varies
gaps range from 2 weeks to 2 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
4 versions withdrawn
withdrawn after publishing
3 years old
112 releases · first in 2024
Drag across the ruler to compare, or tap a release to open it.
This release changes prompts, defaults and APIs. Read the upgrade guide for breaking changes, migration steps and compatibility limits, and re-evaluat…
DSPy 3.5 brings a lighter LM layer, graduated core modules, and new History and image capabilities for RLM.
This release changes prompts, defaults and APIs. Read the upgrade guide for breaking changes, migration steps and compatibility limits, and re-evaluate optimized programs.
dspy.RLM, dspy.Flex and dspy.GEPA are no longer experimental.
ReActV2 is now simply dspy.ReAct, with structured History and a typed submit tool; the old name is deprecated until 3.6.
Tools can return images, files and other DSPy content parts on supported provider routes.
RLM can save and reload conversation History for later calls; it does not restore live interpreter variables.
LiteLLM and OpenAI’s Python library are now optional: DSPy calls supported providers through the lightweight lm15 engine.
| Measured default install | 3.3.0 | 3.5 development snapshot |
|---|---|---|
| Installed package files, including bytecode | 206.7 MiB | 30.9 MiB |
| Dependencies, excluding DSPy | 65 | 25 |
| Fresh-process import, best of ten | 1.01 s | 0.49 s |
model_type="auto" is the default, rather than explicitly selecting chat or responses.
XMLAdapter now formats and parses predictor calls by default, changing prompts and the output contract even when your Signature stays the same.
Prefer native reasoning; request an explicit plan when planning before acting helps the task or it needs a human-auditable plan.
Restricted loading is now the default, and plain NumPy arrays are stored without pickle.
RLM can crop images with Pillow and send mixed text/image subqueries from its Python REPL.
With DSPy imported, an image-capable LM configured and the default Deno runtime available:
rlm = dspy.RLM("photo: dspy.Image, question: str -> answer: str")
result = rlm(photo=dspy.Image.from_path("photo.png"), question="What is written on the smallest sign?")
print(result.answer)
Prewarmed Interpreters
Real DSPy now runs inside RLM and Flex interpreters, with a precompiled standard library, cached startup snapshots and InterpreterPool for prewarming.
| Measured path | 3.4.1 | 3.5 development snapshot |
|---|---|---|
| Cached Deno startup + first execution | 1.59 s | 0.45 s |
| DummyLM Flex forward | 1.61 s | 0.63 s |
| Flex with a ready size-one pool | — | 0.10 s |
Medians of nine fresh processes per path, with prepared runtime caches; pool readiness costs another 0.55 s, excluded from the pooled forward. First-use preparation can be slower.
All 99 PRs in the verified range appear once in the list below. Earlier intermediate bundled-lm15 and metadata updates are included for completeness; the cutoff contains bundled lm15 2.2.0 and metadata sourced from released LiteLLM 1.108.3.
Thank you to @Aditya17-bot, @Blacksujit, @dbreunig, @divakantpandey, @emme1t, @fredheir, @isaacbmiller, @kausthubhk, @michaelisaac-dev, @SaiMouli3, @shaikn6, @shi-felix, @tomron, @Virtuoso461, @Zhuoxi2000, @Zsanz3, @mannuch and @MaximeRivest. Automation contributions: @dependabot and @github-actions.
Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.4.1...471b3fb0e4efad45dbac980e42b1258f55a245cf
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Breaking change for sandbox backend authors. The shim constants and helper that dspy.predict.flex.bridge exposed now live in dspy.primitives.facade, w…
DSPy 3.4.1 makes GEPA's structured InstructionProposer the default instruction proposer and lets dspy.RLM build DSPy sub-agents from inside its REPL. It also adds Python 3.15 support, fixes a 3.4.0 import crash, and includes streaming, adapter, and interpreter fixes.
pip install --upgrade "dspy==3.4.1"
Upgrade notices. GEPA's default reflection request changes shape, so optimization results can differ from 3.4.0 even with the same seed. The reflection LM must now be a dspy.LM that can return JSON. Every RLM prompt now includes a sub-agent section, and max_llm_calls now also counts sub-agent LM calls. dspy.ReActV2 signatures can no longer declare inputs named history or tools. Programs saved on 3.4.0 with a null Score level no longer load. See API and Compatibility Changes.
The 3.5 LM-interface cutoff announced in 3.4.0 still applies. Legacy forward()/aforward() custom LMs, the legacy-engine wrappers, custom complete_legacy() shortcuts, and OpenAI-style messages= calls are deprecated and will be removed in 3.5. lm("hello") stays supported.
InstructionProposer Is GEPA's Default Proposer — @dbreunigdspy.GEPA now builds InstructionProposer() when you don't pass instruction_proposer=. The old default formatted reflective examples into one raw prompt and pulled the new instruction out of backticks. The new one calls the reflection LM through dspy.Predict with a JSONAdapter. Reflective examples stay structured, so dspy.History inputs, tool trajectories, and dspy.Type values such as dspy.Image (including nested images) reach the reflection LM as structured content instead of text placeholders. GEPA's reflection instructions are unchanged.
You can configure the proposer directly:
import dspy
from dspy.teleprompt.gepa import InstructionProposer
optimizer = dspy.GEPA(
metric=metric,
reflection_lm=dspy.LM("openai/gpt-5"),
instruction_proposer=InstructionProposer(
skills=["./skills/prompt-engineering"],
additional_instructions="Write instructions in imperative voice.",
max_chars=1500,
truncate_history_outputs=True,
),
auto="medium",
)
skills: reference material for the reflection LM. Pass a path, a directory containing SKILL.md, an inline string, or a list of these. YAML frontmatter is parsed at construction.additional_instructions: extra guidance applied to every proposal.base_instructions: replaces the reflection prompt but keeps its input and output fields.max_chars: a hard character limit. A draft that is too long gets one compression attempt; DSPy never truncates an instruction.truncate_history_outputs: shortens long tool and REPL outputs inside history inputs before rendering, without changing the originals.adapter: the adapter used for proposal calls. The default is JSONAdapter().Custom instruction_proposer functions receive the same reflective dataset as before, and MultiModalInstructionProposer remains available.
This release also fixes reflection inputs that contain a value pydantic can't serialize, such as a numpy.int64 from a pandas row. That value now renders as str(value) in place, instead of turning every example into a Python repr.
PRs: #10555; follow-up fix #10634 by @isaacbmiller
Code that dspy.RLM writes can now import dspy and build sub-agents for subtasks that need structured inputs and outputs, tools, or their own recursion:
dspy.Predict and dspy.ChainOfThoughtdspy.ReActV2, using the tools you gave the RLMdspy.RLM, which runs on the same interpreter backend as its parentSub-agents are built and run on the host. Only JSON crosses the interpreter boundary.
There is no new API to adopt; this is on for every RLM:
import dspy
rlm = dspy.RLM(
"logs, question -> answer",
sub_lm=dspy.LM("openai/gpt-4o-mini"), # used by llm_query and sub-agents
max_llm_calls=30, # one budget for both
)
Inside the REPL, the model can now write code like this:
import dspy
triage = dspy.ChainOfThought("log_chunk -> errors")
errors = [triage(log_chunk=chunk).errors for chunk in chunks]
max_llm_calls covers llm_query, llm_query_batched, and every sub-agent LM call. Each requested completion uses one slot, so n can't multiply it. Sub-agents use sub_lm, or dspy.settings.lm when it isn't set.temperature, max_tokens, response_format, reasoning effort, tool settings, and caching options. Sandboxed code can't set model, api_base, api_key, or headers.PythonInterpreter and process-isolated interpreters such as LocalInterpreter host sub-agents. If an interpreter can't run the sub-agent shim and raises CodeExecutionError or SyntaxError, RLM logs a warning and runs that call without sub-agents. A RestrictedPython-based interpreter is one example.exec() in the host process also host sub-agents. DSPy binds the facade in that interpreter's namespace and leaves the host's dspy module in place. These interpreters isolate nothing, so the call budget and LM-option restrictions only bind well-behaved code. Use them only for trusted code.dspy.Flex uses the same facade for its bridged predictors. Flex now also works with in-process interpreters you choose, without replacing the host's dspy module.
PRs: #10478; follow-up fixes #10625 and #10627 by @isaacbmiller
reflection_lm must be a dspy.LM or another dspy.BaseLM. In 3.4.0, GEPA called reflection_lm(prompt) directly, so a plain function happened to work. Now every proposal made with a plain function fails, and the program stays unoptimized. Wrap a custom endpoint in dspy.LM, using a custom engine= if needed.dspy.teleprompt.gepa.gepa_utils no longer re-exports InstructionProposalSignature. Import it from gepa.strategies.instruction_proposal instead.pyyaml>=6.0.1 is a new dependency.PRs: #10555
max_llm_calls. An RLM that uses sub-agents reaches the limit sooner; raise it if needed.dspy, or a tool named dspy or starting with _dspy or __dspy, now raises ValueError.execute() before the first iteration. Scripted or fake interpreters used in tests receive that shim as their first execute() call. Recognize it by comparing against dspy.primitives.facade.SHIM_SETUP.CodeExecutionError or SyntaxError while running the shim aborts the RLM call. Raise CodeExecutionError for code your interpreter can't run. A follow-up will make RLM tolerate these interpreters when no sub-agent is used.dspy.primitives.facadeBreaking change for sandbox backend authors. The shim constants and helper that dspy.predict.flex.bridge exposed now live in dspy.primitives.facade, which dspy.Flex and dspy.RLM share. The old module doesn't re-export them, so importing any of these names from dspy.predict.flex.bridge raises ImportError: SHIM_SETUP, CONSTRUCT_TOOL, CALL_TOOL, BRIDGEABLE_KINDS, SIGNATURE_MARKER, TOOL_MARKER, prediction_to_fields.
# Before (3.4.0)
from dspy.predict.flex.bridge import BRIDGEABLE_KINDS, CALL_TOOL, CONSTRUCT_TOOL, SHIM_SETUP
# After (3.4.1)
from dspy.primitives.facade import BRIDGEABLE_KINDS, CALL_TOOL, CONSTRUCT_TOOL, SHIM_SETUP
The marker and tool-name constants keep their values. The private shim file moved from dspy/predict/flex/_sandbox_shim.py to dspy/primitives/_facade_shim.py, so dspy.predict.flex._sandbox_shim no longer imports. Read the shim through SHIM_SETUP. Code that only constructs and runs dspy.Flex programs is unaffected.
PR: #10478
Score Level Descriptions Are RejectedEach Score level description must be a string, an object, or an array. DSPy 3.4.0 accepted null; 3.4.1 rejects it before any request is made:
Score[None, "Disruptive", "Blocking"] raises ValueError: Score level descriptions cannot be null. when the signature class is defined.predictor.set_criteria(name, [None, ...]) raises ValueError.Programs saved on 3.4.0 with a null Score level no longer load. program.load(path) raises ValueError: Invalid criteria for '<name>': must match the declared decision type and options. The message doesn't mention null. Whole-program saves (save_program=True) still load with dspy.load(), but raise the same error the first time the predictor runs or is saved.
To fix a saved JSON program, replace each null in the field's criteria list with a description. Alternatively, delete the criteria key so the field falls back to the levels declared in the signature:
"fields": {
"severity": {
- "criteria": [null, "Disruptive", {"what": "Blocking"}]
+ "criteria": ["Minor", "Disruptive", {"what": "Blocking"}]
}
}
For a whole-program save, call predictor.set_criteria(name, [...]) without null entries after dspy.load(), then save again.
PR: #10538
DSPy's bundled model-metadata snapshot moved from LiteLLM 1.102.1 to 1.105.0. Upstream added 803 entries and removed 264. Of those, 234 had passed their provider deprecation dates and 30 were renamed or retired.
Offline setups lose capability flags for some still-routable models. DSPy uses the bundled snapshot only when it can't use LiteLLM's live map: offline, when the fetch fails, or with LITELLM_LOCAL_MODEL_COST_MAP=true. In those setups, models whose entries were removed no longer report tool-calling, structured-output, or reasoning support. Examples are anthropic/claude-3-7-sonnet-20250219, gemini/gemini-2.0-flash, xai/grok-4, and groq/llama-3.3-70b-versatile. DSPy changes these requests without a warning:
JSONAdapter stops requesting structured outputs and falls back to JSON mode or prompt-only JSON.dspy.Reasoning no longer turns on native reasoning for models that lost the flag.Online, 3.4.0 and 3.4.1 behave the same for these models, because LiteLLM's live map has dropped the same entries.
Family fallback rules are now provider-scoped. A capability rule that names its providers now fills missing flags only for those providers' entries. As a result, gemini/deep-research-preview-04-2026, gemini/deep-research-max-preview-04-2026, and gemini/deep-research-pro-preview-12-2025 no longer inherit supports_reasoning from the OpenAI deep-research rule.
What to do:
lm.supports_response_schema and lm.supports_function_calling after upgrading.LITELLM_MODEL_COST_MAP_URL at a metadata file that still contains its entry, and unset LITELLM_LOCAL_MODEL_COST_MAP. The file replaces the whole map, so it must cover every model you use.PRs: #10517, #10539, #10598, #10624
requires-python = ">=3.10, <3.16").litellm and gepa are not installed, because both declare requires-python <3.15. LM calls run on the bundled native engine, and routes that need the LiteLLM fallback are unavailable there. dspy.GEPA raises ImportError on 3.15 until gepa supports it.jsonschema>=4.0.0 is now a direct dependency.PR: #10521
main_requestHistory replay now passes main_request= to format_user_message_content, so each historical turn keeps the output-format reminder from the original request. A custom adapter that overrides format_user_message_content without a main_request parameter raises TypeError when it formats dspy.History. Add main_request: bool = False to your override. TwoStepAdapter has been updated.
history and tools Input Namesdspy.ReActV2 signatures can no longer declare input fields named history or tools; the constructor raises ValueError. ReActV2 supplies both itself: history is its structured run history, and tools is the tool list you pass to the constructor.
If your signature declares history: dspy.History, for example a chat agent that carries earlier turns, remove the field and keep passing history= when you call the agent. ReActV2 already used that argument to seed the run, so behavior is unchanged:
# Before (3.4.0)
agent = dspy.ReActV2("history: dspy.History, question -> answer", tools=[lookup_order])
# After (3.4.1)
agent = dspy.ReActV2("question -> answer", tools=[lookup_order])
result = agent(question=question, history=history) # the call is unchanged
If your signature uses history or tools for your own data, for example history: str holding a ticket transcript, rename the field. In 3.4.0, ReActV2 replaced such fields with its own, and calls failed with a validation error or TypeError.
Tools are fixed when the agent is constructed. Passing tools= at call time has no effect.
PR: #10464
X | Y Annotations Render Like typing.UnionOn Python 3.10–3.13, adapters now describe a field annotated int | None as Union[int, NoneType] instead of UnionType[int, NoneType]. This matches how Optional[int] already rendered and how Python 3.14 renders int | None. Parsing is unchanged, but prompts for signatures that use | unions differ from 3.4.0, so cached LM responses and recorded prompts from 3.4.0 won't match.
PR: #10575
dspy.Tool stores argument defaults in JSON form: an Enum becomes its value, Decimal a float, datetime and date ISO strings, Path a string, tuples and sets lists, and pydantic models and dataclasses dicts. Tool schemas with such defaults previously failed to serialize for native function calling. The tool still receives its original Python default when the argument is omitted. #10574ImportError: cannot import name 'BaseModel' from partially initialized module 'openai._models', which could occur when DSPy lazily imported LiteLLM, for example through dspy.LM(...).supports_function_calling. #10520dspy.History turns keep their output-format reminders, so each turn's prompt is a prefix of the next one for prompt caching. #10554str(item), instead of the whole value becoming a Python repr. This applies to all adapters. #10634BetterTogether raises a ValueError that names the student predictors without an LM. 3.4.0 failed later with AttributeError: 'NoneType' object has no attribute 'launch'. Call student.set_lm(lm); dspy.configure(lm=...) alone is not enough. #10569forward no longer walks the whole call stack to decide whether to warn. #10534InstructionProposer GEPA's default instruction proposer by @dbreunig (#10555).BetterTogether student predictors have no LM by @adityashirsatrao007 (#10569).history or tools by @chenlichao (#10464).SyntaxError by @isaacbmiller (#10625).dspy by @isaacbmiller (#10627).main_request in TwoStepAdapter.format_user_message_content by @isaacbmiller (#10628).serialize_for_json by @isaacbmiller (#10634).Score level descriptions by @ilia-iliev (#10538).bool but returned something else by @Aryan-Kochhar (#10408).typing.Union in prompts by @kayzenline (#10575).forward guard by @isaacbmiller (#10534).Noul, Score, Choice, ReAnchor) by @zamal-db (#10510).from_dict_list docstring parameter name by @simpleqt (#10415).ngrams docstring parameter name by @simpleqt (#10417).llms.txt by @thomasht86 (#10576).Thank you to @adityashirsatrao007, @Aryan-Kochhar, @atharva-mashalkar, @chenlichao, @dbreunig, @ilia-iliev, @isaacbmiller, @jayhemnani9910, @jayzuccarelli, @kayzenline, @michaelisaac-dev, @migurski, @simpleqt, @thomasht86, @zamal-db, and @zh-hanlabs for contributing to this release. Dependency and version updates were automated by Dependabot and GitHub Actions.
Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.4.0...3.4.1
Breaking change: override the runtime in rlm(...) and rlm.acall(...) with the keyword-only interpreter_factory= option, supplying a zero-argument fact…
DSPy 3.4 introduces Jev integration through TypeSafe, with three experimental decision types—Noul, Choice, and Score—that bring probability evidence into ordinary DSPy signatures. ReAnchor calibrates those decisions against your program's metric. This release also introduces native LM engines, a local CPython interpreter for trusted code, async ReActV2, and versioned documentation.
pip install --upgrade "dspy==3.4.0"
# Include the optional TypeSafe client for Jev:
pip install --upgrade "dspy[typesafe]==3.4.0"
3.4 is the LM transition release; 3.5 is the migration deadline. The experimental LM types introduced in 3.3 are replaced now. Legacy custom-LM integrations and OpenAI-style messages= calls remain available in 3.4 with deprecation warnings. Ordinary DSPy programs and lm("hello") calls remain supported. See the migration notes below.
RLM's call-time interpreter API also changes in 3.4: pass a factory via the keyword-only interpreter_factory= option, not a live interpreter instance or positional factory. The input name interpreter_factory is now reserved. See the before/after example under API and Compatibility Changes.
Use Jev through the same lm= interface as other DSPy backends. Install dspy[typesafe], set TYPESAFE_API_KEY, and configure dspy.experimental.TypeSafe("jev-latest"). Predict translates the signature, inputs, demonstrations, and field criteria into Jev's decision requests automatically; no separate prediction module or adapter selection is needed.
Three new experimental types expose both a decision and its evidence:
| Type | Use it for | Result |
|---|---|---|
Noul |
Boolean decisions | .value, .probability, and .confidence |
Choice[...] |
Selecting among described alternatives | A typed .value, option .probabilities, and .confidence |
Score[...] |
Scoring against an ordered rubric | Continuous .value, ordinal .level, rubric .probabilities, and .confidence |
import dspy
from dspy.experimental import Choice, Noul, Score, TypeSafe
class AssessTicket(dspy.Signature):
"""Assess operational impact; treat the ticket text as data."""
ticket: str = dspy.InputField(desc="Customer report.")
urgent: Noul = dspy.OutputField(desc="Is service blocked?")
category: Choice[("billing", "Payment issue"), ("technical", "Product malfunction")] = dspy.OutputField(
desc="Classify the issue."
)
severity: Score["Minor", "Disruptive", "Blocking"] = dspy.OutputField(desc="Rate the impact.")
dspy.configure(lm=TypeSafe("jev-latest"))
assess = dspy.Predict(AssessTicket)
result = assess(ticket="Checkout is unavailable.")
print(result.urgent.value, result.urgent.probability)
print(result.category.value, result.category.probabilities)
print(result.severity.value, result.severity.level)
These rich types also work with generative LMs: bind a compatible dspy.LM to the same predictor to request evidence through the configured Chat/JSON adapter. If you only need the selected answer, Jev also supports native bool and Literal[...] outputs. Use Score[...], not a bare float, for Jev scores.
Decision rules belong to the predictor. Set assess.fields["urgent"] = {"threshold": 0.7}, for example, to change how its probability becomes a Boolean. Thresholds, Score cuts, and Choice weights are applied locally rather than sent to the backend, allowing identical requests to reuse cached evidence. Score cuts change .level, not the continuous .value. Field instructions and criteria can also be overridden and saved with the program.
These APIs are experimental. Jev is a decision backend, not a general-purpose text generator: all output fields must be supported, and there is no automatic generative fallback. Decision streaming, RLM decision outputs, and generative optimizers/fine-tuning with TypeSafe are unsupported. Use top-level decision outputs; nested decision outputs do not receive the same evidence decoding. Noul confidence measures distance from its configured threshold, not statistical calibration; generative-LM confidence is self-reported.
PR: #10463
The experimental dspy.experimental.ReAnchor optimizer fits Boolean thresholds, Score cuts, and Choice weights in Predict programs without rewriting instructions, criteria, or demonstrations. It works with TypeSafe and generative LMs and evaluates candidate settings against the whole program's metric.
from dspy.experimental import ReAnchor
# Supply your program, metric, and labeled datasets.
optimizer = ReAnchor(metric=metric)
tuned = optimizer.compile(program, trainset=trainset, valset=valset)
print(optimizer.report)
tuned.save("tuned.json")
A setting must improve the training score and pass a held-out fold check. Optional valset data is scored for the report but never used to fit settings. compile() returns a copy, leaving the original program unchanged; fitted settings use ordinary program save/load.
On generative LMs, ReAnchor can request probability evidence for native bool and Literal outputs while preserving their Python return types. It keeps that change only when calibration beats the original native-output behavior under the same fold check.
Caching is required by default. It avoids repeating identical requests, but changed upstream decisions and native-output promotion can still cause new backend calls. ReAnchor does not guarantee a fixed inference budget. RLM decision outputs are unsupported, and single-option Choice calibration currently raises an error.
PR: #10475
DSPy's LM layer now uses bundled lm15 request, response, and streaming types, available through dspy.lm15 without a separate installation. The default engine="auto" prefers native execution for supported routes and representable inputs; eligible compatibility fallbacks select LiteLLM before inference. Authentication failures, timeouts, and provider errors never trigger a backend switch.
Use engine="lm15" to require native execution or engine="litellm" to select the compatibility backend explicitly. LiteLLM remains installed and supported.
For an OpenAI- or Anthropic-compatible HTTP service, dspy.lm15.register_provider(...) lets you declare its endpoint, authentication, and capabilities rather than write a custom engine. Each LM binds the registrations present at construction. Supported LiteLLM fallbacks preserve the declared endpoint and credentials; unsupported fallback authentication or explicit compatibility refusals raise rather than silently changing the connection or dropping settings.
For other backends, implement complete(Request) -> Response and supply engine=; provide an async_engine= for async execution. DSPy owns caching, managed retries, callbacks, history, and usage accounting. Custom engines remain caller-owned.
Since the beta, native execution honors supported timeout= values, history records provider adaptations, rate-limit details survive public error wrapping, and dead-event-loop pools are released. Structured-output schemas derived from Pydantic models follow OpenAI's strict-schema requirements. Single failures under streamify propagate as their original exceptions; groups containing multiple failures remain groups.
See the LM migration guide and custom-engine tutorial.
PRs: #10359, #10366, #10371, #10409, #10440, #10441, #10442, #10451, #10469 (latest vendor sync and integration fixes by @isaacbmiller).
dspy.LocalInterpreter runs generated Python in a persistent subprocess using the current Python executable. It provides ordinary CPython compatibility without Deno and works with RLM and Flex. State and imports persist within an interpreter session; the usual factory lifecycle still creates a fresh interpreter for each module invocation.
import dspy
rlm = dspy.RLM(
"question: str -> answer: int",
interpreter_factory=dspy.LocalInterpreter,
)
It supports sync and async host tools, typed SUBMIT, interpreter callbacks, and execution timeouts. Host-tool cancellation and interrupts propagate and shut down stranded workers. An execution timeout terminates the worker, but cannot forcibly stop an already-running host callable.
LocalInterpreter is not a security sandbox. Generated code retains the host user's filesystem, environment, credentials, subprocess, and network access. Use the default PythonInterpreter or an appropriately isolated remote interpreter for untrusted code. The default has not changed.
You can also replace the default interpreter factory through dspy.configure(interpreter_factory=...); explicitly supplied non-default factories retain precedence.
PRs: #10238, #10379, #10383 (global factory configuration by @adriaanm).
Experimental ReActV2 supports await agent.acall(...), including async prediction, async tools, and final submission. Tools execute sequentially; this does not add parallel execution or automatically offload blocking synchronous tools. Invalid or missing final submission raises instead of returning an incomplete prediction. See the MCP guide for an async client/server example.
dspy.GEPA accepts code_proposer= for custom Flex source proposals, complementing instruction_proposer=. Its trace-capture evaluation also keeps failed examples aligned with their scores and outputs instead of shifting or dropping results, addressing the issue noted in the 3.3.1 release.
PRs: #10355, #10356 by @isaacbmiller; #10212, #10305 by @dbreunig.
Material for MkDocs entered maintenance mode with an announced end-of-life date of November 5, 2026. That prompted us to migrate DSPy's Current documentation to Zensical, its actively developed successor, so we can keep maintaining and improving the documentation on a supported platform. The maintainers have since announced an extension of critical maintenance through May 5, 2027.
PR: #10316.
Separately, we added versioned documentation alongside the migration. You can now select documentation for a specific DSPy release instead of relying only on Current, which tracks ongoing development. Historical release snapshots remain available in the version picker.
New tagged releases publish a matching documentation snapshot after successful package publication, using the exact release wheel for API introspection. Stable releases advance their minor-version alias; prereleases keep their own versioned path without taking over that alias.
Breaking change: override the runtime in rlm(...) and rlm.acall(...) with the keyword-only interpreter_factory= option, supplying a zero-argument factory. Live interpreter instances and positional factory overrides are rejected with TypeError; caller-owned session reuse across RLM invocations is no longer supported.
rlm(interpreter=) was introduced in 3.3.0
# Before: supply a live interpreter that the caller owns.
with dspy.PythonInterpreter() as interpreter:
result = rlm(interpreter, query=query)
# After: supply a factory by keyword to create a fresh interpreter.
result = rlm(query=query, interpreter_factory=dspy.PythonInterpreter)
The async equivalent is await rlm.acall(query=query, interpreter_factory=dspy.PythonInterpreter). For a custom runtime, pass its class or another zero-argument callable that returns a fresh CodeInterpreter each time—not a lambda returning a shared instance.
RLM creates one interpreter per invocation, retains it across that invocation's iterations, and shuts it down on success, failure, or async cancellation. The selected factory also supplies the invocation's runtime prompt guidance without mutating shared predictor instructions.
The call-time factory takes precedence over constructor and context/global settings, including an explicit call-time dspy.PythonInterpreter. The constructor's interpreter_factory= API and default PythonInterpreter remain unchanged; context/global configuration still replaces the default when no call-time override is supplied.
Rename any RLM signature input named interpreter_factory. That name is now reserved for runtime configuration; declaring it as a signature input raises ValueError when constructing RLM.
This change applies to RLM only. CodeAct and ProgramOfThought retain their existing call-time APIs.
PR: #10493 by @isaacbmiller.
The old dspy.LMRequest, dspy.LMResponse, and related experimental exports are removed. Importing dspy.core.types raises a migration error, and forward_contract="typed_lm" is rejected. These are replacements, not aliases:
| Experimental 3.3 API | 3.4 replacement |
|---|---|
dspy.LMRequest, dspy.LMResponse |
dspy.lm15.Request, dspy.lm15.Response |
dspy.LMMessage, dspy.LMConfig |
dspy.lm15.Message, dspy.lm15.Config |
dspy.System(text) |
Request(system=text, ...) |
dspy.User(text), dspy.Assistant(text) |
Message.user(text), Message.assistant(text) |
response.outputs[0].parts |
response.message.parts |
The new types are frozen dataclasses rather than Pydantic models, with different validation and shapes. Old pickles containing removed experimental classes are not automatically migrated; load and export them in their original environment first. Ordinary provider-response cache compatibility is separate and remains supported.
experimental=True no longer makes ordinary prompt calls return typed responses. Use an explicit request:
import dspy
from dspy.lm15 import Config, Message, Request
lm = dspy.LM("azure/your-deployment")
# Before: OpenAI-style messages, with a list result (deprecated).
outputs = lm(messages=[{"role": "user", "content": "What is DSPy?"}])
# After: a typed request and response.
response = lm(Request(
model=lm.model,
system="Be concise.",
messages=(Message.user("What is DSPy?"),),
config=Config(max_tokens=200),
))
print(response.text)
Use your configured provider/deployment and credentials. An explicit request's model must match the LM; put generation options in Config, since LM generation defaults are not added. Config.cache controls provider-side prompt caching, not DSPy's response cache. DSPy's signature types—such as Image, Audio, File, Tool, ToolCalls, and History—and public LM error classes remain supported.
The following still execute in 3.4 but emit DeprecationWarning and are scheduled for removal in 3.5:
lm(messages=[...]) calls, including SDK message objects. Use explicit requests as above.BaseLM.forward() and aforward() integrations. Implement the engine interface.LegacyEngine, AsyncLegacyEngine, and custom complete_legacy() shortcuts. These are transition tools, not permanent escape hatches.lm("hello") stays supported and list-returning in 3.5. Built-in adapters still use an internal dictionary/list boundary in 3.4; their canonical request/response migration is scheduled for 3.5. Custom adapters must not rely on the removed dspy.clients.openai_format module.
A minimal replacement for a custom legacy LM is:
import dspy
from dspy.lm15 import Message, Response, Usage
class EchoEngine:
def complete(self, request):
return Response(
id=None,
model=request.model,
message=Message.assistant("hello"),
finish_reason="stop",
usage=Usage(),
)
lm = dspy.LM("custom/echo", engine=EchoEngine())
print(lm("hello"))
Enable migration warnings during development with python -W default::DeprecationWarning your_program.py. See the 3.5 cutoff.
n answers use separate sequential requests, potentially billing input tokens more than once. Use engine="litellm" for that backend's native n behavior.api_key, api_base, timeout, and related client settings on the engine itself; DSPy rejects them on LM construction, copying, and calls with custom engines. copy(engine=...) replaces the sync/async engine pair.dump_state()/load_state() implementations to save and restore. Restoring them requires allow_unsafe_lm_state=True; only enable it for trusted state.httpx.Timeout component set to None selects LiteLLM under auto or raises under forced lm15, rather than silently substituting a finite timeout.typesafe extra requires typesafe-sdk>=0.6.0,<1.0.0; it is not added to the base installation.history or termination_reason; rename those fields to avoid metadata collisions.ValueError, even with async/sync conversion enabled. Use await tool.acall(...).streamify unwraps a single nested task-group failure; multiple failures remain grouped.Evaluate rejects empty development sets with a descriptive ValueError.Noul, Choice, and Score types and the optional TypeSafe/Jev client by @isaacbmiller (#10463).Retry-After across bundled lm15 async and auxiliary calls by @MaximeRivest (#10371).interpreter_factory= and reserve that input name by @isaacbmiller (#10493).code_proposer hook by @dbreunig (#10212).tool_choice when no tools are sent to the LM by @NithilanVishvanath (#10399).max_iters default by @ellacroix (#10013).Thank you to @adriaanm, @asparagus, @chuenchen309, @dbreunig, @ellacroix, @he-yufeng, @iam-kira, @iamsharduld, @isaacbmiller, @kiteretsu903, @Kymi808, @MaximeRivest, @michaelisaac-dev, @nikolauspschuetz, @NishchayMahor, @NithilanVishvanath, @roli-lpci, @simpleqt, @spjosyula, @tjdharamsi, and @ymxlx.
Automation contributions were made by @dependabot and @github-actions.
Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.3.1...3.4.0
Use engine="lm15" to require native execution and reject unsupported mappings. LiteLLM remains installed and supported; it is not deprecated.
DSPy 3.4.0b1 is the first beta of 3.4. It moves language-model execution to a shared engine interface, adds a local CPython interpreter for trusted code, and brings async execution to ReActV2. It also adds custom Flex code proposals in GEPA and fixes evaluation, streaming, and demonstration-sampling bugs.
This is a prerelease, not the stable 3.4.0 release. APIs and behavior may change before stable. We especially welcome feedback on native versus LiteLLM compatibility, tool calling and streaming, custom LM migration, saved programs, and multi-answer latency and costs. Please include your engine selection and a minimal reproduction when reporting issues.
Install this beta explicitly:
pip install --upgrade "dspy==3.4.0b1"
3.4 is the LM transition release; 3.5 is the migration deadline. Ordinary DSPy programs and list-returning prompt calls remain supported, but the experimental LM types introduced in 3.3 are replaced in this release. Review the compatibility notes if you use those types, implement a custom LM, pass OpenAI-style messages directly to an LM, or request multiple answers with n.
DSPy's LM layer now uses the lm15 request, response, and streaming types bundled with DSPy. Import them from dspy.lm15; no separate lm15 installation is needed.
The default engine="auto" prefers native lm15 execution for supported routes and representable inputs. Unsupported routes, client settings, and ordinary provider-specific inputs that cannot be represented faithfully select LiteLLM before execution. Authentication failures, timeouts, and provider errors do not trigger a switch to another backend.
import dspy
# Prefer native execution where supported; select compatibility where needed.
lm = dspy.LM("openai/gpt-4o-mini")
# Explicitly retain the LiteLLM compatibility backend.
compat_lm = dspy.LM("openai/gpt-4o-mini", engine="litellm")
Use engine="lm15" to require native execution and reject unsupported mappings. LiteLLM remains installed and supported; it is not deprecated.
Custom backends can now implement complete(Request) -> Response instead of subclassing BaseLM and returning provider-shaped objects:
from dspy.lm15 import Message, Response, Usage
class EchoEngine:
def complete(self, request):
return Response(
id=None,
model=request.model,
message=Message.assistant("hello"),
finish_reason="stop",
usage=Usage(),
)
lm = dspy.LM("custom/echo", engine=EchoEngine())
Supply async_engine= for async calls and implement canonical streaming events when needed. DSPy owns response caching, managed retries, callbacks, history, and usage accounting. Custom engines are caller-owned and are not closed by DSPy.
Ordinary calls retain their existing cache-key format and can read existing SDK-response cache entries. New native cache entries contain plain serialized data and support restricted deserialization; explicit typed requests use a separate cache namespace. Existing dspy.streamify listeners remain supported.
See the LM migration guide and custom-engine tutorial.
dspy.LocalInterpreter runs generated Python in a persistent local CPython subprocess, using the current Python executable. It provides ordinary Python compatibility without Deno, while separating the worker's memory, stdout, and lifecycle from the DSPy process.
rlm = dspy.RLM(
"question: str -> answer: int",
interpreter_factory=dspy.LocalInterpreter,
)
State and imports persist within an interpreter session. LocalInterpreter supports JSON-compatible inputs and tool results, sync and async host tools, typed SUBMIT, interpreter callbacks, and execution timeouts. It works with both RLM and Flex. The usual factory lifecycle still creates a fresh interpreter for each module invocation.
LocalInterpreter is not a security sandbox. Generated code retains the host user's filesystem, environment, credentials, subprocess, and network access. Use the default PythonInterpreter or a remote sandbox for untrusted code; the default has not changed.
execution_timeout includes host-tool time and terminates the worker when exceeded. It cannot forcibly stop a running host callable; that callable may finish later, but its result is discarded. Guest threads must finish before an execution returns, or the interpreter session becomes terminal.
Host-tool cancellation and interrupts propagate to the caller and shut down the stranded worker, including when no execution timeout is configured. They no longer leave execution waiting indefinitely for a worker reply. Ordinary tool errors remain recoverable.
The experimental dspy.ReActV2 now supports await agent.acall(...), including async prediction, async tools, and forced final submission. This enables async MCP tools to run through the agent's structured tool-call history, preserving call IDs and tool results across turns.
Tools execute sequentially on the async path. This does not add parallel tool execution or automatically offload blocking synchronous tools.
ReActV2 also no longer returns an incomplete Prediction when final submission fails. Missing or invalid submission raises ValueError; parse and context-window failures from the forced submission propagate. Successful predictions continue to include declared outputs, history, and a termination reason.
The MCP guide includes an async ReActV2 client/server example.
dspy.GEPA now accepts code_proposer=, complementing instruction_proposer=. Custom proposers receive the selected Flex code components, candidate source, reflective examples, task descriptions, and context blurbs, and return replacement module source for each component.
This lets applications customize code-generation constraints and domain guidance without monkeypatching the built-in proposer. The built-in proposer remains the default, and programs without Flex components are unaffected.
GEPA's trace-capture evaluation also keeps outputs and scores aligned with the input batch when a program crashes on an example. Failed examples receive failure_score rather than disappearing and causing an indexing error or shifting later results. This addresses the missing/misaligned validation-results issue noted in the 3.3.1 release; it does not require an upstream GEPA upgrade.
The old dspy.LMRequest, dspy.LMResponse, and related experimental exports are removed. Importing dspy.core.types raises a migration error, and forward_contract="typed_lm" is rejected. These are replacements, not aliases:
| Experimental 3.3 API | 3.4 replacement |
|---|---|
dspy.LMRequest, dspy.LMResponse |
dspy.lm15.Request, dspy.lm15.Response |
dspy.LMMessage, dspy.LMConfig |
dspy.lm15.Message, dspy.lm15.Config |
dspy.System(text) |
Request(system=text, ...) |
dspy.User(text), dspy.Assistant(text) |
Message.user(text), Message.assistant(text) |
response.outputs[0].parts |
response.message.parts |
The new types are frozen dataclasses, not Pydantic models, and their validation and data shapes differ. Old pickles containing removed experimental classes are not automatically migrated; load and export them in their original environment first. Ordinary provider-response caches are a separate compatibility path and remain readable.
experimental=True no longer changes ordinary LM calls into typed responses. Ordinary prompt calls return lists; explicit requests return a Response:
from dspy.lm15 import Config, Message, Request
lm = dspy.LM("openai/gpt-4o-mini")
response = lm(Request(
model=lm.model,
system="Be concise.",
messages=(Message.user("What is DSPy?"),),
config=Config(max_tokens=200),
))
print(response.text)
An explicit request's model must match the LM. Set generation options in its Config; LM generation defaults are not added. Config.cache controls provider-side prompt caching, not DSPy's response cache.
DSPy's signature types, including Image, Audio, File, Tool, ToolCalls, and History, are not removed. Existing public DSPy LM error classes remain supported.
The following still execute in 3.4 but emit DeprecationWarning:
lm(messages=[...]) calls, including provider SDK message objects. Migrate to explicit lm15 requests.BaseLM.forward() and aforward() integrations. Migrate to the engine interface.LegacyEngine, AsyncLegacyEngine, and custom complete_legacy() shortcuts. These are transition tools, not permanent compatibility interfaces.lm("hello") remains a list-returning convenience in 3.5. Built-in adapters still use an internal dictionary/list boundary in 3.4; their canonical request/response migration is scheduled for 3.5. Custom adapters must not depend on the removed dspy.clients.openai_format module.
To reveal deprecation warnings during development:
python -W default::DeprecationWarning your_program.py
n answers use separate sequential requests. This can increase latency and bill input tokens more than once compared with a provider-native multi-answer request. Choose engine="litellm" to retain that backend's native n behavior.PRs for the LM changes above: #10366, #10371
history or termination_reason, which collide with its prediction metadata. Rename those outputs. #9852ValueError, even with allow_tool_async_sync_conversion enabled. Use await tool.acall(...). #10146Evaluate rejects an empty development set with a descriptive ValueError instead of failing with ZeroDivisionError. #9978Retry-After across bundled lm15 async and auxiliary calls by @MaximeRivest (#10371).Example hashing order-insensitive to match equality by @Kymi808 (#9858).Example by @iamsharduld (#9946).code_proposer hook by @dbreunig (#10212).Literal members during parsing by @spjosyula (#10010).Unbatchify instead of resetting the full timeout on every queue read by @chuenchen309 (#10038).Literal members in BAMLAdapter schemas by @nikolauspschuetz (#10074).max_iters default by @ellacroix (#10013).denoland/setup-deno from 2.0.4 to 2.0.5 by @dependabot (#10288).astral-sh/setup-uv from 8.2.0 to 10.0.1 by @dependabot (#10289).pypa/gh-action-pypi-publish from 1.14.0 to 1.14.2 by @dependabot (#10290).actions/setup-python from 6.2.0 to 7.0.0 by @dependabot (#10291).orjson from 3.11.9 to 3.12.0 by @dependabot (#10292).zizmorcore/zizmor-action from 0.5.7 to 0.6.2 by @dependabot (#10293).json-repair from 0.63.0 to 0.63.3 by @dependabot (#10295).Thank you to @chuenchen309, @dbreunig, @ellacroix, @he-yufeng, @iamsharduld, @isaacbmiller, @Kymi808, @MaximeRivest, @michaelisaac-dev, @nikolauspschuetz, @NishchayMahor, @roli-lpci, @spjosyula, @tjdharamsi, and @ymxlx for contributing to this release.
Automation contributions were made by @dependabot and @github-actions.
Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.3.1...3.4.0b1
dspy.CodeAct and dspy.ProgramOfThought now emit DeprecationWarning when constructed. They are scheduled for removal in DSPy 3.5; use dspy.RLM for new…
DSPy 3.3.1 contains many interpreter fixes and improvements. It makes PythonInterpreter
easier to install, substantially strengthens sandbox isolation and request
handling, and adds end-to-end visibility into interpreter execution. The release
also improves optimizer throughput, adapter correctness, and MCP compatibility.
PythonInterpreter now has an optional managed runtime installation:
pip install "dspy[deno]"
DSPy prefers that managed binary when present, while continuing to support
system Deno 2.x and an explicit custom deno_command. The default path pins
Pyodide, validates Deno >=2.0.0,<3.0.0, and ignores ambient Node and Deno
project configuration so nearby application files cannot change sandbox startup.
The interpreter also closes several execution-integrity and isolation gaps:
DSPy's callback API now exposes the complete interpreter lifecycle:
Events retain callback ancestry across modules, interpreters, tools, and LM
calls. End callbacks receive terminating BaseException values such as
cancellation and interruption instead of incorrectly reporting those operations
as successful. Optimizer compile() runs receive the same start/end coverage.
PythonInterpreter.execution_instructions now gives RLM an accurate description
of the Pyodide environment, including state persistence and unavailable native
process capabilities. This helps generated code use the sandbox correctly.
NoneType annotations serialize correctly across the
sandbox boundary.CodeInterpreterError is now a DSPyError while retaining its existing
RuntimeError compatibility.PRs: #10119, #10120, #10134, #10135, #10136, #10186, #10190, #10194, #10205, #10206, #10208, and #10255
DSPy now uses GEPA 0.1.4 and supports its multi-proposal sampling, selection,
acceptance, tracking, and checkpoint-state contracts through gepa_kwargs.
DSPy's adapter saves and restores its random-number-generator state, making
resumed proposal sampling consistent with uninterrupted optimization.
When a sampling strategy produces multiple candidates, DSPy can evaluate those
candidates concurrently. Candidate-level and example-level concurrency share the
existing num_threads budget rather than multiplying it. For example, four
candidates evaluated with num_threads=8 receive two example workers each; total
DSPy-controlled concurrency remains eight.
import dspy
from gepa.strategies.proposal_sampling import IndependentSampling
from gepa.strategies.proposal_selection import BestImprovement
optimizer = dspy.GEPA(
metric=metric,
max_metric_calls=2_000,
reflection_lm=dspy.LM("openai/gpt-5", temperature=1.0, max_tokens=32_000),
num_threads=8,
gepa_kwargs={
"sampling_strategy": IndependentSampling(4),
"selection_strategy": BestImprovement(),
"acceptance_criterion": "strict_improvement",
},
)
The default single-proposal strategy retains its previous execution shape.
max_reflection_cost is not yet supported by DSPy's GEPA adapter and now raises
clearly when set instead of silently providing an ineffective budget.
Metrics can also report named objective_scores and select an objective-aware
frontier through gepa_kwargs. Objective, hybrid, and cartesian frontiers let
GEPA use dimensions such as quality, privacy, or cost when selecting parents and
merges, while the scalar metric continues to gate acceptance and select the final
program. Tracked results expose aggregate objective scores, best candidates per
objective, and each objective's independently achieved maximum.
GEPA 0.1.4 has a known upstream limitation: it requests traces while evaluating accepted candidates on the full validation set. For programs whose traced and ordinary evaluation paths differ after a runtime failure, this can cause missing or misaligned validation results. The upstream correction is targeted for GEPA 0.1.5.
When an LM omits an output field with a declared default, default factory, or
None-allowing annotation, ChatAdapter, JSONAdapter, XMLAdapter, and adapters
built on them now apply the declared fallback. Missing required outputs continue
to raise AdapterParseError.
This also prevents adapter fallback merely because a provider omitted a native optional output.
XMLAdapter now formats and parses nested Pydantic models, typed dictionaries, lists, mappings, nullable fields, and unions as nested XML. It continues to accept the previous JSON-inside-an-outer-XML-field representation for backward compatibility.
DSPy's MCP bridge supports both MCP SDK v1 and v2 field names, v1
ClientSession, and the v2 high-level Client. The default tool-result semantics
are unchanged: historical text and non-text content remains authoritative rather
than being replaced by v2 structured content.
Applications can now opt into machine-readable MCP results:
tool = dspy.Tool.from_mcp_tool(client, mcp_tool, result_mode="structured")
Structured mode returns structuredContent exactly when the server supplies it,
including arrays, scalar values, empty values, and explicit JSON null. It falls
back to the existing content conversion when structured content is absent. DSPy
does not infer, parse, or unwrap the returned value.
dspy.CodeAct and dspy.ProgramOfThought now emit DeprecationWarning when
constructed. They are scheduled for removal in DSPy 3.5; use dspy.RLM for new
code.
PR: #10198
Image.from_url() and Audio.from_url() now default to a 30-second request
timeout instead of potentially waiting forever:
image = dspy.Image.from_url(url, timeout=60)
audio = dspy.Audio.from_url(url, timeout=60)
Pass timeout=None to retain the previous unbounded behavior.
PR: #10149
CodeInterpreterError is now also a DSPyError while retaining
RuntimeError compatibility. ReAct preserves ContextWindowExceededError after
trajectory truncation is exhausted, and LM-facing execution errors now use one
consistent formatter.
PRs: #10134, #10132, #10135, #10139
ParallelExecutor correctly treats a completed task returning None as
complete. #10142COPRO.compile(..., eval_kwargs=None) now matches its documented optional
contract. #10087Dataset.reset_seeds() now honors valid zero-valued sizes and seeds.
#9906COPRO.compile's eval_kwargs optional by @katherineahn
(#10087).BaseException values to callback end handlers by
@isaacbmiller (#10194).None results in ParallelExecutor by @isaacbmiller
(#10142).CodeInterpreterError under DSPyError while retaining
RuntimeError compatibility by @isaacbmiller
(#10134).CodeAct and ProgramOfThought in favor of RLM by @isaacbmiller
(#10198).PythonInterpreter-backed RLMs by
@isaacbmiller (#10255).Dataset.reset_seeds by @alvinttang
(#9906).Client by @isaacbmiller
(#10249).Thank you to @alvinttang, @daleselaji-dev, @immu4989, @isaacbmiller, @katherineahn, @michaelisaac-dev, @saime428, and @yzxcj797 for contributing to this release.
Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.3.0...3.3.1
Pydantic payloads containing download or verify are rejected without fetching. The deprecated direct developer call Image(url, download=True) remains…
DSPy 3.3.0 is a feature release with a new experimental way to optimize programs as code, a native-tool-aware ReAct implementation, and the next stage of DSPy's move toward a typed, provider-neutral language-model system.
Most existing DSPy programs should keep working without changes. Review the API changes if you construct Image, Audio, or File values from paths or URLs; use NumPy-backed features from the base install; inspect detailed GEPA results; construct code interpreters directly; use RLM(max_iterations=...); consume raw Responses API tool-call outputs; or catch provider-specific LM exceptions.
We would especially appreciate feedback on Flex, ReActV2, and the typed LM path. These APIs expand what DSPy can optimize and how it can connect to model providers, and real-world usage will help shape their next iterations.
Most DSPy modules fix the shape of a program up front: Predict makes one prediction, ReAct runs a tool loop, and RLM runs a code interpreter in a loop. Optimizers can improve the instructions around that structure, but the structure itself stays fixed. The new experimental dspy.Flex moves the implementation into the search space so GEPA can discover the decomposition instead.
Give Flex the same signature you would give Predict and it starts with the simplest working baseline: one dspy.Predict, or one dspy.RLM when tools are supplied. During compilation, GEPA can rewrite the complete module implementation—changing the predictors, control flow, DSPy primitives, and balance between Python and LM calls—against your metric.
program = dspy.Flex("question -> answer")
optimized = dspy.GEPA(metric=metric, reflection_lm=reflection_lm).compile(
program,
trainset=trainset,
valset=valset,
)
print(optimized.module_src)
Optimizer-authored source always runs in a CodeInterpreter sandbox, using dspy.PythonInterpreter by default. Predictor construction and LM calls bridge back to the host, broken candidates score as failures instead of crashing the search, and max_predictor_calls guards against runaway generated programs. Metrics can also accept a program_trace to score how a result was produced—for example, penalizing programs that make too many LM calls.
The optimized module_src is part of the program's serialized state, so saving and loading preserves the implementation GEPA discovered. Flex is experimental, and ordinary GEPA behavior is unchanged when a program does not contain a Flex module.
PR: #10047
dspy.ReActV2 is a new version of ReAct built around native tool calling. It is currently marked as experimental.
The signature now uses dspy.History, dspy.Tool, and dspy.ToolCalls(which can now optionally store dspy.ToolCallResults), rather than the custom next_tool_args and custom trajectory syntax. Using dspy.History also means that messages are now broken up into user/assistant/tool groups rather than one long user message with the trajectory.
This changes the execution model in a few concrete ways:
parallel_tool_calls support: DSPy preserves each call/result pair by ID. You can do this in native mode or in non-native modeMulti-turn native tool call support: Prior tool calls and results can be replayed as assistant and tool messages instead of being flattened into prompt text.dspy.History as structured messages rather than one ever-growing trajectory string, so providers with prompt caching can reuse stable prefixes more effectively. We have seen up to 50% decreases in cost for some tasks when testing this internally.ReActV2 converts callables to dspy.Tool, adds an internal submit tool for final outputs, handles unknown tools and tool exceptions, accepts serialized history input, and can force final submission when the model does not call submit.
PRs: #9823, #9824, #9825, #9835
DSPy is moving from an untyped LM boundary based on prompt, messages, and provider-shaped kwargs toward a typed, provider-neutral contract:
def forward(self, request: dspy.LMRequest) -> dspy.LMResponse:
...
The resulting API is a cleaner LM extension point:
LMRequest -> LMResponse path instead of guessing which OpenAI/LiteLLM-shaped inputs will arrive.Most users do not need to change anything in 3.3. Existing lm(...), modules, and programs keep their current behavior by default.
Try out the typed return path with dspy.context(experimental=True), and the public migration plan explains the staged transition for custom LM and adapter authors.
PRs: #9786, #9802, #9828
BaseLM now owns shared runtime state and supports sanitized state serialization through dump_state() and load_state(). Serialized LM state excludes API keys, preserves legacy saved states, and requires explicit opt-in before importing trusted custom LM classes.
Saved programs with custom LMs are easier to reason about, LM copies isolate DSPy-owned mutable state, and callers can catch dspy.LMError or a narrower DSPy subclass instead of depending on provider-specific exception classes. LiteLLM imports are lazy, which keeps the core LM API less coupled to a specific provider bridge at import time.
PRs: #9752, #9820, #9821, #9826
Since the beta, DSPy has added an explicit BaseLM.forward() contract, exported the typed LM API, supported typed direct calls through BaseLM.__call__, made optional-provider imports thread-safe, and fixed LM state round trips for GPT-5 models.
The OpenAI Responses path now emits Responses-native tool and tool_choice request shapes. Legacy Responses outputs use the same Chat-style tool-call representation as the Chat Completions path, while typed LMToolCallPart objects preserve raw provider fields.
PRs: #9837, #9840, #9841, #9843, #9877, #9999, #10003, #10014, #10026, #10028
Constructing or validating dspy.Image, dspy.Audio, and dspy.File values no longer interprets locator-shaped strings as instructions to read a local file or fetch a remote URL. This prevents LM-output parsing, Pydantic validation, and deserialization from silently granting filesystem or network access merely because a value resembles a path or URL.
Resource loading now requires an explicit factory:
| Before 3.3 | DSPy 3.3 | Behavior |
|---|---|---|
Image(path) or Image(url=path) |
Image.from_path(path) |
Read and embed a local image |
Image(url, download=True) |
Image.from_url(url) |
Download and embed a remote image |
Image.from_url(url) or Image.from_url(url, download=False) |
Image(url) or Image(url=url) |
Keep a non-downloading provider-fetched URL reference |
Audio(path) |
Audio.from_path(path) |
Read and embed local audio |
Audio(url) |
Audio.from_url(url) |
Download and embed remote audio |
File(path) |
File.from_path(path) |
Read and embed a local file |
encode_image(path) |
Image.from_path(path) |
Explicitly read a local image |
encode_audio(path_or_url) |
Audio.from_path(path) or Audio.from_url(url) |
Explicitly load audio |
encode_file_to_dict(path) |
File.from_path(path) |
Explicitly read a local file |
There are several related compatibility changes:
Image.from_url() now downloads the resource and returns an embedded data URI. Use Image(url) when the model provider should fetch the reference instead.Image.from_url(..., download=...) and the download_images / verify options on encode_image() were removed. Choose reference construction or an explicit factory instead.download or verify are rejected without fetching. The deprecated direct developer call Image(url, download=True) remains available with a warning through 3.3.Image(url, download=True). Validation-style calls such as Image(url=url, download=True) are rejected.Image.from_file(), Image.from_PIL(), and Audio.from_file() remain as deprecated aliases through 3.3 and are scheduled for removal in 3.4. Use Image.from_path(), Image(pil_image), and Audio.from_path() respectively.The explicit Image.from_url(url, verify=...) and Audio.from_url(url, verify=...) factories still accept TLS certificate verification controls. The removed verify option applies to encode_image().
Image.from_url() and Audio.from_url() make synchronous caller-initiated requests, follow redirects, and do not provide an SSRF allowlist. Applications remain responsible for validating or allowlisting destinations derived from untrusted input.
PR: #10111 by @isaacbmiller
numpy Is Now Optionalnumpy is no longer installed with base dspy. Features that need NumPy now require the numpy extra:
pip install "dspy[numpy]"
Affected areas include embeddings, KNN/KNNFewShot, SIMBA, and other NumPy-backed optimizer or retrieval paths. (#9659 by @isaacbmiller)
gepa[dspy]==0.1.1The upstream GEPA 0.1.1 API changed several result structures, and DspyGEPAResult now mirrors those shapes. Users who inspect optimized_program.detailed_results may need to update code:
DspyGEPAResult.candidates is now a list of compiled DSPy modules, not instruction dictionaries.DspyGEPAResult.best_candidate now returns a compiled DSPy module.val_subscores is now list[dict[Any, float]], keyed by validation instance id.per_val_instance_best_candidates is now dict[Any, set[int]].best_outputs_valset is now dict[Any, list[tuple[int, Prediction]]] when tracked.highest_score_achieved_per_val_task now returns a dictionary keyed by validation instance id.If you pass custom GEPA reflection templates directly, note that GEPA 0.1.1 renamed default placeholders from <curr_instructions> / <inputs_outputs_feedback> to <curr_param> / <side_info>. In dspy.GEPA, passing reflection_prompt_template through gepa_kwargs now raises a clear ValueError; use instruction_proposer for custom proposal behavior instead. (#9673 by @BenMcH)
RLM.max_iterations Is Now RLM.max_itersThe RLM constructor now uses the same max_iters name as other iterative DSPy modules:
# Before
rlm = dspy.RLM("context, query -> answer", max_iterations=10)
# DSPy 3.3
rlm = dspy.RLM("context, query -> answer", max_iters=10)
PR: #9920 by @isaacbmiller
RLM now validates its execution namespace up front. Construction fails for duplicate tool names, Python-keyword tool names, signature inputs that collide with built-in sandbox functions or tools, and output fields named trajectory or final_reasoning. Invocation also rejects unexpected input fields rather than ignoring them. Rename colliding fields or tools before constructing the module.
PR: #10020 by @isaacbmiller
llm_query and llm_query_batched now require the sub-LM to return either a dspy.LMResponse containing text or a non-empty legacy output list whose first item is text. Arbitrary response objects are no longer converted with str(). Batched queries convert dspy.LMError failures to [ERROR] entries, but programming and response-contract errors now propagate.
RLM also invokes user tools through dspy.Tool, so tool argument validation and coercion, default handling, and tool callbacks now apply.
PRs: #10023, #10025 by @isaacbmiller
ProgramOfThought, CodeAct, and RLM now accept interpreter_factory=, a zero-argument callable that creates a fresh CodeInterpreter for each invocation. This isolates concurrent calls and makes interpreter ownership explicit.
program = dspy.ProgramOfThought(
"question -> answer",
interpreter_factory=MyInterpreter,
)
To use an existing interpreter, pass it as the first positional argument when invoking the module. DSPy does not shut down a caller-owned interpreter, and reuse is supported only for sequential calls to the same module instance.
These modules no longer expose a constructor-owned interpreter attribute or preserve its sandbox state across calls. Without a caller-owned interpreter, each invocation creates and shuts down a fresh interpreter. Interpreter process and protocol failures are terminal for that interpreter session rather than automatically restarting it, and submitted-code failures now raise CodeExecutionError, a subclass of CodeInterpreterError.
PRs: #10018, #10022 by @isaacbmiller
ToolCalls Uses DSPy's Native Serialized Shapedspy.ToolCalls.format() and Pydantic serialization now represent each call as {"name": ..., "args": ...} rather than the prior OpenAI-style {"type": "function", "function": {"name": ..., "arguments": ...}} shape. Code that persists ToolCalls, calls .format() directly, or forwards the result to an OpenAI-compatible endpoint must update its conversion logic. Provider adapters still produce the wire shape required by their APIs.
PR: #9823 by @isaacbmiller
BaseLM Defaults and Copy Semantics ChangedThe direct BaseLM constructor now defaults temperature and max_tokens to None instead of 0.0 and 1000. This primarily affects custom LM subclasses that inherit or delegate to BaseLM.__init__; ordinary dspy.LM already used the provider-default None values.
BaseLM.copy() now shallow-copies subclass-owned attributes while separately copying DSPy-owned mutable runtime containers. Custom LM subclasses that relied on arbitrary mutable attributes being deep-copied should override copy() or copy that state explicitly.
PR: #9821 by @MaximeRivest
Legacy output from dspy.LM(..., model_type="responses") now represents tool calls in the same shape as the Chat Completions path:
{
"type": "function",
"id": call_id,
"function": {
"name": tool_name,
"arguments": arguments,
},
}
The text key is now always present. Raw Responses item IDs, status, and provider fields remain available through LMToolCallPart.provider_data on the typed path.
PR: #10028 by @isaacbmiller
LM failures are now mapped into DSPy exception classes. This should make LM error handling more consistent, but code that catches provider-specific or LiteLLM-specific errors directly may need to catch dspy.LMError or a narrower DSPy subclass. (#9826 by @MaximeRivest)
ChatAdapter and JSONAdapter no longer retry with an alternate output format after an LMError; provider and transport failures propagate directly. TwoStepAdapter now raises dspy.AdapterParseError rather than ValueError for local extraction or parsing failures, while extraction-LM failures propagate as dspy.LMError.
LMRequest, LMResponse, typed message/content classes, tool specifications, reasoning and cache configuration, usage records, history entries, and streaming types. (#9786, #9841, #9877 by @MaximeRivest)forward_contract = "typed_lm" and an explicit BaseLM.forward(request) -> LMResponse contract for new custom LM implementations. (#9843, #9877 by @MaximeRivest)Signature.append_instructions() for deriving a signature with additional instructions without mutating the original. (#9923 by @mathurk1)dspy.Flex and trace-aware GEPA metrics through the optional sixth program_trace parameter. (#10047 by @michaelisaac-dev)dspy.ReActV2, structured native tool-call history, and tool-result replay. (#9823, #9824, #9825, #9836 by @isaacbmiller)from_path() and from_url() resource-loading factories for Image and Audio, plus File.from_path(), while keeping construction and validation free of implicit host I/O. (#10111 by @isaacbmiller)BaseLM own and serialize shared runtime state. copy() now makes a shallow object copy, resets history, and separately copies the callbacks list and kwargs dictionary. (#9820, #9821 by @MaximeRivest)dspy.Tool. (#10020, #10023, #10025 by @isaacbmiller)load_state() transactional, isolated BootstrapFinetune data by predictor, validated random-search restrictions up front, and preserved callback lineage in parallel workers. (#9741 by @ashishSoni1234, #10005 and #10043 by @isaacbmiller, #10033 by @chuenchen309)asyncer, xxhash, or typeguard; DSPy now uses AnyIO and standard-library equivalents. (#9733, #9734, #9735 by @isaacbmiller)dspy.utils.hasher.Hasher now uses SHA-256 instead of xxhash64. Hash strings, hash-derived fine-tuning filenames, and deterministic bootstrap trace selection may change; LM response-cache keys are unaffected. (#9734 by @isaacbmiller)Module.set_lm(), get_lm(), and state loading now include module-valued parameter leaves such as Flex, rather than only Predict. Custom classes that combine Module and Parameter should expose compatible LM state and accept allow_unsafe_lm_state= when overriding load_state(). (#10047 by @michaelisaac-dev)BaseLM state serialization — @MaximeRivestBaseLM own shared LM runtime state — @MaximeRivestBaseLM.forward() contract — @MaximeRivestBaseLM.__call__ support typed LMRequest and LMResponse while preserving the legacy default — @MaximeRivesttool_choice shapes — @isaacbmillerSandboxSerializable for custom RLM types — @kmad--allow-read paths — @npowPythonInterpreter — @Archelunchinspect_history() — @isaacbmillerdspy.RLM — @dbreunigmax_iterations to max_iters — @isaacbmillerinf, -inf, and nan as valid Python literals — @Vinay152003dspy.Tool — @isaacbmillerReAct.truncate_trajectory() from emptying a single-tool-call trajectory — @chuenchen309DspyGEPAResult for GEPA 0.1.1 — @BenMcHValueError when no valid program is found — @Ricardo-M-Lload_state() transactional — @ashishSoni1234Signature.append_instructions() — @mathurk1dspy.Flex and its GEPA extension — @michaelisaac-devb16d109 — Fix the FAQ Learn-guide link — @cosmopolitan033dspy.OpenAI references — @FBISiriChainOfThought and BestOfN — @katherineahnactions/setup-python from 3.1.4 to 6.2.0 — @dependabotsecurity-events permission for SARIF uploads — @isaacbmillergit-auto-commit-action from the release workflow — @isaacbmillerzizmor-action from 0.5.3 to 0.5.5 — @dependabotzizmor-action from 0.5.5 to 0.5.6 — @dependabotactions/checkout from 6.0.2 to 6.0.3 — @dependabotastral-sh/setup-uv from 8.1.0 to 8.2.0 — @dependabotmkdocstrings-python from 1.16.7 to 2.0.3 — @dependabottypeguard from 4.4.3 to 4.5.1 — @dependabotanyio from 4.9.0 to 4.13.0 — @dependabottenacity from 9.1.2 to 9.1.4 — @dependabotcachetools from 6.1.0 to 7.0.6 — @dependabotasyncer and use AnyIO directly — @isaacbmillerxxhash with hashlib.sha256 — @isaacbmillertypeguard with standard-library type checking — @isaacbmillercachetools from 7.0.6 to 7.1.1 — @dependabotmistune from 3.2.0 to 3.2.1 — @dependabotweaviate-client from 4.5.7 to 4.21.0 — @dependaboturllib3 from 1.26.6 to 2.7.0 — @dependabotmistune from 3.2.0 to 3.2.1 — @dependabotanthropic from 0.89.0 to 0.102.0 — @dependabotregex from 2025.11.3 to 2026.5.9 — @dependabotmistune from 3.2.1 to 3.3.3 — @dependabotmkdocstrings from 1.0.4 to 1.0.6 — @dependabotThank you to everyone who contributed to DSPy 3.3.0:
Automation contributions were made by @dependabot and @github-actions.
b16d109.Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.2.1...3.3.0
Most existing DSPy programs should keep working without changes. Review the breaking changes if you depend on NumPy from the base dspy install, inspec…
DSPy 3.3.0b1 is a beta release including a new ReActV2 module, a new BaseLM System, updating to GEPA 0.1.1, and fewer dependencies framework wide.
Most existing DSPy programs should keep working without changes. Review the breaking changes if you depend on NumPy from the base dspy install, inspect GEPA result internals, or catch provider-specific LM exceptions directly.
We would really appreciate feedback on ReActV2 and the new LM system! Please try them out and let us know if you run into any issues.
dspy.ReActV2 is a new version of ReAct built around native tool calling. It is currently marked as experimental.
The signature now uses dspy.History, dspy.Tool, and dspy.ToolCalls(which can now optionally store dspy.ToolCallResults), rather than the custom next_tool_args and custom trajectory syntax. Using dspy.History also means that messages are now broken up into user/assistant/tool groups rather than one long user message with the trajectory.
This changes the execution model in a few concrete ways:
parallel_tool_calls support: DSPy preserves each call/result pair by ID. You can do this in native mode or in non-native modeMulti-turn native tool call support: Prior tool calls and results can be replayed as assistant and tool messages instead of being flattened into prompt text.dspy.History as structured messages rather than one ever-growing trajectory string, so providers with prompt caching can reuse stable prefixes more effectively. We have seen up to 50% decreases in cost for some tasks when testing this internally.ReActV2 converts callables to dspy.Tool, adds an internal submit tool for final outputs, handles unknown tools and tool exceptions, accepts serialized history input, and can force final submission when the model does not call submit.
PRs: #9823, #9824, #9825, #9835
DSPy is moving from an untyped LM boundary based on prompt, messages, and provider-shaped kwargs toward a typed, provider-neutral contract:
def forward(self, request: dspy.LMRequest) -> dspy.LMResponse:
...
The resulting API is a cleaner LM extension point:
LMRequest -> LMResponse path instead of guessing which OpenAI/LiteLLM-shaped inputs will arrive.Most users do not need to change anything in 3.3. Existing lm(...), modules, and programs keep their current behavior by default.
Try out the typed return path with dspy.context(experimental=True), and the public migration plan explains the staged transition for custom LM and adapter authors.
PRs: #9786, #9802, #9828
We have been whittling away at dependencies!
The base install is lighter: numpy is now optional via dspy[numpy], and direct dependencies on asyncer, xxhash, and typeguard were removed in favor of standard-library paths.
Users who do not need NumPy-backed retrieval, embeddings, or optimizers get a smaller default install with fewer transitive dependencies. Users who need NumPy-backed features can install dspy[numpy].
PRs: #9659, #9733, #9734, #9735
BaseLM now owns shared runtime state and supports sanitized state serialization through dump_state() and load_state(). Serialized LM state excludes API keys, preserves legacy saved states, and requires explicit opt-in before importing trusted custom LM classes.
Saved programs with custom LMs are easier to reason about, LM copies isolate DSPy-owned mutable state, and callers can catch dspy.LMError or a narrower DSPy subclass instead of depending on provider-specific exception classes. LiteLLM imports are lazy, which keeps the core LM API less coupled to a specific provider bridge at import time.
PRs: #9752, #9820, #9821, #9826
dspy.RLM can now accept custom sandbox-serializable values through SandboxSerializable.
Users can pass richer objects, such as DataFrames, into the sandbox with explicit setup, serialization, assignment, and preview behavior instead of forcing everything through prompt text.
PRs: #9411
DSPy now supports gepa[dspy]==0.1.1, including updated DspyGEPAResult behavior, tests, and docs.
Users can move to the current GEPA DSPy integration in this beta. The breaking changes below call out the result-shape changes for code that inspects detailed GEPA outputs.
PRs: #9673
numpy Is Now Optionalnumpy is no longer installed with base dspy. Features that need NumPy now require the numpy extra:
pip install "dspy[numpy]"
Affected areas include embeddings, KNN/KNNFewShot, SIMBA, and other NumPy-backed optimizer or retrieval paths. (#9659 by @isaacbmiller)
gepa[dspy]==0.1.1The upstream GEPA 0.1.1 API changed several result structures, and DspyGEPAResult now mirrors those shapes. Users who inspect optimized_program.detailed_results may need to update code:
DspyGEPAResult.candidates is now a list of compiled DSPy modules, not instruction dictionaries.DspyGEPAResult.best_candidate now returns a compiled DSPy module.val_subscores is now list[dict[Any, float]], keyed by validation instance id.per_val_instance_best_candidates is now dict[Any, set[int]].best_outputs_valset is now dict[Any, list[tuple[int, Prediction]]] when tracked.highest_score_achieved_per_val_task now returns a dictionary keyed by validation instance id.If you pass custom GEPA reflection templates directly, note that GEPA 0.1.1 renamed default placeholders from <curr_instructions> / <inputs_outputs_feedback> to <curr_param> / <side_info>. In dspy.GEPA, passing reflection_prompt_template through gepa_kwargs now raises a clear ValueError; use instruction_proposer for custom proposal behavior instead. (#9673 by @BenMcH)
LM failures are now mapped into DSPy exception classes. This should make LM error handling more consistent, but code that catches provider-specific or LiteLLM-specific errors directly may need to catch dspy.LMError or a narrower DSPy subclass. (#9826 by @MaximeRivest)
LMRequest and LMResponse internally. (#9802 by @MaximeRivest)__call__ and acall through the normalized LM boundary while converting back to legacy parser inputs for compatibility. (#9802 by @MaximeRivest)BaseLM calls still receive OpenAI/LiteLLM-shaped kwargs. Internally, adapters now move through adapter messages -> LMRequest -> OpenAI/LiteLLM kwargs -> current BaseLM -> LMResponse -> existing adapter postprocess path. (#9802 by @MaximeRivest)BaseLM the owner of shared runtime state and changed BaseLM.copy() to an explicit shallow runtime copy. (#9821 by @MaximeRivest)BaseLM.dump_state() and BaseLM.load_state() support, including trusted custom LM class loading through allow_unsafe_lm_state=True. (#9820 by @MaximeRivest)dspy.LM and adapter fallback behavior. (#9826 by @MaximeRivest)dspy.ReActV2, a native-tool-aware ReAct predictor with dspy.Tool conversion, an internal submit tool, serialized history input support, unknown-tool and tool-exception handling, and forced final submission when needed. (#9825 by @isaacbmiller)parallel_tool_calls, preserving each model-requested call and each observation by call ID. (#9823, #9824, #9825 by @isaacbmiller)trajectory string into structured dspy.History, so native-tool providers can see prior turns as assistant/tool messages and prompt-caching providers can reuse stable prompt prefixes more effectively. (#9824, #9825 by @isaacbmiller)ToolCalls.ToolCall and added ToolCallResults for call IDs, tool names, values, and error flags. (#9823 by @isaacbmiller)inspect_history for assistant messages and LM output records, including provider-style function payloads and tool-call outputs without text. (#9835 by @isaacbmiller)inspect_history and avoid crashing on assistant messages with content=None or output records with tool calls but no text. (#9835 by @isaacbmiller)MockValSer serializers. (#9830 by @isaacbmiller)None, while preserving warnings for genuinely missing required inputs. (#9834 by @isaacbmiller)usage=None from the OpenAI Responses API on truncated responses. (#9718 by @isaacbmiller)load_state transactional by validating before mutating state. (#9741 by @ashishSoni1234)PythonInterpreter. (#9754 by @Archelunch)--allow-read paths in PythonInterpreter. (#9748 by @npow)git-auto-commit-action from the release workflow. (#9746 by @isaacbmiller)actions/setup-python from 3.1.4 to 6.2.0. (#9602 by @dependabot[bot])anyio, cachetools, tenacity, weaviate-client, mistune, and zizmor-action. (#9730, #9731, #9732, #9760, #9759, #9787 by @dependabot[bot])Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.2.1...3.3.0b1
Removed the upper bound on litellm.
litellm. (#9687)dspy.Embedder so per-call caching=False is honored for both sync and async embedding calls. (#9708)twine check and reducing unused workflow permissions. (#9648)setup-node step from the docs push workflow. (#9702)uv.lock for the 3.2.0 release state. (#9650)pytest-asyncio, ruff, pre-commit, datamodel-code-generator, optuna, and urllib3. (#9665, #9664, #9699, #9701, #9697, #9698)mkdocs-llmstxt, mkdocstrings, mistune, and mkdocs-jupyter. (#9661, #9668, #9666, #9700)actions/cache and astral-sh/setup-uv. (#9662, #9663)Deprecation warning for prefix, format, and parser kwargs in InputField/OutputField by @MaximeRivest
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.
@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 litellm dependency. (#9516, #9521, #9522)
Passing a value that doesn't match a signature's declared type now logs a warning (using typeguard). Extra fields not in the signature also warn. Disable with dspy.configure(warn_on_type_mismatch=False). (#9313)
Tool calls now use kwargs-only dispatch, the JS tool bridge returns structured errors instead of throwing (preventing Deno crashes), and stdout parsing skips non-JSON lines instead of crashing. Subprocess restarts now correctly replay tool/mount registration. (#9341, #9351)
We have added an opt-in dspy.configure_cache(restrict_pickle=True) that swaps pickle.load with a restricted unpickler that only allows litellm/openai types, numpy reconstruction helpers, and user-registered safe_types. Prevents arbitrary code execution from corrupted or malicious cache files. (#9629)
In a future release, we will make this restriction the default behavior.
Moved from a required dependency to pip install dspy[optuna]. Saves ~12.7 MB. Only MIPROv2 and BootstrapFewShotWithOptuna use it. (#9397)
Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.1.3...3.2.0
fix(interpreter): Fix enable_read_paths with multiple files by @missing-piece in https://github.com/stanfordnlp/dspy/pull/9256
RLMs
GEPA
Maintenance
Deferred to a later release (added then reverted before cutting this release):
Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.1.2...3.1.3
ci: install Deno in release workflow by @okhat in https://github.com/stanfordnlp/dspy/pull/9217
Maintenance
Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.1.1...3.1.2
This is a 3.1.0 official release. We are making the beta release 3.1.0beta1 official.
This is a 3.1.0 official release. We are making the beta release 3.1.0beta1 official.
Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.0.4...3.1.0b1
This is a pre-release for 3.1.0.
This is a pre-release for 3.1.0.
Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.0.4...3.1.0b1
Deprecate Image from_* helpers in favor of flexible constructor by @isaacbmiller in #8771
3.0.4b2 has been running for a while without seeing issue, so we are making it an official 3.0.4 release.
The release note is the combination of 3.0.4b1 and 3.0.4b2.
ToolCall.execute for smoother tool execution (#8825, @TomeHirata)test_xml_adapter_full_prompt (#8904, @TomeHirata)temperature and max_tokens to None (#8908, @isaacbmiller)task_model and prompt_model (#8877, @isaacbmiller)dspy/primitives/example Example class (#8949, @Davshiv20)Signature.prepend/append/insert/delete (#8945, @gnetsanet)ArborReinforceJob to use urljoin (#8951, @Ziems)ClientSession (#8894, @TomeHirata)Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.0.3...3.0.4
Add ToolCall.execute for smoother tool execution (#8825, @TomeHirata)
Tooling / APIs
ToolCall.execute for smoother tool execution (#8825, @TomeHirata)Networking / Headers
Arbor / RL
Streaming / Buffers
Adapters
test_xml_adapter_full_prompt (#8904, @TomeHirata)Responses / APIs
Core / LM
temperature and max_tokens to None (#8908, @isaacbmiller)MIPRO
task_model and prompt_model (#8877, @isaacbmiller)ArborReinforceJob to use urljoin (#8951, @Ziems)ClientSession (#8894, @TomeHirata)dspy/primitives/example Example class (#8949, @Davshiv20)Signature.prepend/append/insert/delete (#8945, @gnetsanet)Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.0.4b1...3.0.4b2
Deprecate Image from_* helpers in favor of flexible constructor by @isaacbmiller in #8771
Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.0.3...3.0.4b1
Remove deprecated LiteLLM caching from LM by @okhat in https://github.com/stanfordnlp/dspy/pull/8742
New Functionality
rollout_id for bypassing LM cache in a namespaced way by @okhat in https://github.com/stanfordnlp/dspy/pull/8745Optimizers
Maintenance
forward is patched to avoid warning on explicit forward call by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8700Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.0.2...3.0.3
MIPROv2: Warn on deprecated requires_permission_to_run by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/8635
Optimizers
LMs & Adapters
Maintenance
Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.0.1...3.0.2
Fix Evaluate call bug in GEPA by @LakshyAAAgrawal in https://github.com/stanfordnlp/dspy/pull/8647
Optimizers
LMs & Adapters
ConfigDict for config; filter litellm warnings by @kurtmckee in https://github.com/stanfordnlp/dspy/pull/8659dspy.ToolCalls parsing by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8563Maintenance
Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.0.0...3.0.1
Various deprecations promised in 2.5 were applied during the 2.6.0 release candidates (e.g., old functional/, dsp/ clients, legacy caches/examples/tes…
The work in the run up to DSPy 3.0 has focused on new powerful optimizers (RL: dspy.GRPO via our new Arbor library; and reflective prompt evolution: dspy.GEPA and dspy.SIMBA), extensibility (dspy.Adapter & dspy.Type), reliability/observability for production (tight integration with MLflow 3.0), and more. Much of this work incubated during late 2.6 and matured in 3.0.
dspy.ChatAdapter, dspy.JSONAdapter, dspy.XMLAdapter, dspy.BAMLAdapter, token/status streaming, async paths, and intelligent fallback to native LLM structured outputs.dspy.Image and dspy.Audio; composite types (e.g., list[dspy.Image], Pydantic models); higher-level I/O like dspy.History and dspy.ToolCalls. Custom types now “just work” with adapters (dspy.Type).Module.batch with thread-safe DSPy settings; native DSPy async; high-concurrency, configurable caches.dspy.CodeAct, dspy.Refine, improved ReAct, a more reliable PythonInterpreter.Some of the above first landed in late 2.6 (e.g., early streaming, initial adapters/types improvements), and were consolidated/matured in 3.0.
dspy.Program → remove/replace (was cleaned up in 3.0 work).functional/, dsp/ clients, legacy caches/examples/tests).3.0.0b4Optimizers
Maintenance
set-output to $GITHUB_OUTPUT (@kurtmckee, #8557).New contributor
Full Changelog: 3.0.0b4...3.0.0
dspy.Code; PEP 604 unions in signatures; token streaming for XMLAdapter; dspy.syncify for running optimizers on async DSPy programs; Windows support for MIPROv2 confirm; real-LLM unit tests.
New contributors: @LukasMurdock, @ken-dwyer, @grisaitis, @vacmar01, @fswair, @nillwyc, @asad-aali, @niklovescoding, @MaximeRivest, @brenorb.BaseType → Type; remove dspy.Program alias; many cleanups.
New contributors: @codingDuan, @Hangzhi, @poudro.Thank you to everyone who contributed code, docs, reviews, issues, and testing!
🎉 = first-time contributor since 2.6.15
@AkeemMcLennon, @aliirz, @amas0, @apieum 🎉, @arnavsinghvi11, @asad-aali 🎉, @asparagus, @assadyousuf 🎉, @BenMcH 🎉, @bjsi, @brenorb 🎉, @brishin 🎉, @BTripp1986 🎉, @carsonkahn-external 🎉, @cezarc1, @chakravarthik27, @charviupreti 🎉, @chenmoneygithub, @codingDuan 🎉, @CyrusNuevoDia, @danielsparing 🎉, @dbczumar, @dilarasoylu, @dimroc, @Dyadd, @emmanuel-ferdman 🎉, @erandeutsch, @estsauver, @fswair 🎉, @GabeDottl, @glesperance, @grisaitis 🎉, @hmoazam, @Harryllh, @Hangzhi, @hung-phan, @isaacbmiller, @itay1542, @Jdogtherock, @JHMuir, @jjjjw, @jinnovation, @jmho, @jmhb0 🎉, @kanjurer, @kalanyuz, @ken-dwyer 🎉, keyuchen21, @klopsahlong, @koptagel 🎉, @kurtmckee 🎉, @LukasMurdock 🎉, @laitifranz, @LakshyAAAgrawal 🎉, @lxdlam, @MaximeRivest 🎉, @MaxwellSalmon, @Miyamura80 🎉, @myz96, @neilbhutada, @niklovescoding 🎉, @nillwyc 🎉, @okhat, @olesyash 🎉, @poudro 🎉, @prrao87 🎉, @patcher9, @rcanand, @rifolio 🎉, @Samoed, @SanjanShiv 🎉, @srowen 🎉, @Shangyint, @stevapple, @tvdaptible 🎉, @TomeHirata, @tikoehle 🎉, @Timtech4u, @thomasahle, @ulgens, @vakinapalli 🎉, @vacmar01 🎉, @veronicalyu320, @vincentkoc, @weklund 🎉, @willsmithDB, @xinyij-goo 🎉, @yuruofeifei, @Ziems, @zbambergerNLP, @gkorland, @yanmxa, @mikeedjones, @b-d055, @mikeweltevredem, @ItzAmirreza, @GangGreenTemperTatum, @shermansiu, @dmavrommatis, @iPersona, @Krishn1412, @Y-1huadb, @B-Step62, @tkellogg
First-time contributors called out since 2.6.15 (rollup): @rifolio, @charviupreti, @BenMcH, @GangGreenTemperTatum, @koptagel, @Miyamura80, @tikoehle, @srowen, @assadyousuf, @xinyij-goo, @SanjanShiv, @emmanuel-ferdman, @Y-1huadb, @Krishn1412, @BTripp1986, @vincentkoc, @estsauver, @jmho, @JHMuir, @neilbhutada, @carsonkahn-external, @dimroc, @erandeutsch, @willsmithDB, @iPersona, @brishin, @dmavrommatis, @codingDuan, @Hangzhi, @poudro, @LukasMurdock, @ken-dwyer, @grisaitis, @vacmar01, @fswair, @nillwyc, @asad-aali, @niklovescoding, @MaximeRivest, @brenorb, @weklund, @vakinapalli, @tvdaptible, @jmhb0, @olesyash, @kurtmckee, @prrao87, @danielsparing, @apieum, @LakshyAAAgrawal.
2.6.27...3.0.0b1, 3.0.0b1...3.0.0b2, 3.0.0b2...3.0.0b3, 3.0.0b3...3.0.0b4, 3.0.0b4...3.0.0.Fixes for MIPRO: Don't fail silently on bootstrapping! by @okhat in https://github.com/stanfordnlp/dspy/pull/8548
Optimizers
Adapters & Tools
LMs & Modules
Maintenance
typos tool against the codebase by @kurtmckee in https://github.com/stanfordnlp/dspy/pull/8560build-system requirements by @kurtmckee in https://github.com/stanfordnlp/dspy/pull/8558Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.0.0b3...3.0.0b4
Key bugfix: The removal of datasets from the default dependencies in 3.0.0b1 meant that if the user didn't have datasets installed, the bootstrapping
Key bugfix: The removal of datasets from the default dependencies in 3.0.0b1 meant that if the user didn't have datasets installed, the bootstrapping of MIPROv2 would fail silently, leading to worse optimization. Added datasets back in commit 8aa065945.
Signatures, Adapters, & Types
Modules
dspy.syncify so that users can run optimizer on async dspy programs by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8509Other
Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.0.0b2...3.0.0b3
Remove dspy.Program alias by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/8392
Modules & Adapters
Bug Fixes
QoL
Style
Maintenance
Documentation
Full Changelog: https://github.com/stanfordnlp/dspy/compare/3.0.0b1...3.0.0b2
A cleaner release note to follow. The only breaking change to be aware of in 3.0 is just #8073 for unmaintained retriever integration (should affect a…
A cleaner release note to follow. The only breaking change to be aware of in 3.0 is just #8073 for unmaintained retriever integration (should affect almost no one, and easy to migrate to custom code for those affected).
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.27...3.0.0b1
Fix BaseType annotation parsing by @okhat in https://github.com/stanfordnlp/dspy/pull/8318
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.26...2.6.27
Fix BaseType annotation parsing by @okhat in https://github.com/stanfordnlp/dspy/pull/8318
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.26...2.6.27a1
Support dspy.Tool as input field type and dspy.ToolCall as output field type by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8242
dspy.Tool as input field type and dspy.ToolCall as output field type by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8242Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.25...2.6.26
Provide a standard base class for creating custom Signature field type by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8217
Core
Modules
Misc
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.24...2.6.25
Make it easier to do sync streaming by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8183
Core
Adapters
Modules
Optimizers
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.23...2.6.24
Support streaming in async DSPy program by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8144
Core
Optimizers
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.22...2.6.23
Fix cache thread unsafety by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8133
Core
Adapters & Modules
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.21...2.6.22
Make Adapters' parse_value and Cache's request_cache more permissive by @okhat in https://github.com/stanfordnlp/dspy/pull/8132
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.20...2.6.21
Native async support for callbacks and dspy.Tool by @chenmoneygithub @TomeHirata in https://github.com/stanfordnlp/dspy/pull/8105, https://github.com/
Core Library
dspy.Tool by @chenmoneygithub @TomeHirata in https://github.com/stanfordnlp/dspy/pull/8105, https://github.com/stanfordnlp/dspy/pull/8110, https://github.com/stanfordnlp/dspy/pull/8106Modules
dspy.Tool.from_mcp_tool by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/8130Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.19...2.6.20
Fix Pydantic Deprecation warning by @Miyamura80 in https://github.com/stanfordnlp/dspy/pull/8087
General
Adapters
Modules
dspy.Tool by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8095Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.18...2.6.19
Move num_threads into global settings by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/8071
General
Adapters & Modules
Optimizers
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.17...2.6.18
Refactor DSPy adapters to make it more extensible by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/7996
Adapters
Optimizers
LMs
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.16...2.6.17
Fix the numpy dependency and re-support Python 3.9 by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/8013, https://github.com/stanfordnl
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.15...2.6.16
Release experimental dspy.SIMBA optimizer and a corresponding Tool-Use Tutorial by @okhat in https://github.com/stanfordnlp/dspy/pull/8002
dspy.SIMBA optimizer and a corresponding Tool-Use Tutorial by @okhat in https://github.com/stanfordnlp/dspy/pull/8002dspy.ChainOfThought to be more customizable by @zbambergerNLP in https://github.com/stanfordnlp/dspy/pull/8006dspy.ProgramOfThought to accept multiple output fields (and other reliability improvements) by @lxdlam in https://github.com/stanfordnlp/dspy/pull/8004Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.14...2.6.15
Limit openai version temporarily due to #7986 by @okhat in https://github.com/stanfordnlp/dspy/pull/7995
Limit openai version temporarily due to #7986 by @okhat in https://github.com/stanfordnlp/dspy/pull/7995
Maintenance: Update dependency LiteLLM for CVE by @mikeweltevrede in https://github.com/stanfordnlp/dspy/pull/7981
Don't crash dspy import when cache initialization fails by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/7983
feat: support context protocol in PythonInterpreter by @lxdlam in https://github.com/stanfordnlp/dspy/pull/7984
feat: refine PythonInterperter to proper take out the exception arguments by @lxdlam in https://github.com/stanfordnlp/dspy/pull/7992
Refactor evaluate and introduce construct_result_table method by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/7991
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.13...2.6.14
dspy.BestOfN: Adds Improved Error Handling, Documentation, and Tests by @cezarc1 in https://github.com/stanfordnlp/dspy/pull/7964
dspy.BestOfN: Adds Improved Error Handling, Documentation, and Tests by @cezarc1 in https://github.com/stanfordnlp/dspy/pull/7964
Make dspy.BaseLM extensible by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/7950
Adapters: Support Pydantic field constraint in DSPy by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/7980
dspy.ChatAdapter: allow field headers and content on same line in parser by @laitifranz in https://github.com/stanfordnlp/dspy/pull/7955
dspy.JSONAdapter: add image support to JSON Adapter too by @laitifranz in https://github.com/stanfordnlp/dspy/pull/7968
Define compile and get_params to Teleprompter by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/7973
Fix completion being unable to be deserialized by pickle by @asparagus in https://github.com/stanfordnlp/dspy/pull/7960
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.12...2.6.13
dspy.MIPROv2: Fix error handling and add tests for eval_candidate_program by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/7936
dspy.MIPROv2: Fix error handling and add tests for eval_candidate_program by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/7936
dspy.Refine and dspy.BestOfN: Adds Improved Error Handling, Documentation, and Tests by @cezarc1 in https://github.com/stanfordnlp/dspy/pull/7926
Simplify dspy.LM by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/7940
Fix unnecessary mlflow calls by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/7942
Remove upper bound on datasets version by @shermansiu in https://github.com/stanfordnlp/dspy/pull/7933
Reorder dependencies by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/7946
Add callback_metadata to evaluate by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/7952
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.11...2.6.12
Fix saving issue by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/7905
import dspy by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/7915Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.10...2.6.11
Add support for non-image mimes in image_url content by @glesperance in https://github.com/stanfordnlp/dspy/pull/7872
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.9...2.6.10
Support multiturn history by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/7851 https://github.com/stanfordnlp/dspy/pull/7874
Support multiturn history by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/7851 https://github.com/stanfordnlp/dspy/pull/7874
Add evaluate callback by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/7895
enh(mipro): Allow to pass provide_traceback in mipro by @Samoed in https://github.com/stanfordnlp/dspy/pull/7890
Fix signature field order mismatch by @Ziems in https://github.com/stanfordnlp/dspy/pull/7875
Fix save predict model with LM by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/7861
Fix model name error in finetune by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/7880
Fix pyproject.toml to include package data by @TomeHirata in https://github.com/stanfordnlp/dspy/pull/7869
Fixes and removes non-existent dependency on dsp.SentenceTransformersVectorizer from KNN and KNNFewShot by @cezarc1 in https://github.com/stanfordnlp/dspy/pull/7884
Add more testing before publishing to pypi by @hmoazam in https://github.com/stanfordnlp/dspy/pull/7889
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.8...2.6.9
Nothing published for this version
Correcting bundle files with dspy installation by @okhat in https://github.com/stanfordnlp/dspy/pull/7868
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.7...2.6.8
Fix RuntimeError: uvloop Incompatibility on Windows by @chakravarthik27 in https://github.com/stanfordnlp/dspy/pull/7842
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.6...2.6.7
Introduce dspy.Refine, dspy.BestOfN and fix thread safety for dspy.ChainOfThoughtWithHint by @chenmoneygithub in https://github.com/stanfordnlp/dspy/p
dspy.Refine, dspy.BestOfN and fix thread safety for dspy.ChainOfThoughtWithHint by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/1959Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.5...2.6.6
Finetune fix by @dilarasoylu in https://github.com/stanfordnlp/dspy/pull/7629
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.4...2.6.5
Improve Adapters (parse_value) and fix bugs & typos by @okhat in https://github.com/stanfordnlp/dspy/pull/7817
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.3...2.6.4
We are redoing the 2.6.3 because earlier we accidentally add a "v" prefix, i.e., v2.6.3, apologize for the inconvenience!
We are redoing the 2.6.3 because earlier we accidentally add a "v" prefix, i.e., v2.6.3, apologize for the inconvenience!
dspy.Tool by @chenmoneygithub in https://github.com/stanfordnlp/dspy/pull/7658Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.2...2.6.3
InferRules optimizer by @arnavsinghvi11 in https://github.com/stanfordnlp/dspy/pull/7261
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.1...2.6.2
Enable Optuna to Learn from Full Evaluations in Minibatch Mode by @klopsahlong in https://github.com/stanfordnlp/dspy/pull/2237
Optimizers
Models and Modules
** Caching **
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.0...2.6.1
Removals for deprecated functional/, dsp/ clients, and old caches by @okhat in #1936
Removals for deprecated functional/, dsp/ clients, and old caches by @okhat in #1936
Simplify built-in modules. Prepare for assertions v2. by @okhat in #1943, #1944
Refined semantics for Settings thread-safety by @okhat in #1947
Streaming by @CyrusNuevoDia in #1874
BootstrapFT improvements relative to 2.4 by @okhat in #1996, #2024
Python interpreter refactor to sandbox by @arnavsinghvi11 in #1956, #2010
Support retries via LiteLLM RetryPolicy by @dbczumar in #1866
Improve Literal format adherence in ChatAdapter, JSONAdapter by @dbczumar in #1955
Add arg parsing for dspy.ReAct by @chenmoneygithub in #2039
Redirect math dataset by @chenmoneygithub in #3563
Update multi_chain_comparison.py by @zbambergerNLP in #2025
@okhat, @chenmoneygithub, @dbczumar, @arnavsinghvi11, @CyrusNuevoDia, @hmoazam, @itay1542, @zbambergerNLP, @GabeDottl, @bjsi, @Dyadd, and others
Nothing published for this version
Automate version upgrade and introduce dspy.__version__ by @hmoazam in https://github.com/stanfordnlp/dspy/pull/1985
dspy.__version__ by @hmoazam in https://github.com/stanfordnlp/dspy/pull/1985Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.0rc6...2.6.0rc8
Nothing published for this version
add response_model key to LM history entry by @itay1542 in https://github.com/stanfordnlp/dspy/pull/1961
response_model key to LM history entry by @itay1542 in https://github.com/stanfordnlp/dspy/pull/1961Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.0rc4...2.6.0rc6
Nothing published for this version
Streaming by @CyrusNuevoDia in https://github.com/stanfordnlp/dspy/pull/1874
Full Changelog: https://github.com/stanfordnlp/dspy/compare/2.6.0rc3...2.6.0rc4
One column per month.