{"id":13478056,"url":"https://github.com/stanfordnlp/dspy","last_synced_at":"2025-05-12T18:12:38.872Z","repository":{"id":65448233,"uuid":"587050620","full_name":"stanfordnlp/dspy","owner":"stanfordnlp","description":"DSPy: The framework for programming—not prompting—language models","archived":false,"fork":false,"pushed_at":"2025-05-12T16:20:29.000Z","size":166125,"stargazers_count":24173,"open_issues_count":185,"forks_count":1860,"subscribers_count":159,"default_branch":"main","last_synced_at":"2025-05-12T17:33:30.837Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://dspy.ai","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stanfordnlp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-09T21:01:51.000Z","updated_at":"2025-05-12T16:55:04.000Z","dependencies_parsed_at":"2023-08-19T09:02:08.385Z","dependency_job_id":"cf67a14a-7276-405a-a466-05bcacab7533","html_url":"https://github.com/stanfordnlp/dspy","commit_stats":null,"previous_names":["stanfordnlp/dsp"],"tags_count":90,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stanfordnlp%2Fdspy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stanfordnlp%2Fdspy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stanfordnlp%2Fdspy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stanfordnlp%2Fdspy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stanfordnlp","download_url":"https://codeload.github.com/stanfordnlp/dspy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253789285,"owners_count":21964649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T16:01:51.872Z","updated_at":"2025-05-12T18:12:38.813Z","avatar_url":"https://github.com/stanfordnlp.png","language":"Python","funding_links":[],"categories":["Coding Tools for Economists","Llm Frameworks","AI and Agents","🏗️ エージェントフレームワーク","Python","others","Pipeline Frameworks","🎯 Tool Categories","Open Source Libraries","A01_文本生成_文本对话","Announcements","Repos","Large Language Models (LLMs)","Python Libraries","🔧 Utilities \u0026 Miscellaneous","LLM Applications","Tools and Frameworks","Why Context Engineering is a Keystone of Modern AI","Other LLM Frameworks","Software Development","开源工具","🛠️ Development Frameworks","HarmonyOS","Learning","Frameworks","\u003ca id=\"tools\"\u003e\u003c/a\u003e🛠️ Tools","Industry Strength Natural Language Processing","Other","🧱 Agent Frameworks","Agentic AI ![](https://img.shields.io/badge/_-AGENTIC-22d3ee?style=flat-square\u0026logo=openai\u0026logoColor=white)","Agent Frameworks","🧠 Structured Generation \u0026 Control","Real-World Applications","Table of Open-Source AI Agents Projects","Fine-Tuning","Agents \u0026 Orchestration","Agentic Workflow","AI Agent Frameworks \u0026 SDKs","Prompt Engineering","11. RAG \u0026 Knowledge","3. Prompt Optimization","Tools and Code","提示工程与优化 (Prompt Engineering)","Agent SDK / framework","🌟 Hidden Gems: Underrated Tools","Context \u0026 Prompt Optimization","Open Source Tools","4. Agentic AI \u0026 Multi-Agent Systems","Agent SDKs \u0026 Frameworks","Platforms \u0026 Frameworks","🧱 Infrastructure and Building Blocks","Frameworks \u0026 Orchestration","LLM Tools"],"sub_categories":["AI Agent Frameworks","その他の標準","🤖 LLMOps \u0026 GenAI (2024-2025)","大语言对话模型及数据","Prompt Engineering","Reflection and Meta-Cognition","Frameworks \u0026 Libraries","Videos Playlists","Prompting","Python LLM Libraries","Windows Manager","Repositories","Bleeding Edge ⚗️","General Purpose","Agentic frameworks","Community","Output Structure \u0026 Validation","Prompt Programming","Orchestration Frameworks","Rust","Agent Frameworks","Codex Resources","推理网关 (Inference Gateways)","Resources","Lightweight \u0026 Typed","Self-hosted Agent Frameworks","General RAG and Agent Frameworks","Frameworks"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg align=\"center\" src=\"docs/docs/static/img/dspy_logo.png\" width=\"460px\" /\u003e\n\u003c/p\u003e\n\u003cp align=\"left\"\u003e\n\n\n## DSPy: _Programming_—not prompting—Foundation Models\n\n**Documentation:** [DSPy Docs](https://dspy.ai/)\n\n[![PyPI Downloads](https://static.pepy.tech/badge/dspy/month)](https://pepy.tech/projects/dspy)\n\n\n----\n\nDSPy is the framework for _programming—rather than prompting—language models_. It allows you to iterate fast on **building modular AI systems** and offers algorithms for **optimizing their prompts and weights**, whether you're building simple classifiers, sophisticated RAG pipelines, or Agent loops.\n\nDSPy stands for Declarative Self-improving Python. Instead of brittle prompts, you write compositional _Python code_ and use DSPy to **teach your LM to deliver high-quality outputs**. Learn more via our [official documentation site](https://dspy.ai/) or meet the community, seek help, or start contributing via this GitHub repo and our [Discord server](https://discord.gg/XCGy2WDCQB).\n\n\n## Documentation: [dspy.ai](https://dspy.ai)\n\n\n**Please go to the [DSPy Docs at dspy.ai](https://dspy.ai)**\n\n\n## Installation\n\n\n```bash\npip install dspy\n```\n\nTo install the very latest from `main`:\n\n```bash\npip install git+https://github.com/stanfordnlp/dspy.git\n````\n\n\n\n\n## 📜 Citation \u0026 Reading More\n\nIf you're looking to understand the framework, please go to the [DSPy Docs at dspy.ai](https://dspy.ai).\n\nIf you're looking to understand the underlying research, this is a set of our papers:\n\n**[Jun'24] [Optimizing Instructions and Demonstrations for Multi-Stage Language Model Programs](https://arxiv.org/abs/2406.11695)**       \n**[Oct'23] [DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines](https://arxiv.org/abs/2310.03714)**     \n[Jul'24] [Fine-Tuning and Prompt Optimization: Two Great Steps that Work Better Together](https://arxiv.org/abs/2407.10930)     \n[Jun'24] [Prompts as Auto-Optimized Training Hyperparameters](https://arxiv.org/abs/2406.11706)    \n[Feb'24] [Assisting in Writing Wikipedia-like Articles From Scratch with Large Language Models](https://arxiv.org/abs/2402.14207)         \n[Jan'24] [In-Context Learning for Extreme Multi-Label Classification](https://arxiv.org/abs/2401.12178)       \n[Dec'23] [DSPy Assertions: Computational Constraints for Self-Refining Language Model Pipelines](https://arxiv.org/abs/2312.13382)   \n[Dec'22] [Demonstrate-Search-Predict: Composing Retrieval \u0026 Language Models for Knowledge-Intensive NLP](https://arxiv.org/abs/2212.14024.pdf)\n\nTo stay up to date or learn more, follow [@lateinteraction](https://twitter.com/lateinteraction) on Twitter.\n\nThe **DSPy** logo is designed by **Chuyi Zhang**.\n\nIf you use DSPy or DSP in a research paper, please cite our work as follows:\n\n```\n@inproceedings{khattab2024dspy,\n  title={DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines},\n  author={Khattab, Omar and Singhvi, Arnav and Maheshwari, Paridhi and Zhang, Zhiyuan and Santhanam, Keshav and Vardhamanan, Sri and Haq, Saiful and Sharma, Ashutosh and Joshi, Thomas T. and Moazam, Hanna and Miller, Heather and Zaharia, Matei and Potts, Christopher},\n  journal={The Twelfth International Conference on Learning Representations},\n  year={2024}\n}\n@article{khattab2022demonstrate,\n  title={Demonstrate-Search-Predict: Composing Retrieval and Language Models for Knowledge-Intensive {NLP}},\n  author={Khattab, Omar and Santhanam, Keshav and Li, Xiang Lisa and Hall, David and Liang, Percy and Potts, Christopher and Zaharia, Matei},\n  journal={arXiv preprint arXiv:2212.14024},\n  year={2022}\n}\n```\n\n\u003c!-- You can also read more about the evolution of the framework from Demonstrate-Search-Predict to DSPy:\n\n* [**DSPy Assertions: Computational Constraints for Self-Refining Language Model Pipelines**](https://arxiv.org/abs/2312.13382)   (Academic Paper, Dec 2023) \n* [**DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines**](https://arxiv.org/abs/2310.03714) (Academic Paper, Oct 2023) \n* [**Releasing DSPy, the latest iteration of the framework**](https://twitter.com/lateinteraction/status/1694748401374490946) (Twitter Thread, Aug 2023)\n* [**Releasing the DSP Compiler (v0.1)**](https://twitter.com/lateinteraction/status/1625231662849073160)  (Twitter Thread, Feb 2023)\n* [**Introducing DSP**](https://twitter.com/lateinteraction/status/1617953413576425472)  (Twitter Thread, Jan 2023)\n* [**Demonstrate-Search-Predict: Composing retrieval and language models for knowledge-intensive NLP**](https://arxiv.org/abs/2212.14024.pdf) (Academic Paper, Dec 2022) --\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstanfordnlp%2Fdspy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstanfordnlp%2Fdspy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstanfordnlp%2Fdspy/lists"}