{"full_name":"stanfordnlp/dspy","owner":"stanfordnlp","name":"dspy","url":"https://github.com/stanfordnlp/dspy","description":"DSPy: The framework for programming—not prompting—language models","homepage":"https://dspy.ai","topics":[],"language":"Python","license":"MIT","avatar":"https://avatars.githubusercontent.com/u/3046006?v=4","created_at":"2023-01-09T21:01:51Z","pushed_at":"2026-11-10T04:13:55Z","metrics":{"stars":38991,"forks":3496,"watchers":209,"issues":1752,"prs":3249,"releases":114,"issues_open":null,"issues_closed":null,"prs_open":null,"prs_closed":null,"prs_merged":null,"discussions":95},"growth":{"day":{"stars":10,"forks":3,"base_day":"2026-11-09"},"week":{"stars":102,"forks":20,"base_day":"2026-11-03"},"month":{"stars":504,"forks":101,"base_day":"2026-10-11"}},"history":{"dates":["2026-09-13","2026-09-14","2026-09-15","2026-09-16","2026-09-17","2026-09-18","2026-09-19","2026-09-20","2026-09-21","2026-09-22","2026-09-23","2026-09-24","2026-09-25","2026-09-26","2026-09-27","2026-09-28","2026-09-29","2026-09-30","2026-10-01","2026-10-02","2026-10-03","2026-10-04","2026-10-05","2026-10-06","2026-10-07","2026-10-08","2026-10-09","2026-10-10","2026-10-11","2026-10-12","2026-10-13","2026-10-14","2026-10-15","2026-10-16","2026-10-17","2026-10-18","2026-10-19","2026-10-20","2026-10-21","2026-10-22","2026-10-23","2026-10-24","2026-10-25","2026-10-26","2026-10-27","2026-10-28","2026-10-29","2026-10-30","2026-10-31","2026-11-01","2026-11-02","2026-11-03","2026-11-04","2026-11-09","2026-11-10"],"stars":[37654,37709,37729,37753,37774,37791,37833,37858,37882,37900,37948,37984,38011,38043,38070,38100,38120,38146,38183,38211,38233,38259,38282,38341,38401,38422,38454,38470,38487,38507,38520,38546,38558,38566,38582,38601,38612,38638,38661,38669,38697,38705,38720,38736,38755,38769,38803,38820,38832,38847,38857,38889,38904,38981,38991],"forks":[3271,3279,3281,3284,3285,3289,3291,3294,3297,3305,3307,3310,3316,3317,3318,3323,3322,3326,3337,3344,3351,3353,3357,3365,3374,3379,3385,3390,3395,3398,3402,3405,3406,3407,3408,3415,3419,3423,3429,3431,3437,3438,3441,3444,3447,3453,3456,3456,3457,3458,3462,3476,3480,3493,3496],"watchers":[210,213,213,213,213,213,215,215,215,215,215,215,215,215,216,216,216,218,219,219,219,219,220,219,220,219,219,217,217,217,218,218,218,218,218,218,218,218,218,218,217,217,217,217,217,212,211,210,210,209,209,209,209,209,209],"issues_open":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"prs_open":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]},"boards":{},"same_owner":[{"full_name":"stanfordnlp/stanza","name":"stanza","boards":{}}],"issues":[{"number":1539,"title":"ValueError: Expected dict_keys(['answer']) but got dict_keys([])","comments":35,"created_at":"2024-09-25T12:21:03Z"},{"number":1719,"title":"How do I load huggingface models?","comments":20,"created_at":"2024-10-29T23:12:57Z"},{"number":1570,"title":"Use of LiteLLM Router for load balancing and fallbacks","comments":19,"created_at":"2024-10-01T17:48:11Z"},{"number":9034,"title":"[Feature] Coding agent CLIs with DSPy - a client that proxies DSPy calls through arbitrary CLI commands","comments":16,"created_at":"2025-11-08T15:18:19Z"},{"number":8946,"title":"[Bug] ColBERT is down","comments":16,"created_at":"2025-10-15T16:26:33Z"},{"number":8067,"title":"[Bug] Ollama requests fail when including an Image","comments":13,"created_at":"2025-04-13T17:43:24Z"},{"number":9097,"title":"[Feature] Maybe we need DSPy Cookbook?","comments":11,"created_at":"2025-11-28T03:08:02Z"},{"number":7830,"title":"[Feature] Print the final prompt of a DSPy program","comments":11,"created_at":"2025-02-20T22:42:57Z"}],"discussions":[{"number":10734,"title":"Can We \"Train\" MCP Tools and Agent Skills Through Expert Demonstrations and Iterative Feedback?","comments":0,"category":"Ideas","created_at":"2026-10-28T09:04:33Z"},{"number":10507,"title":"Optimisers absorb format non-compliance and the cost is invisible in the final score","comments":0,"category":"General","created_at":"2026-09-26T02:28:08Z"},{"number":10450,"title":"Proposal: Latent Space (Vector) Communication Protocol for Multi-Agent & Intra-Model Systems","comments":1,"category":"Ideas","created_at":"2026-09-18T09:21:55Z"},{"number":10439,"title":"Show and Tell: A package with `StructuredOutputAdapter` for getting better structured output from smaller models","comments":2,"category":"Show and tell","created_at":"2026-09-17T06:54:49Z"},{"number":10394,"title":"Show and Tell: Zero-Daemon Crash Recovery for Long-Running DSPy Optimizers (MIPROv2 / Teleprompters)","comments":0,"category":"Show and tell","created_at":"2026-09-13T18:59:54Z"},{"number":10386,"title":"3.4.0b1","comments":0,"category":"Announcements","created_at":"2026-09-11T22:24:51Z"},{"number":10365,"title":"Byte-exact replay of DSPy LM traffic — re-running a program with the model server switched off","comments":0,"category":"Show and tell","created_at":"2026-09-10T08:20:58Z"},{"number":10343,"title":"Where should we share an invitation for an agent-and-media hackathon?","comments":0,"category":"General","created_at":"2026-09-06T00:36:26Z"}],"latest_release":{"name":"3.4.1","tag":"3.4.1","published_at":"2026-10-12T23:12:32Z","body":"# DSPy 3.4.1\r\n\r\nDSPy 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.\r\n\r\n```bash\r\npip install --upgrade \"dspy==3.4.1\"\r\n```\r\n\r\n**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](#api-and-compatibility-changes).\r\n\r\nThe [3.5 LM-interface cutoff](https://dspy.ai/community/normalized-lm-api-migration/#the-35-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.\r\n\r\n## Highlights\r\n\r\n### `InstructionProposer` Is GEPA's Default Proposer — @dbreunig\r\n\r\n`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.\r\n\r\nYou can configure the proposer directly:\r\n\r\n```python\r\nimport dspy\r\nfrom dspy.teleprompt.gepa import InstructionProposer\r\n\r\noptimizer = dspy.GEPA(\r\n    metric=metric,\r\n    reflection_lm=dspy.LM(\"openai/gpt-5\"),\r\n    instruction_proposer=InstructionProposer(\r\n        skills=[\"./skills/prompt-engineering\"],\r\n        additional_instructions=\"Write instructions in imperative voice.\",\r\n        max_chars=1500,\r\n        truncate_history_outputs=True,\r\n    ),\r\n    auto=\"medium\",\r\n)\r\n```\r\n\r\n- `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.\r\n- `additional_instructions`: extra guidance applied to every proposal.\r\n- `base_instructions`: replaces the reflection prompt but keeps its input and output fields.\r\n- `max_chars`: a hard character limit. A draft that is too long gets one compression attempt; DSPy never truncates an instruction.\r\n- `truncate_history_outputs`: shortens long tool and REPL outputs inside history inputs before rendering, without changing the originals.\r\n- `adapter`: the adapter used for proposal calls. The default is `JSONAdapter()`.\r\n\r\nCustom `instruction_proposer` functions receive the same reflective dataset as before, and `MultiModalInstructionProposer` remains available.\r\n\r\nThis 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.\r\n\r\nPRs: [#10555](https://github.com/stanfordnlp/dspy/pull/10555); follow-up fix [#10634](https://github.com/stanfordnlp/dspy/pull/10634) by @isaacbmiller\r\n\r\n### RLM Can Build DSPy Sub-Agents — @michaelisaac-dev\r\n\r\nCode 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:\r\n\r\n- `dspy.Predict` and `dspy.ChainOfThought`\r\n- `dspy.ReActV2`, using the tools you gave the RLM\r\n- a nested `dspy.RLM`, which runs on the same interpreter backend as its pa"},"readme":true,"readme_zh":false,"news":[],"stale":false,"snapshot_at":"2026-11-10T09:35:25Z","history_start":"2026-09-06"}