47 model fiyatı
  1. Ana sayfa
  2. Sürümler
  3. DSPy
  4. 3.4.1

DSPy 3.4.1 sürüm notları

DSPy 3.4.1 sürümünün yayın tarihi 12 Ekim 2026. En güncel sürüm 3.5.0.

· 82 değişiklik maddesiKırıcı

Bu sürümün notları kırıcı değişikliklerden bahsediyor.

Orijinal sürüm notları

DSPy 3.4.1

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.

Highlights

InstructionProposer Is GEPA's Default Proposer — @dbreunig

dspy.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",
)

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

RLM Can Build DSPy Sub-Agents — @michaelisaac-dev

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:

Sub-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]

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

API and Compatibility Changes

GEPA Reflection Requests

PRs: #10555

RLM Sub-Agents

PRs: #10478, #10625

Flex Bridge Constants Moved to dspy.primitives.facade

Breaking 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

Null Score Level Descriptions Are Rejected

Each 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:

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

Bundled Model Metadata Now Follows LiteLLM 1.105.0

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:

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:

PRs: #10517, #10539, #10598, #10624

Python 3.15 and Dependencies

PR: #10521

Custom Adapters and main_request

History 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.

PRs: #10554, #10628

ReActV2 Reserves the history and tools Input Names

dspy.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.

PR: #10464

X | Y Annotations Render Like typing.Union

On 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

Additional Fixes

Full PR List

GEPA and Optimizers
Agents, RLM, Flex, and Interpreters
Adapters, Streaming, and Types
Core, Performance, and Platform
Model Metadata
Documentation
Testing, CI, Dependencies, and Release Engineering

Contributors

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

Kaynak: GitHub sürümü 3.4.1

Daha yeni: 3.5.0Daha eski: 3.4.0DSPy