Python framework from Stanford NLP for programming language-model systems with signatures, modules, tools, metrics, and optimizers instead of hand-written prompts.
by Stanford NLP · submitted by oktofeesh1·added 2026-06-03·
DSPy changes how language-model systems are constructed and optimized, but it does not prove that a generated answer, optimized prompt, ReAct tool action, retrieved passage, or fine-tuned model is correct or safe., Optimizers can issue many model calls, generate examples, explore instructions, tune prompts, or fine-tune model weights; set budgets, rate limits, evaluation gates, rollback rules, and review ownership before running them., ReAct modules, Python interpreter tools, function tools, retrieval tools, and MCP-converted tools can trigger external APIs, local code, file access, or business actions if wired into a program., Metrics and evaluation datasets can overfit, reward the wrong behavior, or miss safety failures; treat optimizer scores as development signals rather than production approval., Saved programs, optimized prompts, bootstrapped demonstrations, fine-tuning datasets, and experiment artifacts should be reviewed before sharing because they can encode private data or brittle task assumptions., Local model servers, provider endpoints, and LiteLLM-compatible routes need normal timeout, retry, budget, abuse, model-selection, and credential-handling controls.
Privacy notes
DSPy programs can send prompts, messages, typed inputs, retrieved context, tool arguments, generated outputs, optimizer traces, examples, metrics, and fine-tuning data to configured model providers., DSPy LM history can retain prompts, messages, call kwargs, responses, outputs, token usage, cost metadata, and related debugging information unless applications define cleanup and access controls., Caches, saved programs, optimized prompt artifacts, demonstration sets, serialized LM state, experiment logs, and evaluation reports can preserve sensitive task data outside the original source system., MCP integrations and tool calls can move user data, tool descriptions, tool arguments, and tool results into external servers, agent transcripts, provider logs, and downstream system logs., Local models reduce third-party provider exposure but can still leave data in process logs, tracing systems, prompt caches, generated artifacts, and shared infrastructure storage.
Author
Stanford NLP
Submitted by
oktofeesh1
Claim status
unclaimed
Last verified
2026-06-03
Decision playbook
Review trust signals before you adopt
Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.
Compare context
Selected
0
Current score
78
Baseline
—
Delta
No baseline selected
No major trust-signal divergence detected in the current selection.
Source and provenance checks
Complete
Confirm ownership and provenance before trusting install instructions.
Source link availableRequired
Open the canonical repository and verify ownership.
Done
Source provenance statusRequired
Marked as source-backed.
Done
Metadata reviewed
Registry metadata indicates a reviewed listing.
Done
Safety and privacy checks
Complete
Validate risk disclosures before installation or API wiring.
Safety notes presentRequired
Review the listed safety guidance before running commands.
Done
Privacy notes presentRequired
Review data handling notes before connecting accounts or secrets.
Done
Trust level risk gateRequired
Trust level does not block evaluation.
Done
Package and install checks
Needs review
Check package metadata and artifact integrity signals.
Install payload available
Install or copy payload is available for review.
Done
Package verification flag
No package verification flag provided.
Pending
Checksum metadata
No checksum provided for downloaded artifact.
Pending
Compare-driven decision checks
Needs review
Use compare context to validate trade-offs before adoption.
Compare tray has multiple entries
Add at least one more entry to compare trust differences.
6 safety and 5 privacy notes across 7 risk areas. Review closely: credentials & tokens, third-party handling.
7 areas
SafetyGeneralDSPy changes how language-model systems are constructed and optimized, but it does not prove that a generated answer, optimized prompt, ReAct tool action, retrieved passage, or fine-tuned model is correct or safe.
SafetyExecution & processesOptimizers can issue many model calls, generate examples, explore instructions, tune prompts, or fine-tune model weights; set budgets, rate limits, evaluation gates, rollback rules, and review ownership before running them.
SafetyLocal filesReAct modules, Python interpreter tools, function tools, retrieval tools, and MCP-converted tools can trigger external APIs, local code, file access, or business actions if wired into a program.
SafetyTelemetryMetrics and evaluation datasets can overfit, reward the wrong behavior, or miss safety failures; treat optimizer scores as development signals rather than production approval.
SafetyGeneralSaved programs, optimized prompts, bootstrapped demonstrations, fine-tuning datasets, and experiment artifacts should be reviewed before sharing because they can encode private data or brittle task assumptions.
SafetyCredentials & tokensLocal model servers, provider endpoints, and LiteLLM-compatible routes need normal timeout, retry, budget, abuse, model-selection, and credential-handling controls.
PrivacyThird-party handlingDSPy programs can send prompts, messages, typed inputs, retrieved context, tool arguments, generated outputs, optimizer traces, examples, metrics, and fine-tuning data to configured model providers.
PrivacyCredentials & tokensDSPy LM history can retain prompts, messages, call kwargs, responses, outputs, token usage, cost metadata, and related debugging information unless applications define cleanup and access controls.
PrivacyData retentionCaches, saved programs, optimized prompt artifacts, demonstration sets, serialized LM state, experiment logs, and evaluation reports can preserve sensitive task data outside the original source system.
PrivacyThird-party handlingMCP integrations and tool calls can move user data, tool descriptions, tool arguments, and tool results into external servers, agent transcripts, provider logs, and downstream system logs.
PrivacyThird-party handlingLocal models reduce third-party provider exposure but can still leave data in process logs, tracing systems, prompt caches, generated artifacts, and shared infrastructure storage.
Disclosure: editorial
Safety notes
DSPy changes how language-model systems are constructed and optimized, but it does not prove that a generated answer, optimized prompt, ReAct tool action, retrieved passage, or fine-tuned model is correct or safe.
Optimizers can issue many model calls, generate examples, explore instructions, tune prompts, or fine-tune model weights; set budgets, rate limits, evaluation gates, rollback rules, and review ownership before running them.
ReAct modules, Python interpreter tools, function tools, retrieval tools, and MCP-converted tools can trigger external APIs, local code, file access, or business actions if wired into a program.
Metrics and evaluation datasets can overfit, reward the wrong behavior, or miss safety failures; treat optimizer scores as development signals rather than production approval.
Saved programs, optimized prompts, bootstrapped demonstrations, fine-tuning datasets, and experiment artifacts should be reviewed before sharing because they can encode private data or brittle task assumptions.
Local model servers, provider endpoints, and LiteLLM-compatible routes need normal timeout, retry, budget, abuse, model-selection, and credential-handling controls.
Privacy notes
DSPy programs can send prompts, messages, typed inputs, retrieved context, tool arguments, generated outputs, optimizer traces, examples, metrics, and fine-tuning data to configured model providers.
DSPy LM history can retain prompts, messages, call kwargs, responses, outputs, token usage, cost metadata, and related debugging information unless applications define cleanup and access controls.
Caches, saved programs, optimized prompt artifacts, demonstration sets, serialized LM state, experiment logs, and evaluation reports can preserve sensitive task data outside the original source system.
MCP integrations and tool calls can move user data, tool descriptions, tool arguments, and tool results into external servers, agent transcripts, provider logs, and downstream system logs.
Local models reduce third-party provider exposure but can still leave data in process logs, tracing systems, prompt caches, generated artifacts, and shared infrastructure storage.
Prerequisites
Python 3.10 or newer and a dependency manager for installing `dspy` and optional extras for MCP, retrieval, local models, or deployment workflows.
Model provider credentials, local model endpoint, Databricks environment, or LiteLLM-compatible provider configuration for the language models used by the DSPy program.
Training examples, validation examples, metrics, expected outputs, and reviewer ownership before running DSPy optimizers or using optimized programs in production workflows.
Reviewed data sources, retrieval systems, tools, MCP servers, and Python execution paths before connecting DSPy modules to real files, APIs, databases, or account actions.
Cache, history, saved-program, artifact, and experiment-retention policies for prompts, messages, outputs, optimized examples, model usage metadata, and cost records.
## Editorial notes
DSPy is useful when Claude-adjacent teams want to replace one-off prompt engineering with a programmable, testable way to build language-model systems. It lets developers express tasks as structured signatures, compose them into modules and ReAct agents, define metrics, and optimize prompts, demonstrations, or model weights against examples.
This is distinct from existing framework entries. LlamaIndex and Haystack focus on retrieval/data orchestration, LangGraph focuses on stateful graph workflows, Pydantic AI focuses on typed agent application code, and MLflow, Ragas, TruLens, Langfuse, and Phoenix focus on evaluation or observability evidence. DSPy's center of gravity is programming and optimizing LM programs themselves: signatures, modules, adapters, metrics, optimizers, ReAct tools, multimodal fields, local/provider models, and MCP tool use.
## Source notes
- The official DSPy site describes DSPy as a Python framework for building AI systems by expressing tasks as structured signatures instead of prompts, producing maintainable, modular, and optimizable programs.
- The official overview lists Python 3.10 or newer, an MIT license, and Stanford NLP as the project origin.
- The official site describes signatures for typed inputs and outputs, modules such as `Predict`, `ChainOfThought`, and `ReAct`, tools for agents, and optimizers that compile programs against metrics.
- The language-model documentation covers configuring OpenAI, Gemini, Anthropic, Databricks, local models, OpenAI-compatible endpoints, and other LiteLLM-supported providers.
- The same documentation says DSPy LM objects maintain interaction history with prompts, messages, call kwargs, responses, outputs, usage, and cost metadata.
- The MCP tutorial documents installing `dspy[mcp]`, connecting to MCP servers, converting MCP tools to `dspy.Tool`, and using them in DSPy agents.
- The GitHub repository is `stanfordnlp/dspy`, is MIT licensed, and describes DSPy as a framework for programming, not prompting, language models.
## Duplicate check
Checked current `content/tools/`, `content/mcp/`, agents, hooks, rules, skills, commands, guides, open pull requests, live issue state, and repository-wide content for `DSPy`, `dspy`, `dspy.ai`, `stanfordnlp/dspy`, `language model programming`, `prompt optimization`, `LM programs`, `dspy.ReAct`, `GEPA`, `MIPROv2`, `BootstrapFewShot`, and `dspy[mcp]`. Existing LlamaIndex, Haystack, LangGraph, Pydantic AI, MLflow, Ragas, TruLens, Langfuse, Phoenix, and agent-framework entries cover adjacent framework, retrieval, orchestration, evaluation, or observability workflows, but no dedicated DSPy tools entry, DSPy source URL duplicate, or open duplicate PR was found.
## Disclosure
Editorial listing. No paid placement or affiliate link is used.
About this resource
Editorial notes
DSPy is useful when Claude-adjacent teams want to replace one-off prompt engineering with a programmable, testable way to build language-model systems. It lets developers express tasks as structured signatures, compose them into modules and ReAct agents, define metrics, and optimize prompts, demonstrations, or model weights against examples.
This is distinct from existing framework entries. LlamaIndex and Haystack focus on retrieval/data orchestration, LangGraph focuses on stateful graph workflows, Pydantic AI focuses on typed agent application code, and MLflow, Ragas, TruLens, Langfuse, and Phoenix focus on evaluation or observability evidence. DSPy's center of gravity is programming and optimizing LM programs themselves: signatures, modules, adapters, metrics, optimizers, ReAct tools, multimodal fields, local/provider models, and MCP tool use.
Source notes
The official DSPy site describes DSPy as a Python framework for building AI systems by expressing tasks as structured signatures instead of prompts, producing maintainable, modular, and optimizable programs.
The official overview lists Python 3.10 or newer, an MIT license, and Stanford NLP as the project origin.
The official site describes signatures for typed inputs and outputs, modules such as Predict, ChainOfThought, and ReAct, tools for agents, and optimizers that compile programs against metrics.
The language-model documentation covers configuring OpenAI, Gemini, Anthropic, Databricks, local models, OpenAI-compatible endpoints, and other LiteLLM-supported providers.
The same documentation says DSPy LM objects maintain interaction history with prompts, messages, call kwargs, responses, outputs, usage, and cost metadata.
The MCP tutorial documents installing dspy[mcp], connecting to MCP servers, converting MCP tools to dspy.Tool, and using them in DSPy agents.
The GitHub repository is stanfordnlp/dspy, is MIT licensed, and describes DSPy as a framework for programming, not prompting, language models.
Duplicate check
Checked current content/tools/, content/mcp/, agents, hooks, rules, skills, commands, guides, open pull requests, live issue state, and repository-wide content for DSPy, dspy, dspy.ai, stanfordnlp/dspy, language model programming, prompt optimization, LM programs, dspy.ReAct, GEPA, MIPROv2, BootstrapFewShot, and dspy[mcp]. Existing LlamaIndex, Haystack, LangGraph, Pydantic AI, MLflow, Ragas, TruLens, Langfuse, Phoenix, and agent-framework entries cover adjacent framework, retrieval, orchestration, evaluation, or observability workflows, but no dedicated DSPy tools entry, DSPy source URL duplicate, or open duplicate PR was found.
Disclosure
Editorial listing. No paid placement or affiliate link is used.
Python framework from Stanford NLP for programming language-model systems with signatures, modules, tools, metrics, and optimizers instead of hand-written prompts.
Open-source domain-specific language from BoundaryML for writing typed LLM functions with structured inputs and outputs, a VSCode playground, and generated clients you can call from Python, TypeScript, Go, and more.
Open-source Python multi-agent framework that assigns product manager, architect, project manager, engineer, and other software-company roles to LLM agents for natural-language programming, repo generation, data interpretation, research, debate, and custom agent workflows.
Open-source visual AI programming environment from Ironclad for building, debugging, and embedding complex LLM agents and prompt-chaining graphs, with a desktop app and a TypeScript library.
✓DSPy changes how language-model systems are constructed and optimized, but it does not prove that a generated answer, optimized prompt, ReAct tool action, retrieved passage, or fine-tuned model is correct or safe.
Optimizers can issue many model calls, generate examples, explore instructions, tune prompts, or fine-tune model weights; set budgets, rate limits, evaluation gates, rollback rules, and review ownership before running them.
ReAct modules, Python interpreter tools, function tools, retrieval tools, and MCP-converted tools can trigger external APIs, local code, file access, or business actions if wired into a program.
Metrics and evaluation datasets can overfit, reward the wrong behavior, or miss safety failures; treat optimizer scores as development signals rather than production approval.
Saved programs, optimized prompts, bootstrapped demonstrations, fine-tuning datasets, and experiment artifacts should be reviewed before sharing because they can encode private data or brittle task assumptions.
Local model servers, provider endpoints, and LiteLLM-compatible routes need normal timeout, retry, budget, abuse, model-selection, and credential-handling controls.
✓BAML functions call LLM providers using the credentials you configure, so scope those provider keys to the minimum needed and keep them out of source control.
BAML generates client code that runs inside your application; review generated clients before shipping, and treat typed outputs as untrusted input for account, billing, data, or infrastructure actions.
Static typing and schema validation reduce parsing errors, but they do not guarantee that a model's answer is correct, complete, or safe.
The BAML CLI and VSCode extension run locally and write generated code into your project; run them in an environment where writing those files is expected.
Keep production usage and permissions narrower than playground or example projects.
✓MetaGPT can generate full repositories under a workspace from one-line requirements. Review generated code, dependencies, licenses, prompts, and build scripts before running or publishing anything.
The framework coordinates multiple LLM roles and can call code, web, RAG, browser, email, GitHub, and provider integrations through its dependencies and optional extras; scope credentials and tools per workflow.
Generated requirements, API designs, architecture documents, diagrams, and code can be plausible but wrong. Treat them as drafts until tested against source requirements and local constraints.
Data Interpreter and notebook-style workflows may execute code, create plots, read files, and emit artifacts; run them in an isolated environment for untrusted data.
Long multi-agent runs can consume significant model tokens and external API quota, so set cost ceilings, timeouts, and stopping criteria before production use.
✓Rivet graphs can include nodes that call LLMs, run code, make HTTP requests, and call into your application's functions, so review what a graph and its nodes do before running it, especially graphs from untrusted sources.
The desktop app and embedded graphs use the model-provider API keys and integration credentials you configure; scope those credentials to the minimum needed.
When embedding Rivet Core in an application, treat graph inputs and node outputs as untrusted, and gate any node that performs writes or external actions.
Node types that execute code or make network calls should run with least privilege and appropriate timeouts.
Keep production graphs and their permissions narrower than example graphs.
Privacy notes
✓DSPy programs can send prompts, messages, typed inputs, retrieved context, tool arguments, generated outputs, optimizer traces, examples, metrics, and fine-tuning data to configured model providers.
DSPy LM history can retain prompts, messages, call kwargs, responses, outputs, token usage, cost metadata, and related debugging information unless applications define cleanup and access controls.
Caches, saved programs, optimized prompt artifacts, demonstration sets, serialized LM state, experiment logs, and evaluation reports can preserve sensitive task data outside the original source system.
MCP integrations and tool calls can move user data, tool descriptions, tool arguments, and tool results into external servers, agent transcripts, provider logs, and downstream system logs.
Local models reduce third-party provider exposure but can still leave data in process logs, tracing systems, prompt caches, generated artifacts, and shared infrastructure storage.
✓BAML functions send prompts and inputs to the configured model providers, which process that data under their own data-handling terms.
Prompt templates, test inputs, and example data can contain personal or proprietary information, so keep them and provider credentials out of version control.
Generated outputs, and any logging or tracing you add around BAML calls, can retain prompts and results outside the library.
Apply normal retention and access-control policies to BAML source files, generated clients, and test fixtures that include real data.
✓Requirements, prompts, role messages, generated code, diagrams, documents, repo files, notebook outputs, model responses, logs, and traces may contain private product or workspace data.
Configured LLM providers, browser/search tools, RAG/vector services, GitHub integrations, email/IMAP tools, cloud providers, and generated workspaces may receive or retain workflow data.
Do not commit `~/.metagpt/config2.yaml`, provider keys, local model URLs, generated repos with secrets, workspace logs, notebook outputs, or customer requirements.
If teams share MetaGPT outputs, strip private prompts, internal system names, customer data, generated credentials, and non-public architecture details first.
✓Running a Rivet graph sends prompts, inputs, and node data to the configured model providers and any integrated services.
Nodes that call your application's code, HTTP endpoints, or data sources can pass local or workspace data into the graph and the model.
Prompts, node outputs, and debugging traces in the app or your logs can retain data, so apply normal retention and access-control policies.
Model-provider and integration credentials live in the app configuration or your application's environment; keep them out of version control.
Prerequisites
Python 3.10 or newer and a dependency manager for installing `dspy` and optional extras for MCP, retrieval, local models, or deployment workflows.
Model provider credentials, local model endpoint, Databricks environment, or LiteLLM-compatible provider configuration for the language models used by the DSPy program.
Training examples, validation examples, metrics, expected outputs, and reviewer ownership before running DSPy optimizers or using optimized programs in production workflows.
Reviewed data sources, retrieval systems, tools, MCP servers, and Python execution paths before connecting DSPy modules to real files, APIs, databases, or account actions.
A way to install the BAML toolchain (for example the CLI via Homebrew) and, for embedding, the language SDK such as `@boundaryml/baml` for TypeScript or `baml-py` for Python.
Model-provider credentials for the LLM providers your BAML functions call.
Defined input and output types for each BAML function before generating clients.
A build step to regenerate BAML clients when function definitions change, and a place to review the generated code.
Python 3.9 through 3.11 and an isolated Python environment.
Node.js and pnpm for workflows that render diagrams or use MetaGPT's documented software-company generation path.
LLM provider configuration in `~/.metagpt/config2.yaml`, such as OpenAI, Azure, Ollama, Groq, or another supported provider route.
API keys, base URLs, local model endpoints, and generated workspace paths kept outside source control.
The Rivet desktop application (for authoring graphs), or Node.js and npm to embed `@ironclad/rivet-core` or `@ironclad/rivet-node` in an application.
Model-provider API keys for the LLM providers a graph uses, plus credentials for any integrations the graph calls.
A clear boundary for which application functions and data sources Rivet graphs may call, and vice versa, before embedding.
A plan for how graphs are versioned, reviewed, and promoted from local authoring to production use.