对话界面、知识库与智能体MITPython

DSPy

Program — not prompt — language models, then optimize automatically.

Star 数
39.3K
Fork 数
3.6K
未关闭 Issue
864
最近提交
2026-11-29

数据来自 GitHub API · 更新于 2026-11-30

DSPy 是什么?

DSPy from Stanford NLP replaces hand-written prompts with declarative modules and signatures. Optimizers then tune prompts and few-shot examples (or fine-tune weights) against a metric, making LLM pipelines more reliable and portable across models.

主要功能

  • Declarative signatures and modules
  • Prompt and weight optimizers
  • Works with any LLM provider
  • Built-in RAG, ReAct and chain-of-thought modules

系统要求

平台
Windows · macOS · Linux
Python
3.10+

如何安装 DSPy

根据项目 README 整理。开源项目更新很快,请以 GitHub 页面上的最新说明为准。

pip

  1. 1
    Install the library.
    pip install -U dspy

优势

  • Systematic prompt optimization
  • Research-backed

不足

  • Different mental model from prompt engineering

DSPy 替代品对比

软件Star 数许可证平台显存
DSPy

Program — not prompt — language models, then optimize automatically.

39.3KMIT—
LangChain

The most widely used framework for building LLM applications.

150.2KMIT—
LlamaIndex

Data framework for connecting LLMs to your documents.

53.1KMIT—
Haystack

Framework for production RAG, search and agent pipelines.

27.1KApache-2.0—
Open WebUI

Self-hosted ChatGPT-style interface for Ollama and OpenAI-compatible APIs.

159.8KOpen WebUI License (BSD-3-Clause based)—
LibreChat

Open-source ChatGPT clone supporting every major AI provider.

47.7KMIT—

常见问题

DSPy 免费吗?

是的——DSPy 是开源软件,采用 MIT 许可证。商用前请确认软件及模型权重的许可条款。

DSPy 支持 Windows、Mac 和 Linux 吗?

DSPy 支持:Windows, macOS, Linux。

如何安装 DSPy?

1. Install the library.

DSPy 有哪些好的替代品?

常见替代品包括 LangChain, LlamaIndex, Haystack, Open WebUI,详见本页对比表。