From f10e11ab97969d885ba17bd9cb443a50467fd40a Mon Sep 17 00:00:00 2001 From: Amir Mehr Date: Sat, 26 Oct 2024 19:17:27 -0600 Subject: [PATCH 01/13] Restructure navigation and update documentation links in mkdocs.yml. Simplify sections and add new files for better organization and clarity. Adjust community resources and remove unnecessary redirects. --- docs/mkdocs.yml | 152 ++++++++++++------------------------------------ 1 file changed, 37 insertions(+), 115 deletions(-) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 104c09d110..284f921bde 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -6,29 +6,29 @@ repo_name: stanfordnlp/dspy edit_uri: edit/main/docs/docs/ docs_dir: 'docs/' nav: - - About DSPy: intro.md - - Getting Started: - - Quick Start: - - Installation: quick-start/installation.md - - Getting Started I: quick-start/getting-started-01.md - - Getting Started II: quick-start/getting-started-02.md - - Building Blocks: - - DSPy in 8 Steps: building-blocks/solving_your_task.md - - Language Models: building-blocks/1-language_models.md - - Signatures: building-blocks/2-signatures.md - - Modules: building-blocks/3-modules.md - - Data: building-blocks/4-data.md - - Metrics: building-blocks/5-metrics.md - - Optimizers: building-blocks/6-optimizers.md - - Assertions: building-blocks/7-assertions.md - - Typed Predictors: building-blocks/8-typed_predictors.md + - Home: + - intro.md + - Quick Start: + - Installation: quick-start/installation.md + - Quick Start: quick-start/getting-started-01.md + - Build your first pipeline: quick-start/getting-started-02.md - Tutorials: - Retrieval Augmented Generation: tutorials/rag.md - Multi-Hop QA: tutorials/simplified-baleen.md - Summarization: tutorials/summarization.md - Additional Resources: tutorials/other_tutorial.md - Examples: tutorials/examples.md - - Concepts: + - Debugging: tutorials/debugging.md # New file and we can for now just getting it from the FAQs + - Components: + - Overview: building-blocks/solving_your_task.md + - Language Models: building-blocks/1-language_models.md + - Signatures: building-blocks/2-signatures.md + - Modules: building-blocks/3-modules.md + - Data: building-blocks/4-data.md + - Metrics: building-blocks/5-metrics.md + - Optimizers: building-blocks/6-optimizers.md + - Assertions: building-blocks/7-assertions.md + - Typed Predictors: building-blocks/8-typed_predictors.md - Data Handling: - Examples in DSPy: deep-dive/data-handling/examples.md - Utilizing Built-in Datasets: deep-dive/data-handling/built-in-datasets.md @@ -43,18 +43,9 @@ nav: - ReAct: deep-dive/modules/react.md - MultiChainComparison: deep-dive/modules/multi-chain-comparison.md - ProgramOfThought: deep-dive/modules/program-of-thought.md - # - Assertions: deep-dive/modules/assertions.md + - Assertions: deep-dive/modules/assertions.md - Retreive: deep-dive/modules/retrieve.md - Modules Guide: deep-dive/modules/guide.md - - Optimizers (formerly Teleprompters): - - LabeledFewShot: deep-dive/optimizers/LabeledFewShot.md - - BootstrapFewShot: deep-dive/optimizers/bootstrap-fewshot.md - - BootstrapFinetune: deep-dive/optimizers/BootstrapFinetune.md - - Ensemble: deep-dive/optimizers/Ensemble.md - - BFRS: deep-dive/optimizers/bfrs.md - - CoPro: deep-dive/optimizers/copro.md - - MIProV2: deep-dive/optimizers/miprov2.md - - Assertions: deep-dive/assertions.md - Language Model Clients: - Local Language Model Clients: - HFClientTGI: deep-dive/language_model_clients/lm_local_models/HFClientTGI.md @@ -80,9 +71,25 @@ nav: - WatsonDiscovery: deep-dive/retrieval_models_clients/WatsonDiscovery.md - WeaviateRM: deep-dive/retrieval_models_clients/WeaviateRM.md - YouRM: deep-dive/retrieval_models_clients/YouRM.md + - Assertions: deep-dive/assertions.md + - Optimizers (formerly Teleprompters): + - LabeledFewShot: deep-dive/optimizers/LabeledFewShot.md + - BootstrapFewShot: deep-dive/optimizers/bootstrap-fewshot.md + - BootstrapFinetune: deep-dive/optimizers/BootstrapFinetune.md + - Ensemble: deep-dive/optimizers/Ensemble.md + - BFRS: deep-dive/optimizers/bfrs.md + - CoPro: deep-dive/optimizers/copro.md + - MIProV2: deep-dive/optimizers/miprov2.md + - Community: + - Content & Tutorials: dspy-usecases.md # Existing file + - Related Projects: community/related-projects.md # New file and split the dspy-usecases + - Companies using DSPy: community/companies-using-dspy.md # New file and split the dspy-usecases + - Contributing: # we should bring it from the FAQs + - Roadmap: roadmap.md + - How to get involved: community/how-to-contribute.md # New file + - Development setup: community/development-setup.md # New file - FAQ: faqs.md - Cheatsheet: cheatsheet.md - - DSPy Usecases: dspy-usecases.md theme: name: material @@ -128,98 +135,12 @@ plugins: - redirects: redirect_maps: 'index.md': 'intro.md' - # Intro page redirects - 'docs/intro.md': 'intro.md' - 'docs/intro/index.md': 'intro.md' - - - # Quick Start redirects - 'docs/quick-start/installation.md': 'quick-start/installation.md' - 'docs/quick-start/getting-started-01.md': 'quick-start/getting-started-01.md' - 'docs/quick-start/getting-started-02.md': 'quick-start/getting-started-02.md' - - # Building Blocks redirects - 'docs/building-blocks/solving_your_task.md': 'building-blocks/solving_your_task.md' - 'docs/building-blocks/1-language_models.md': 'building-blocks/1-language_models.md' - 'docs/building-blocks/2-signatures.md': 'building-blocks/2-signatures.md' - 'docs/building-blocks/3-modules.md': 'building-blocks/3-modules.md' - 'docs/building-blocks/4-data.md': 'building-blocks/4-data.md' - 'docs/building-blocks/5-metrics.md': 'building-blocks/5-metrics.md' - 'docs/building-blocks/6-optimizers.md': 'building-blocks/6-optimizers.md' - 'docs/building-blocks/7-assertions.md': 'building-blocks/7-assertions.md' - 'docs/building-blocks/8-typed_predictors.md': 'building-blocks/8-typed_predictors.md' - - # Tutorials redirects 'docs/tutorials/rag.md': 'tutorials/rag.md' 'docs/tutorials/simplified-baleen.md': 'tutorials/simplified-baleen.md' 'docs/tutorials/summarization.md': 'tutorials/summarization.md' 'docs/tutorials/other_tutorial.md': 'tutorials/other_tutorial.md' 'docs/tutorials/examples.md': 'tutorials/examples.md' - # Deep Dive redirects - # Data Handling - 'docs/deep-dive/data-handling/examples.md': 'deep-dive/data-handling/examples.md' - 'docs/deep-dive/data-handling/built-in-datasets.md': 'deep-dive/data-handling/built-in-datasets.md' - 'docs/deep-dive/data-handling/loading-custom-data.md': 'deep-dive/data-handling/loading-custom-data.md' - - # Signatures - 'docs/deep-dive/signature/understanding-signatures.md': 'deep-dive/signature/understanding-signatures.md' - 'docs/deep-dive/signature/executing-signatures.md': 'deep-dive/signature/executing-signatures.md' - - # Modules - 'docs/deep-dive/modules/predict.md': 'deep-dive/modules/predict.md' - 'docs/deep-dive/modules/chain-of-thought.md': 'deep-dive/modules/chain-of-thought.md' - 'docs/deep-dive/modules/chain-of-thought-with-hint.md': 'deep-dive/modules/chain-of-thought-with-hint.md' - 'docs/deep-dive/modules/react.md': 'deep-dive/modules/react.md' - 'docs/deep-dive/modules/multi-chain-comparison.md': 'deep-dive/modules/multi-chain-comparison.md' - 'docs/deep-dive/modules/program-of-thought.md': 'deep-dive/modules/program-of-thought.md' - 'docs/deep-dive/modules/assertions.md': 'building-blocks/7-assertions.md' - 'deep-dive/modules/assertions.md': 'building-blocks/7-assertions.md' - 'docs/deep-dive/modules/retrieve.md': 'deep-dive/modules/retrieve.md' - 'docs/deep-dive/modules/guide.md': 'deep-dive/modules/guide.md' - - # Language Model Clients - 'docs/deep-dive/language_model_clients/lm_local_models/HFClientTGI.md': 'deep-dive/language_model_clients/lm_local_models/HFClientTGI.md' - 'docs/deep-dive/language_model_clients/lm_local_models/HFClientVLLM.md': 'deep-dive/language_model_clients/lm_local_models/HFClientVLLM.md' - 'docs/deep-dive/language_model_clients/lm_local_models/MLC.md': 'deep-dive/language_model_clients/lm_local_models/MLC.md' - 'docs/deep-dive/language_model_clients/lm_local_models/Ollama.md': 'deep-dive/language_model_clients/lm_local_models/Ollama.md' - 'docs/deep-dive/language_model_clients/lm_local_models/LlamaCpp.md': 'deep-dive/language_model_clients/lm_local_models/LlamaCpp.md' - 'docs/deep-dive/language_model_clients/lm_local_models/TensorRTLLM.md': 'deep-dive/language_model_clients/lm_local_models/TensorRTLLM.md' - - # Retrieval Model Clients - 'docs/deep-dive/retrieval_models_clients/Azure.md': 'deep-dive/retrieval_models_clients/Azure.md' - 'docs/deep-dive/retrieval_models_clients/ChromadbRM.md': 'deep-dive/retrieval_models_clients/ChromadbRM.md' - 'docs/deep-dive/retrieval_models_clients/ColBERTv2.md': 'deep-dive/retrieval_models_clients/ColBERTv2.md' - 'docs/deep-dive/retrieval_models_clients/custom-rm-client.md': 'deep-dive/retrieval_models_clients/custom-rm-client.md' - 'docs/deep-dive/retrieval_models_clients/DatabricksRM.md': 'deep-dive/retrieval_models_clients/DatabricksRM.md' - 'docs/deep-dive/retrieval_models_clients/FaissRM.md': 'deep-dive/retrieval_models_clients/FaissRM.md' - 'docs/deep-dive/retrieval_models_clients/LancedbRM.md': 'deep-dive/retrieval_models_clients/LancedbRM.md' - 'docs/deep-dive/retrieval_models_clients/MilvusRM.md': 'deep-dive/retrieval_models_clients/MilvusRM.md' - 'docs/deep-dive/retrieval_models_clients/MyScaleRM.md': 'deep-dive/retrieval_models_clients/MyScaleRM.md' - 'docs/deep-dive/retrieval_models_clients/Neo4jRM.md': 'deep-dive/retrieval_models_clients/Neo4jRM.md' - 'docs/deep-dive/retrieval_models_clients/QdrantRM.md': 'deep-dive/retrieval_models_clients/QdrantRM.md' - 'docs/deep-dive/retrieval_models_clients/RAGatouilleRM.md': 'deep-dive/retrieval_models_clients/RAGatouilleRM.md' - 'docs/deep-dive/retrieval_models_clients/SnowflakeRM.md': 'deep-dive/retrieval_models_clients/SnowflakeRM.md' - 'docs/deep-dive/retrieval_models_clients/WatsonDiscovery.md': 'deep-dive/retrieval_models_clients/WatsonDiscovery.md' - 'docs/deep-dive/retrieval_models_clients/WeaviateRM.md': 'deep-dive/retrieval_models_clients/WeaviateRM.md' - 'docs/deep-dive/retrieval_models_clients/YouRM.md': 'deep-dive/retrieval_models_clients/YouRM.md' - - # Assertions - 'docs/deep-dive/assertions.md': 'deep-dive/assertions.md' - - # Teleprompters - 'docs/deep-dive/optimizers/LabeledFewShot.md': 'deep-dive/optimizers/LabeledFewShot.md' - 'docs/deep-dive/optimizers/bootstrap-fewshot.md': 'deep-dive/optimizers/bootstrap-fewshot.md' - 'docs/deep-dive/optimizers/BootstrapFinetune.md': 'deep-dive/optimizers/BootstrapFinetune.md' - 'docs/deep-dive/optimizers/Ensemble.md': 'deep-dive/optimizers/Ensemble.md' - 'docs/deep-dive/optimizers/bfrs.md': 'deep-dive/optimizers/bfrs.md' - 'docs/deep-dive/optimizers/copro.md': 'deep-dive/optimizers/copro.md' - 'docs/deep-dive/optimizers/miprov2.md': 'deep-dive/optimizers/miprov2.md' - - # Additional pages redirects - 'docs/faqs.md': 'faqs.md' - 'docs/cheatsheet.md': 'cheatsheet.md' - 'docs/dspy-usecases.md': 'dspy-usecases.md' extra: social: @@ -249,6 +170,7 @@ markdown_extensions: - pymdownx.emoji: emoji_index: !!python/name:material.extensions.emoji.twemoji emoji_generator: !!python/name:materialx.emoji.to_svg + - meta copyright: | - © 2024 Stanford NLP \ No newline at end of file + © 2024 Stanford NLP From 529898b6618205c0dd7f6f96996465568d2abbda Mon Sep 17 00:00:00 2001 From: Amir Mehr Date: Sat, 26 Oct 2024 19:33:42 -0600 Subject: [PATCH 02/13] Refactor navigation structure in mkdocs.yml Organize the navigation by grouping related topics and adding overviews for sections. Update titles for clarity, correcting casing inconsistencies. Split existing entries where applicable to enhance documentation usability. --- docs/mkdocs.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 284f921bde..30aaa98e53 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -21,32 +21,30 @@ nav: - Debugging: tutorials/debugging.md # New file and we can for now just getting it from the FAQs - Components: - Overview: building-blocks/solving_your_task.md - - Language Models: building-blocks/1-language_models.md - - Signatures: building-blocks/2-signatures.md - - Modules: building-blocks/3-modules.md - - Data: building-blocks/4-data.md - Metrics: building-blocks/5-metrics.md - - Optimizers: building-blocks/6-optimizers.md - - Assertions: building-blocks/7-assertions.md - Typed Predictors: building-blocks/8-typed_predictors.md - Data Handling: + - Overview: building-blocks/4-data.md - Examples in DSPy: deep-dive/data-handling/examples.md - Utilizing Built-in Datasets: deep-dive/data-handling/built-in-datasets.md - Creating Custom Dataset: deep-dive/data-handling/loading-custom-data.md - Signatures: + - Overview: building-blocks/2-signatures.md - Understanding Signatures: deep-dive/signature/understanding-signatures.md - Executing Signatures: deep-dive/signature/executing-signatures.md - Modules: + - Overview: building-blocks/3-modules.md - Predict: deep-dive/modules/predict.md - ChainOfThought: deep-dive/modules/chain-of-thought.md - - ChainOfThoughtwithHint: deep-dive/modules/chain-of-thought-with-hint.md + - ChainOfThoughtWithHint: deep-dive/modules/chain-of-thought-with-hint.md - ReAct: deep-dive/modules/react.md - MultiChainComparison: deep-dive/modules/multi-chain-comparison.md - ProgramOfThought: deep-dive/modules/program-of-thought.md - Assertions: deep-dive/modules/assertions.md - - Retreive: deep-dive/modules/retrieve.md + - Retrieve: deep-dive/modules/retrieve.md - Modules Guide: deep-dive/modules/guide.md - Language Model Clients: + - Overview: building-blocks/1-language_models.md - Local Language Model Clients: - HFClientTGI: deep-dive/language_model_clients/lm_local_models/HFClientTGI.md - HFClientVLLM: deep-dive/language_model_clients/lm_local_models/HFClientVLLM.md @@ -71,8 +69,11 @@ nav: - WatsonDiscovery: deep-dive/retrieval_models_clients/WatsonDiscovery.md - WeaviateRM: deep-dive/retrieval_models_clients/WeaviateRM.md - YouRM: deep-dive/retrieval_models_clients/YouRM.md - - Assertions: deep-dive/assertions.md + - Assertions: + - Overview: building-blocks/7-assertions.md + - Assertions: deep-dive/assertions.md - Optimizers (formerly Teleprompters): + - Overview: building-blocks/6-optimizers.md - LabeledFewShot: deep-dive/optimizers/LabeledFewShot.md - BootstrapFewShot: deep-dive/optimizers/bootstrap-fewshot.md - BootstrapFinetune: deep-dive/optimizers/BootstrapFinetune.md @@ -81,7 +82,7 @@ nav: - CoPro: deep-dive/optimizers/copro.md - MIProV2: deep-dive/optimizers/miprov2.md - Community: - - Content & Tutorials: dspy-usecases.md # Existing file + - Use cases & Tutorials: dspy-usecases.md # Existing file - Related Projects: community/related-projects.md # New file and split the dspy-usecases - Companies using DSPy: community/companies-using-dspy.md # New file and split the dspy-usecases - Contributing: # we should bring it from the FAQs From df3d4c49203f5953dc05a4e3132d115e98c4e1cd Mon Sep 17 00:00:00 2001 From: Amir Mehr Date: Sat, 26 Oct 2024 19:44:16 -0600 Subject: [PATCH 03/13] Restructure navigation in mkdocs.yml by adding new sections for Metrics and Assertions, Optimizers, and updating Signatures. Remove redundant entries and clarify module organization. Adjust typo in "Retreive" to "Retrieve" and make minor formatting changes. --- docs/mkdocs.yml | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 30aaa98e53..2097d8d1f4 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -21,28 +21,40 @@ nav: - Debugging: tutorials/debugging.md # New file and we can for now just getting it from the FAQs - Components: - Overview: building-blocks/solving_your_task.md - - Metrics: building-blocks/5-metrics.md - - Typed Predictors: building-blocks/8-typed_predictors.md + - Signatures: + - Overview: building-blocks/2-signatures.md + - Understanding Signatures: deep-dive/signature/understanding-signatures.md + - Executing Signatures: deep-dive/signature/executing-signatures.md - Data Handling: - Overview: building-blocks/4-data.md - Examples in DSPy: deep-dive/data-handling/examples.md - Utilizing Built-in Datasets: deep-dive/data-handling/built-in-datasets.md - Creating Custom Dataset: deep-dive/data-handling/loading-custom-data.md - - Signatures: - - Overview: building-blocks/2-signatures.md - - Understanding Signatures: deep-dive/signature/understanding-signatures.md - - Executing Signatures: deep-dive/signature/executing-signatures.md - Modules: - Overview: building-blocks/3-modules.md - Predict: deep-dive/modules/predict.md + - Typed Predictors: building-blocks/8-typed_predictors.md - ChainOfThought: deep-dive/modules/chain-of-thought.md - - ChainOfThoughtWithHint: deep-dive/modules/chain-of-thought-with-hint.md + - ChainOfThoughtwithHint: deep-dive/modules/chain-of-thought-with-hint.md - ReAct: deep-dive/modules/react.md - MultiChainComparison: deep-dive/modules/multi-chain-comparison.md - ProgramOfThought: deep-dive/modules/program-of-thought.md - Assertions: deep-dive/modules/assertions.md - - Retrieve: deep-dive/modules/retrieve.md + - Retreive: deep-dive/modules/retrieve.md - Modules Guide: deep-dive/modules/guide.md + - Metrics and Assertions: + - Overview: building-blocks/7-assertions.md + - Metrics: building-blocks/5-metrics.md + - Assertions: deep-dive/assertions.md + - Optimizers: + - Overview: building-blocks/6-optimizers.md + - LabeledFewShot: deep-dive/optimizers/LabeledFewShot.md + - BootstrapFewShot: deep-dive/optimizers/bootstrap-fewshot.md + - BootstrapFinetune: deep-dive/optimizers/BootstrapFinetune.md + - Ensemble: deep-dive/optimizers/Ensemble.md + - BFRS: deep-dive/optimizers/bfrs.md + - CoPro: deep-dive/optimizers/copro.md + - MIProV2: deep-dive/optimizers/miprov2.md - Language Model Clients: - Overview: building-blocks/1-language_models.md - Local Language Model Clients: @@ -69,20 +81,9 @@ nav: - WatsonDiscovery: deep-dive/retrieval_models_clients/WatsonDiscovery.md - WeaviateRM: deep-dive/retrieval_models_clients/WeaviateRM.md - YouRM: deep-dive/retrieval_models_clients/YouRM.md - - Assertions: - - Overview: building-blocks/7-assertions.md - - Assertions: deep-dive/assertions.md - - Optimizers (formerly Teleprompters): - - Overview: building-blocks/6-optimizers.md - - LabeledFewShot: deep-dive/optimizers/LabeledFewShot.md - - BootstrapFewShot: deep-dive/optimizers/bootstrap-fewshot.md - - BootstrapFinetune: deep-dive/optimizers/BootstrapFinetune.md - - Ensemble: deep-dive/optimizers/Ensemble.md - - BFRS: deep-dive/optimizers/bfrs.md - - CoPro: deep-dive/optimizers/copro.md - - MIProV2: deep-dive/optimizers/miprov2.md + - Community: - - Use cases & Tutorials: dspy-usecases.md # Existing file + - Usecases & Tutorials: dspy-usecases.md # Existing file - Related Projects: community/related-projects.md # New file and split the dspy-usecases - Companies using DSPy: community/companies-using-dspy.md # New file and split the dspy-usecases - Contributing: # we should bring it from the FAQs From 952e4314ad0939ffeeb3c3991503453306098795 Mon Sep 17 00:00:00 2001 From: Amir Mehr Date: Sat, 26 Oct 2024 19:57:05 -0600 Subject: [PATCH 04/13] Update introductory documentation and enhance MkDocs configuration - Revise title to "# DSPy" in intro.md - Add `hide` options for table of contents and navigation in intro.md - Integrate new navigation features in mkdocs.yml for improved user experience --- docs/docs/intro.md | 6 +++++- docs/mkdocs.yml | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/docs/intro.md b/docs/docs/intro.md index 690734b6a3..a4bbe2b54c 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -1,8 +1,12 @@ --- sidebar_position: 1 +hide: + - toc + - navigation + --- -# About DSPy +# DSPy ![DSPy Logo](static/img/dspy_logo.png) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 2097d8d1f4..53c964eb10 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -98,7 +98,9 @@ theme: custom_dir: overrides features: - navigation.tabs - - toc.integrate + - navigation.path + - navigation.indexes + - toc.follow - navigation.top - search.suggest - search.highlight From 12ed4d9d6b26f078fde32e7e5cdb81fe617cd5db Mon Sep 17 00:00:00 2001 From: Amir Mehr Date: Mon, 28 Oct 2024 16:01:25 -0600 Subject: [PATCH 05/13] Restructure FAQs and tutorials, adding community sections for companies using DSPy and development setup. Update navigation in mkdocs.yml to reflect new content and improve organization. --- community/companies-using-dspy.md | 42 ++++++++++++ docs/docs/community/companies-using-dspy.md | 0 docs/docs/community/development-setup.md | 3 + docs/docs/community/how-to-contribute.md | 7 ++ docs/docs/community/related-projects.md | 76 +++++++++++++++++++++ docs/docs/community/tutorials.md | 56 +++++++++++++++ docs/docs/faqs.md | 8 --- docs/docs/tutorials/debugging.md | 51 ++++++++++++++ docs/mkdocs.yml | 13 ++-- 9 files changed, 241 insertions(+), 15 deletions(-) create mode 100644 community/companies-using-dspy.md create mode 100644 docs/docs/community/companies-using-dspy.md create mode 100644 docs/docs/community/development-setup.md create mode 100644 docs/docs/community/how-to-contribute.md create mode 100644 docs/docs/community/related-projects.md create mode 100644 docs/docs/community/tutorials.md create mode 100644 docs/docs/tutorials/debugging.md diff --git a/community/companies-using-dspy.md b/community/companies-using-dspy.md new file mode 100644 index 0000000000..18c9f38b90 --- /dev/null +++ b/community/companies-using-dspy.md @@ -0,0 +1,42 @@ +# A Few Company Use Cases + +This page showcases organizations that are using DSPy in production environments. From startups to enterprise companies, DSPy is helping teams build better AI applications. + +## Featured Companies + + +| **Name** | **Use Cases** | +|---|---| +| **[JetBlue](https://www.jetblue.com/)** | Multiple chatbot use cases. [Blog](https://www.databricks.com/blog/optimizing-databricks-llm-pipelines-dspy) | +| **[Replit](https://replit.com/)** | Synthesize diffs using code LLMs using a DSPy pipeline. [Blog](https://blog.replit.com/code-repair) | +| **[Databricks](https://www.databricks.com/)** | Research, products, and customer solutions around LM Judges, RAG, classification, and other applications. [Blog](https://www.databricks.com/blog/dspy-databricks) [Blog II](https://www.databricks.com/customers/ddi) | +| **[Sephora](https://www.sephora.com/)** | Undisclosed agent usecases; perspectives shared in [DAIS Session](https://www.youtube.com/watch?v=D2HurSldDkE). | +| **[Zoro UK](https://www.zoro.co.uk/)** | E-commerce applications around structured shopping. [Portkey Session](https://www.youtube.com/watch?v=_vGKSc1tekE) | +| **[VMware](https://www.vmware.com/)** | RAG and other prompt optimization applications. [Interview in The Register.](https://www.theregister.com/2024/02/22/prompt_engineering_ai_models/) [Business Insider.](https://www.businessinsider.com/chaptgpt-large-language-model-ai-prompt-engineering-automated-optimizer-2024-3) | +| **[Haize Labs](https://www.haizelabs.com/)** | Automated red-teaming for LLMs. [Blog](https://blog.haizelabs.com/posts/dspy/) | +| **[Plastic Labs](https://www.plasticlabs.ai/)** | Different pipelines within Honcho. [Blog](https://blog.plasticlabs.ai/blog/User-State-is-State-of-the-Art) | +| **[PingCAP](https://pingcap.com/)** | Building a knowledge graph. [Article](https://www.pingcap.com/article/building-a-graphrag-from-wikipedia-page-using-dspy-openai-and-tidb-vector-database/) | +| **[Salomatic](https://langtrace.ai/blog/case-study-how-salomatic-used-langtrace-to-build-a-reliable-medical-report-generation-system)** | Enriching medical reports using DSPy. [Blog](https://langtrace.ai/blog/case-study-how-salomatic-used-langtrace-to-build-a-reliable-medical-report-generation-system) | +| **[Truelaw](https://www.youtube.com/watch?v=O0F3RAWZNfM)** | How Truelaw builds bespoke LLM pipelines for law firms using DSPy. [Podcast](https://www.youtube.com/watch?v=O0F3RAWZNfM) | +| **[Moody's](https://www.moodys.com/)** | Leveraging DSPy to optimize RAG systems, LLM-as-a-Judge, and agentic systems for financial workflows. | +| **[Normal Computing](https://www.normalcomputing.com/)** | Translate specs from chip companies from English to intermediate formal languages | +| **[Procure.FYI](https://www.procure.fyi/)** | Process messy, publicly available technology spending and pricing data via DSPy. | +| **[RadiantLogic](https://www.radiantlogic.com/)** | AI Data Assistant. DSPy is used for the agent that routes the query, the context extraction module, the text-to-sql conversion engine, and the table summarization module. | +| **[Raia](https://raiahealth.com/)** | Using DSPy for AI-powered Personal Healthcare Agents. | +| **[Hyperlint](https://hyperlint.com)** | Uses DSPy to generate technical documentation. DSPy helps to fetch relevant information and synthesize that into tutorials. | +| **[Starops](https://staropshq.com/) & [Saya](https://heysaya.ai/)** | Building research documents given a user's corpus. Generate prompts to create more articles from example articles. | +| **[Tessel AI](https://tesselai.com/)** | Enhancing human-machine interaction with data use cases. | +| **[Dicer.ai](https://dicer.ai/)** | Uses DSPy for marketing AI to get the most from their paid ads. | +| **[Howie](https://howie.ai)** | Using DSPy to automate meeting scheduling through email. | +| **[Isoform.ai](https://isoform.ai)** | Building custom integrations using DSPy. | +| **[Trampoline AI](https://trampoline.ai)** | Uses DSPy to power their data-augmentation and LM pipelines. | +| **[Pretrain](https://pretrain.com)** | Uses DSPy to automatically optimize AI performance towards user-defined tasks based on uploaded examples. | + +WIP. This list mainly includes companies that have public posts or have OKed being included for specific products so far. + +## Adding Your Company + +If you would like to add your company to this list, please make a PR with the following information: +- Company name and website +- Brief description of how you're using DSPy +- Any public blogs, talks, or resources about your usage \ No newline at end of file diff --git a/docs/docs/community/companies-using-dspy.md b/docs/docs/community/companies-using-dspy.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/docs/community/development-setup.md b/docs/docs/community/development-setup.md new file mode 100644 index 0000000000..355b5f5cdb --- /dev/null +++ b/docs/docs/community/development-setup.md @@ -0,0 +1,3 @@ +## Development Setup + +We are working on a development setup guide. If you're interested in contributing, please reach out to us on Discord. diff --git a/docs/docs/community/how-to-contribute.md b/docs/docs/community/how-to-contribute.md new file mode 100644 index 0000000000..65a0f98d50 --- /dev/null +++ b/docs/docs/community/how-to-contribute.md @@ -0,0 +1,7 @@ +## Contributing + +**What if I have a better idea for prompting or synthetic data generation?** Perfect. We encourage you to think if it's best expressed as a module or an optimizer, and we'd love to merge it in DSPy so everyone can use it. DSPy is not a complete project; it's an ongoing effort to create structure (modules and optimizers) in place of hacky prompt and pipeline engineering tricks. + +**How can I add my favorite LM or vector store?** + +Check out these walkthroughs on setting up a [Custom LM client](/deep-dive/language_model_clients/custom-lm-client) and [Custom RM client](/deep-dive/retrieval_models_clients/custom-rm-client). diff --git a/docs/docs/community/related-projects.md b/docs/docs/community/related-projects.md new file mode 100644 index 0000000000..67d08d45e5 --- /dev/null +++ b/docs/docs/community/related-projects.md @@ -0,0 +1,76 @@ +# DSPy Use Cases + +We often get questions like "How are people using DSPy in practice?", both in production and for research. This list was created to collect a few pointers and to encourage others in the community to add their own work below. + +This list is ever expanding and highly incomplete (WIP)! We'll be adding a bunch more. If you would like to add your product or research to this list, please make a PR. + + +## A Few Papers Using DSPy + +| **Name** | **Description** | +|---|---| +| **[STORM](https://arxiv.org/abs/2402.14207)** | Writing Wikipedia-like Articles From Scratch. | +| **[PATH](https://arxiv.org/abs/2406.11706)** | Prompts as Auto-Optimized Training Hyperparameters: Training Best-in-Class IR Models from Scratch with 10 Gold Labels | +| **[WangLab @ MEDIQA](https://arxiv.org/abs/2404.14544)** | UofT's winning system at MEDIQA, outperforms the next best system by 20 points | +| **[UMD's Suicide Detection System](https://arxiv.org/abs/2406.06608)** | Outperforms 20-hour expert human prompt engineering by 40% | +| **[IReRa](https://arxiv.org/abs/2401.12178)** | Infer-Retrieve-Rank: Extreme Classification with > 10,000 Labels | +| **[Unreasonably Effective Eccentric Prompts](https://arxiv.org/abs/2402.10949v2)** | General Prompt Optimization | +| **[Palimpzest](https://arxiv.org/abs/2405.14696)** | A Declarative System for Optimizing AI Workloads | +| **[AI Agents that Matter](https://arxiv.org/abs/2407.01502v1)** | Agent Efficiency Optimization | +| **[EDEN](https://arxiv.org/abs/2406.17982v1)** | Empathetic Dialogues for English Learning: Uses adaptive empathetic feedback to improve student grit | +| **[ECG-Chat](https://arxiv.org/pdf/2408.08849)** | Uses DSPy with GraphRAG for medical report generation | +| **[DSPy Assertions](https://arxiv.org/abs/2312.13382)** | Various applications of imposing hard and soft constraints on LM outputs | +| **[DSPy Guardrails](https://boxiyu.github.io/assets/pdf/DSPy_Guardrails.pdf)** | Reduce the attack success rate of CodeAttack, decreasing from 75% to 5% | +| **[Co-STORM](https://arxiv.org/pdf/2408.15232)** | Collaborative STORM: Generate Wikipedia-like articles through collaborative discourse among users and multiple LM agents | + +## A Few Repositories (or other OSS examples) using DSPy + +| **Name** | **Description/Link** | +|---|---| +| **Stanford CS 224U Homework** | [Github](https://github.com/cgpotts/cs224u/blob/main/hw_openqa.ipynb) | +| **STORM Report Generation (10,000 GitHub stars)** | [Github](https://github.com/stanford-oval/storm) | +| **DSPy Redteaming** | [Github](https://github.com/haizelabs/dspy-redteam) | +| **DSPy Theory of Mind** | [Github](https://github.com/plastic-labs/dspy-opentom) | +| **Indic cross-lingual Natural Language Inference** | [Github](https://github.com/saifulhaq95/DSPy-Indic/blob/main/indicxlni.ipynb) | +| **Optimizing LM for Text2SQL using DSPy** | [Github](https://github.com/jjovalle99/DSPy-Text2SQL) | +| **DSPy PII Masking Demo by Eric Ness** | [Colab](https://colab.research.google.com/drive/1KZR1sGTp_RLWUJPAiK1FKPKI-Qn9neUm?usp=sharing) | +| **DSPy on BIG-Bench Hard Example** | [Github](https://drchrislevy.github.io/posts/dspy/dspy.html) | +| **Building a chess playing agent using DSPy** | [Github](https://medium.com/thoughts-on-machine-learning/building-a-chess-playing-agent-using-dspy-9b87c868f71e) | +| **Ittia Research Fact Checking** | [Github](https://github.com/ittia-research/check) | +| **Strategic Debate via Tree-of-Thought** | [Github](https://github.com/zbambergerNLP/strategic-debate-tot) | +| **Sanskrit to English Translation App**| [Github](https://github.com/ganarajpr/sanskrit-translator-dspy) | +| **DSPy for extracting features from PDFs on arXiv**| [Github](https://github.com/S1M0N38/dspy-arxiv) | +| **DSPygen: DSPy in Ruby on Rails**| [Github](https://github.com/seanchatmangpt/dspygen) | +| **DSPy Inspector**| [Github](https://github.com/Neoxelox/dspy-inspector) | +| **DSPy with FastAPI**| [Github](https://github.com/diicellman/dspy-rag-fastapi) | +| **DSPy for Indian Languages**| [Github](https://github.com/saifulhaq95/DSPy-Indic) | +| **Hurricane: Blog Posts with Generative Feedback Loops!**| [Github](https://github.com/weaviate-tutorials/Hurricane) | +| **RAG example using DSPy, Gradio, FastAPI, and Ollama**| [Github](https://github.com/diicellman/dspy-gradio-rag) | +| **Synthetic Data Generation**| [Github](https://colab.research.google.com/drive/1CweVOu0qhTC0yOfW5QkLDRIKuAuWJKEr?usp=sharing) | +| **Self Discover**| [Github](https://colab.research.google.com/drive/1GkAQKmw1XQgg5UNzzy8OncRe79V6pADB?usp=sharing) | + +TODO: This list in particular is highly incomplete. There are a couple dozen other good ones. + +## A Few Providers, Integrations, and related Blog Releases + +| **Name** | **Link** | +|---|---| +| **Databricks** | [Link](https://www.databricks.com/blog/dspy-databricks) | +| **Zenbase** | [Link](https://zenbase.ai/) | +| **LangWatch** | [Link](https://langwatch.ai/blog/introducing-dspy-visualizer) | +| **Gradient** | [Link](https://gradient.ai/blog/achieving-gpt-4-level-performance-at-lower-cost-using-dspy) | +| **Snowflake** | [Link](https://medium.com/snowflake/dspy-snowflake-140d6d947d73) | +| **Langchain** | [Link](https://python.langchain.com/v0.2/docs/integrations/providers/dspy/) | +| **Weaviate** | [Link](https://weaviate.io/blog/dspy-optimizers) | +| **Qdrant** | [Link](https://qdrant.tech/documentation/frameworks/dspy/) | +| **Weights & Biases Weave** | [Link](https://weave-docs.wandb.ai/guides/integrations/dspy/) | +| **Milvus** | [Link](https://milvus.io/docs/integrate_with_dspy.md) | +| **Neo4j** | [Link](https://neo4j.com/labs/genai-ecosystem/dspy/) | +| **Lightning AI** | [Link](https://lightning.ai/lightning-ai/studios/dspy-programming-with-foundation-models) | +| **Haystack** | [Link](https://towardsdatascience.com/automating-prompt-engineering-with-dspy-and-haystack-926a637a3f43) | +| **Arize** | [Link](https://docs.arize.com/phoenix/tracing/integrations-tracing/dspy) | +| **LlamaIndex** | [Link](https://github.com/stanfordnlp/dspy/blob/main/examples/llamaindex/dspy_llamaindex_rag.ipynb) | +| **Langtrace** | [Link](https://docs.langtrace.ai/supported-integrations/llm-frameworks/dspy) | +| **Langfuse** | [Link](https://langfuse.com/docs/integrations/dspy) | + +Credit: Some of these resources were originally compiled in the [Awesome DSPy](https://github.com/ganarajpr/awesome-dspy/tree/master) repo. \ No newline at end of file diff --git a/docs/docs/community/tutorials.md b/docs/docs/community/tutorials.md new file mode 100644 index 0000000000..173fe7d85e --- /dev/null +++ b/docs/docs/community/tutorials.md @@ -0,0 +1,56 @@ +# Tutorials + +This is the list of tutorials and blog posts on DSPy. If you would like to add your own tutorial, please make a PR. + + +## A Few Blogs & Videos on using DSPy + + + +### Blogs + +| **Name** | **Link** | +|---|---| +| **Why I bet on DSPy** | [Blog](https://blog.isaacbmiller.com/posts/dspy) | +| **Not Your Average Prompt Engineering** | [Blog](https://jina.ai/news/dspy-not-your-average-prompt-engineering/) | +| **Why I'm excited about DSPy** | [Blog](https://substack.stephen.so/p/why-im-excited-about-dspy) | +| **Achieving GPT-4 Performance at Lower Cost** | [Link](https://gradient.ai/blog/achieving-gpt-4-level-performance-at-lower-cost-using-dspy) | +| **Prompt engineering is a task best left to AI models** | [Link](https://www.theregister.com/2024/02/22/prompt_engineering_ai_models/) | +| **What makes DSPy a valuable framework for developing complex language model pipelines?** | [Link](https://medium.com/@sujathamudadla1213/what-makes-dspy-a-valuable-framework-for-developing-complex-language-model-pipelines-edfa5b4bcf9b) | +| **DSPy: A new framework to program your foundation models just by prompting** | [Link](https://www.linkedin.com/pulse/dspy-new-framework-program-your-foundation-models-just-prompting-lli4c/) | +| **Intro to DSPy: Goodbye Prompting, Hello Programming** | [Link](https://medium.com/towards-data-science/intro-to-dspy-goodbye-prompting-hello-programming-4ca1c6ce3eb9) | +| **DSPyGen: Revolutionizing AI** | [Link](https://www.linkedin.com/pulse/launch-alert-dspygen-20242252-revolutionizing-ai-sean-chatman--g9f1c/) | +| **Building an AI Assistant with DSPy** | [Link](https://www.linkedin.com/pulse/building-ai-assistant-dspy-valliappa-lakshmanan-vgnsc/) | + + +### Videos +| **Name** | **Link** | +|---|---| +| **DSPy Explained! (60K views)** | [Link](https://www.youtube.com/watch?v=41EfOY0Ldkc) | +| **DSPy Intro from Sephora (25K views)** | [Link](https://www.youtube.com/watch?v=D2HurSldDkE) | +| **Structured Outputs with DSPy** | [Link](https://www.youtube.com/watch?v=tVw3CwrN5-8) | +| **DSPy and ColBERT - Weaviate Podcast** | [Link](https://www.youtube.com/watch?v=CDung1LnLbY) | +| **SBTB23 DSPy** | [Link](https://www.youtube.com/watch?v=Dt3H2ninoeY) | +| **Optimization with DSPy and LangChain** | [Link](https://www.youtube.com/watch?v=4EXOmWeqXRc) | +| **Automated Prompt Engineering + Visualization** | [Link](https://www.youtube.com/watch?v=eAZ2LtJ6D5k) | +| **Transforming LM Calls into Pipelines** | [Link](https://www.youtube.com/watch?v=NoaDWKHdkHg) | +| **NeurIPS Hacker Cup: DSPy for Code Gen** | [Link](https://www.youtube.com/watch?v=gpe-rtJN8z8) | +| **MIPRO and DSPy - Weaviate Podcast** | [Link](https://www.youtube.com/watch?v=skMH3DOV_UQ) | +| **Getting Started with RAG in DSPy** | [Link](https://www.youtube.com/watch?v=CEuUG4Umfxs) | +| **Adding Depth to DSPy Programs** | [Link](https://www.youtube.com/watch?v=0c7Ksd6BG88) | +| **Programming Foundation Models with DSPy** | [Link](https://www.youtube.com/watch?v=Y94tw4eDHW0) | +| **DSPy End-to-End: SF Meetup** | [Link](https://www.youtube.com/watch?v=Y81DoFmt-2U) | +| **Monitoring & Tracing DSPy with Langtrace** | [Link](https://langtrace.ai/blog/announcing-dspy-support-in-langtrace) | +| **Teaching chat models to solve chess puzzles using DSPy + Finetuning** | [Link](https://raw.sh/posts/chess_puzzles) | + + +### Podcasts + +Weaviate has a directory of 10 amazing notebooks and 6 podcasts! +Huge shoutout to them for the massive support ❤️. See the [Weaviate DSPy directory](https://weaviate.io/developers/weaviate/more-resources/dspy). + + +TODO: This list in particular is highly incomplete. There are dozens of other good ones. To allow space, divide into opintionated blogs / podcasts / interviews vs. tutorials & talks. + +Credit: Some of these resources were originally compiled in the [Awesome DSPy](https://github.com/ganarajpr/awesome-dspy/tree/master) repo. + diff --git a/docs/docs/faqs.md b/docs/docs/faqs.md index 5f38a74c98..2379b714d1 100644 --- a/docs/docs/faqs.md +++ b/docs/docs/faqs.md @@ -165,11 +165,3 @@ with dspy.context(backoff_time = ..): ``` At times, DSPy may have hard-coded arguments that are not relevant for your compatible, in which case, please free to open a PR alerting this or comment out these default settings for your usage. - -## Contributing - -**What if I have a better idea for prompting or synthetic data generation?** Perfect. We encourage you to think if it's best expressed as a module or an optimizer, and we'd love to merge it in DSPy so everyone can use it. DSPy is not a complete project; it's an ongoing effort to create structure (modules and optimizers) in place of hacky prompt and pipeline engineering tricks. - -**How can I add my favorite LM or vector store?** - -Check out these walkthroughs on setting up a [Custom LM client](/deep-dive/language_model_clients/custom-lm-client) and [Custom RM client](/deep-dive/retrieval_models_clients/custom-rm-client). diff --git a/docs/docs/tutorials/debugging.md b/docs/docs/tutorials/debugging.md new file mode 100644 index 0000000000..754fd017ed --- /dev/null +++ b/docs/docs/tutorials/debugging.md @@ -0,0 +1,51 @@ +# Debugging DSPy Programs + +## Common Issues and Solutions + +### Context Length Errors + +If you're encountering "context too long" errors in DSPy, this typically happens when using DSPy optimizers that include demonstrations within your prompt, exceeding your current context window. Here are some solutions: + +1. **Reduce demonstration parameters**: + - Lower `max_bootstrapped_demos` and `max_labeled_demos` in your optimizer settings + - Reduce the number of retrieved passages/documents/embeddings + +2. **Increase token limit**: + ```python + lm = dspy.OpenAI(model="gpt-4", max_tokens=2048) # Adjust max_tokens as needed + ``` + +### Timeouts and Backoff Errors + +When dealing with timeout or backoff errors: + +1. **Check provider status**: + - Verify your LM/RM provider status + - Ensure you have sufficient rate limits + +2. **Adjust thread count**: + - Reduce the number of concurrent threads to prevent server overload + +3. **Configure backoff settings**: + ```python + # Global configuration + dspy.settings.configure(backoff_time=...) + + # Provider-specific configuration + with dspy.context(backoff_time=...): + dspy.OpenAI(...) + ``` + +### Caching Issues + +To manage caching in DSPy: + +1. **Disable cache**: + ```python + dspy.LM('openai/gpt-4', cache=False) + ``` + +2. **Set cache directory**: + ```python + os.environ["DSP_NOTEBOOK_CACHE"] = os.path.join(os.getcwd(), ".dspy_cache") + ``` diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 53c964eb10..568d1528ea 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -18,7 +18,7 @@ nav: - Summarization: tutorials/summarization.md - Additional Resources: tutorials/other_tutorial.md - Examples: tutorials/examples.md - - Debugging: tutorials/debugging.md # New file and we can for now just getting it from the FAQs + - Debugging: tutorials/debugging.md - Components: - Overview: building-blocks/solving_your_task.md - Signatures: @@ -83,13 +83,12 @@ nav: - YouRM: deep-dive/retrieval_models_clients/YouRM.md - Community: - - Usecases & Tutorials: dspy-usecases.md # Existing file - - Related Projects: community/related-projects.md # New file and split the dspy-usecases - - Companies using DSPy: community/companies-using-dspy.md # New file and split the dspy-usecases - - Contributing: # we should bring it from the FAQs + - Tutorials: community/tutorials.md + - Use Cases: community/related-projects.md + - Contributing: - Roadmap: roadmap.md - - How to get involved: community/how-to-contribute.md # New file - - Development setup: community/development-setup.md # New file + - How to get involved: community/how-to-contribute.md + - Development setup: community/development-setup.md - FAQ: faqs.md - Cheatsheet: cheatsheet.md From 2f5236cd1f6c02b0056ff158e2754cc2da64c84d Mon Sep 17 00:00:00 2001 From: Amir Mehr Date: Mon, 28 Oct 2024 16:04:54 -0600 Subject: [PATCH 06/13] Add comprehensive redirect maps to mkdocs configuration Expand the `redirects` section in `mkdocs.yml` by adding multiple redirect mappings to streamline navigation across various documentation sections, including Quick Start, Building Blocks, Tutorials, and Deep Dive topics. --- docs/mkdocs.yml | 89 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 568d1528ea..325209ac04 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -135,14 +135,103 @@ plugins: - mkdocstrings - blog - mkdocs-jupyter + - redirects: + redirect_maps: - redirects: redirect_maps: 'index.md': 'intro.md' + # Intro page redirects + 'docs/intro.md': 'intro.md' + 'docs/intro/index.md': 'intro.md' + + + # Quick Start redirects + 'docs/quick-start/installation.md': 'quick-start/installation.md' + 'docs/quick-start/getting-started-01.md': 'quick-start/getting-started-01.md' + 'docs/quick-start/getting-started-02.md': 'quick-start/getting-started-02.md' + + # Building Blocks redirects + 'docs/building-blocks/solving_your_task.md': 'building-blocks/solving_your_task.md' + 'docs/building-blocks/1-language_models.md': 'building-blocks/1-language_models.md' + 'docs/building-blocks/2-signatures.md': 'building-blocks/2-signatures.md' + 'docs/building-blocks/3-modules.md': 'building-blocks/3-modules.md' + 'docs/building-blocks/4-data.md': 'building-blocks/4-data.md' + 'docs/building-blocks/5-metrics.md': 'building-blocks/5-metrics.md' + 'docs/building-blocks/6-optimizers.md': 'building-blocks/6-optimizers.md' + 'docs/building-blocks/7-assertions.md': 'building-blocks/7-assertions.md' + 'docs/building-blocks/8-typed_predictors.md': 'building-blocks/8-typed_predictors.md' + + # Tutorials redirects 'docs/tutorials/rag.md': 'tutorials/rag.md' 'docs/tutorials/simplified-baleen.md': 'tutorials/simplified-baleen.md' 'docs/tutorials/summarization.md': 'tutorials/summarization.md' 'docs/tutorials/other_tutorial.md': 'tutorials/other_tutorial.md' 'docs/tutorials/examples.md': 'tutorials/examples.md' + + # Deep Dive redirects + # Data Handling + 'docs/deep-dive/data-handling/examples.md': 'deep-dive/data-handling/examples.md' + 'docs/deep-dive/data-handling/built-in-datasets.md': 'deep-dive/data-handling/built-in-datasets.md' + 'docs/deep-dive/data-handling/loading-custom-data.md': 'deep-dive/data-handling/loading-custom-data.md' + + # Signatures + 'docs/deep-dive/signature/understanding-signatures.md': 'deep-dive/signature/understanding-signatures.md' + 'docs/deep-dive/signature/executing-signatures.md': 'deep-dive/signature/executing-signatures.md' + + # Modules + 'docs/deep-dive/modules/predict.md': 'deep-dive/modules/predict.md' + 'docs/deep-dive/modules/chain-of-thought.md': 'deep-dive/modules/chain-of-thought.md' + 'docs/deep-dive/modules/chain-of-thought-with-hint.md': 'deep-dive/modules/chain-of-thought-with-hint.md' + 'docs/deep-dive/modules/react.md': 'deep-dive/modules/react.md' + 'docs/deep-dive/modules/multi-chain-comparison.md': 'deep-dive/modules/multi-chain-comparison.md' + 'docs/deep-dive/modules/program-of-thought.md': 'deep-dive/modules/program-of-thought.md' + 'docs/deep-dive/modules/assertions.md': 'building-blocks/7-assertions.md' + 'deep-dive/modules/assertions.md': 'building-blocks/7-assertions.md' + 'docs/deep-dive/modules/retrieve.md': 'deep-dive/modules/retrieve.md' + 'docs/deep-dive/modules/guide.md': 'deep-dive/modules/guide.md' + + # Language Model Clients + 'docs/deep-dive/language_model_clients/lm_local_models/HFClientTGI.md': 'deep-dive/language_model_clients/lm_local_models/HFClientTGI.md' + 'docs/deep-dive/language_model_clients/lm_local_models/HFClientVLLM.md': 'deep-dive/language_model_clients/lm_local_models/HFClientVLLM.md' + 'docs/deep-dive/language_model_clients/lm_local_models/MLC.md': 'deep-dive/language_model_clients/lm_local_models/MLC.md' + 'docs/deep-dive/language_model_clients/lm_local_models/Ollama.md': 'deep-dive/language_model_clients/lm_local_models/Ollama.md' + 'docs/deep-dive/language_model_clients/lm_local_models/LlamaCpp.md': 'deep-dive/language_model_clients/lm_local_models/LlamaCpp.md' + 'docs/deep-dive/language_model_clients/lm_local_models/TensorRTLLM.md': 'deep-dive/language_model_clients/lm_local_models/TensorRTLLM.md' + + # Retrieval Model Clients + 'docs/deep-dive/retrieval_models_clients/Azure.md': 'deep-dive/retrieval_models_clients/Azure.md' + 'docs/deep-dive/retrieval_models_clients/ChromadbRM.md': 'deep-dive/retrieval_models_clients/ChromadbRM.md' + 'docs/deep-dive/retrieval_models_clients/ColBERTv2.md': 'deep-dive/retrieval_models_clients/ColBERTv2.md' + 'docs/deep-dive/retrieval_models_clients/custom-rm-client.md': 'deep-dive/retrieval_models_clients/custom-rm-client.md' + 'docs/deep-dive/retrieval_models_clients/DatabricksRM.md': 'deep-dive/retrieval_models_clients/DatabricksRM.md' + 'docs/deep-dive/retrieval_models_clients/FaissRM.md': 'deep-dive/retrieval_models_clients/FaissRM.md' + 'docs/deep-dive/retrieval_models_clients/LancedbRM.md': 'deep-dive/retrieval_models_clients/LancedbRM.md' + 'docs/deep-dive/retrieval_models_clients/MilvusRM.md': 'deep-dive/retrieval_models_clients/MilvusRM.md' + 'docs/deep-dive/retrieval_models_clients/MyScaleRM.md': 'deep-dive/retrieval_models_clients/MyScaleRM.md' + 'docs/deep-dive/retrieval_models_clients/Neo4jRM.md': 'deep-dive/retrieval_models_clients/Neo4jRM.md' + 'docs/deep-dive/retrieval_models_clients/QdrantRM.md': 'deep-dive/retrieval_models_clients/QdrantRM.md' + 'docs/deep-dive/retrieval_models_clients/RAGatouilleRM.md': 'deep-dive/retrieval_models_clients/RAGatouilleRM.md' + 'docs/deep-dive/retrieval_models_clients/SnowflakeRM.md': 'deep-dive/retrieval_models_clients/SnowflakeRM.md' + 'docs/deep-dive/retrieval_models_clients/WatsonDiscovery.md': 'deep-dive/retrieval_models_clients/WatsonDiscovery.md' + 'docs/deep-dive/retrieval_models_clients/WeaviateRM.md': 'deep-dive/retrieval_models_clients/WeaviateRM.md' + 'docs/deep-dive/retrieval_models_clients/YouRM.md': 'deep-dive/retrieval_models_clients/YouRM.md' + + # Assertions + 'docs/deep-dive/assertions.md': 'deep-dive/assertions.md' + + # Teleprompters + 'docs/deep-dive/optimizers/LabeledFewShot.md': 'deep-dive/optimizers/LabeledFewShot.md' + 'docs/deep-dive/optimizers/bootstrap-fewshot.md': 'deep-dive/optimizers/bootstrap-fewshot.md' + 'docs/deep-dive/optimizers/BootstrapFinetune.md': 'deep-dive/optimizers/BootstrapFinetune.md' + 'docs/deep-dive/optimizers/Ensemble.md': 'deep-dive/optimizers/Ensemble.md' + 'docs/deep-dive/optimizers/bfrs.md': 'deep-dive/optimizers/bfrs.md' + 'docs/deep-dive/optimizers/copro.md': 'deep-dive/optimizers/copro.md' + 'docs/deep-dive/optimizers/miprov2.md': 'deep-dive/optimizers/miprov2.md' + + # Additional pages redirects + 'docs/faqs.md': 'faqs.md' + 'docs/cheatsheet.md': 'cheatsheet.md' + 'docs/dspy-usecases.md': 'dspy-usecases.md' extra: From a24cd27e7705c274b5add40bf6b0331cef532987 Mon Sep 17 00:00:00 2001 From: Amir Mehr Date: Mon, 28 Oct 2024 16:06:13 -0600 Subject: [PATCH 07/13] Remove unnecessary indentation from redirects plugin configuration in mkdocs.yml. --- docs/mkdocs.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 325209ac04..7ad74475b5 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -135,8 +135,6 @@ plugins: - mkdocstrings - blog - mkdocs-jupyter - - redirects: - redirect_maps: - redirects: redirect_maps: 'index.md': 'intro.md' From 58a6d7580164f47c3e93c137ca4e01e2a749e67f Mon Sep 17 00:00:00 2001 From: Amir Mehr Date: Mon, 28 Oct 2024 16:06:39 -0600 Subject: [PATCH 08/13] Remove unused markdown extension from MkDocs configuration --- docs/mkdocs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 7ad74475b5..d976849dc5 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -260,7 +260,6 @@ markdown_extensions: - pymdownx.emoji: emoji_index: !!python/name:material.extensions.emoji.twemoji emoji_generator: !!python/name:materialx.emoji.to_svg - - meta copyright: | © 2024 Stanford NLP From 7cd6d8ff1cfef12b873bdd2b8d7c6f6b43c07064 Mon Sep 17 00:00:00 2001 From: Amir Mehr Date: Wed, 30 Oct 2024 11:53:31 -0600 Subject: [PATCH 09/13] Refactor related-projects.md to rename section and expand use cases list - Change title from "DSPy Use Cases" to "Use Cases" - Add a detailed table of use cases from various companies, including links to relevant blogs and articles - Update mkdocs.yml to rename "Tutorials" to "Community Resources" under the Community section --- community/companies-using-dspy.md | 42 ------------------------- docs/docs/community/related-projects.md | 35 +++++++++++++++++++-- docs/docs/community/tutorials.md | 2 +- docs/mkdocs.yml | 2 +- 4 files changed, 35 insertions(+), 46 deletions(-) delete mode 100644 community/companies-using-dspy.md diff --git a/community/companies-using-dspy.md b/community/companies-using-dspy.md deleted file mode 100644 index 18c9f38b90..0000000000 --- a/community/companies-using-dspy.md +++ /dev/null @@ -1,42 +0,0 @@ -# A Few Company Use Cases - -This page showcases organizations that are using DSPy in production environments. From startups to enterprise companies, DSPy is helping teams build better AI applications. - -## Featured Companies - - -| **Name** | **Use Cases** | -|---|---| -| **[JetBlue](https://www.jetblue.com/)** | Multiple chatbot use cases. [Blog](https://www.databricks.com/blog/optimizing-databricks-llm-pipelines-dspy) | -| **[Replit](https://replit.com/)** | Synthesize diffs using code LLMs using a DSPy pipeline. [Blog](https://blog.replit.com/code-repair) | -| **[Databricks](https://www.databricks.com/)** | Research, products, and customer solutions around LM Judges, RAG, classification, and other applications. [Blog](https://www.databricks.com/blog/dspy-databricks) [Blog II](https://www.databricks.com/customers/ddi) | -| **[Sephora](https://www.sephora.com/)** | Undisclosed agent usecases; perspectives shared in [DAIS Session](https://www.youtube.com/watch?v=D2HurSldDkE). | -| **[Zoro UK](https://www.zoro.co.uk/)** | E-commerce applications around structured shopping. [Portkey Session](https://www.youtube.com/watch?v=_vGKSc1tekE) | -| **[VMware](https://www.vmware.com/)** | RAG and other prompt optimization applications. [Interview in The Register.](https://www.theregister.com/2024/02/22/prompt_engineering_ai_models/) [Business Insider.](https://www.businessinsider.com/chaptgpt-large-language-model-ai-prompt-engineering-automated-optimizer-2024-3) | -| **[Haize Labs](https://www.haizelabs.com/)** | Automated red-teaming for LLMs. [Blog](https://blog.haizelabs.com/posts/dspy/) | -| **[Plastic Labs](https://www.plasticlabs.ai/)** | Different pipelines within Honcho. [Blog](https://blog.plasticlabs.ai/blog/User-State-is-State-of-the-Art) | -| **[PingCAP](https://pingcap.com/)** | Building a knowledge graph. [Article](https://www.pingcap.com/article/building-a-graphrag-from-wikipedia-page-using-dspy-openai-and-tidb-vector-database/) | -| **[Salomatic](https://langtrace.ai/blog/case-study-how-salomatic-used-langtrace-to-build-a-reliable-medical-report-generation-system)** | Enriching medical reports using DSPy. [Blog](https://langtrace.ai/blog/case-study-how-salomatic-used-langtrace-to-build-a-reliable-medical-report-generation-system) | -| **[Truelaw](https://www.youtube.com/watch?v=O0F3RAWZNfM)** | How Truelaw builds bespoke LLM pipelines for law firms using DSPy. [Podcast](https://www.youtube.com/watch?v=O0F3RAWZNfM) | -| **[Moody's](https://www.moodys.com/)** | Leveraging DSPy to optimize RAG systems, LLM-as-a-Judge, and agentic systems for financial workflows. | -| **[Normal Computing](https://www.normalcomputing.com/)** | Translate specs from chip companies from English to intermediate formal languages | -| **[Procure.FYI](https://www.procure.fyi/)** | Process messy, publicly available technology spending and pricing data via DSPy. | -| **[RadiantLogic](https://www.radiantlogic.com/)** | AI Data Assistant. DSPy is used for the agent that routes the query, the context extraction module, the text-to-sql conversion engine, and the table summarization module. | -| **[Raia](https://raiahealth.com/)** | Using DSPy for AI-powered Personal Healthcare Agents. | -| **[Hyperlint](https://hyperlint.com)** | Uses DSPy to generate technical documentation. DSPy helps to fetch relevant information and synthesize that into tutorials. | -| **[Starops](https://staropshq.com/) & [Saya](https://heysaya.ai/)** | Building research documents given a user's corpus. Generate prompts to create more articles from example articles. | -| **[Tessel AI](https://tesselai.com/)** | Enhancing human-machine interaction with data use cases. | -| **[Dicer.ai](https://dicer.ai/)** | Uses DSPy for marketing AI to get the most from their paid ads. | -| **[Howie](https://howie.ai)** | Using DSPy to automate meeting scheduling through email. | -| **[Isoform.ai](https://isoform.ai)** | Building custom integrations using DSPy. | -| **[Trampoline AI](https://trampoline.ai)** | Uses DSPy to power their data-augmentation and LM pipelines. | -| **[Pretrain](https://pretrain.com)** | Uses DSPy to automatically optimize AI performance towards user-defined tasks based on uploaded examples. | - -WIP. This list mainly includes companies that have public posts or have OKed being included for specific products so far. - -## Adding Your Company - -If you would like to add your company to this list, please make a PR with the following information: -- Company name and website -- Brief description of how you're using DSPy -- Any public blogs, talks, or resources about your usage \ No newline at end of file diff --git a/docs/docs/community/related-projects.md b/docs/docs/community/related-projects.md index 67d08d45e5..bbdf3fbe47 100644 --- a/docs/docs/community/related-projects.md +++ b/docs/docs/community/related-projects.md @@ -1,9 +1,40 @@ -# DSPy Use Cases +# Use Cases We often get questions like "How are people using DSPy in practice?", both in production and for research. This list was created to collect a few pointers and to encourage others in the community to add their own work below. This list is ever expanding and highly incomplete (WIP)! We'll be adding a bunch more. If you would like to add your product or research to this list, please make a PR. +## A Few Company Use Cases + +| **Name** | **Use Cases** | +|---|---| +| **[JetBlue](https://www.jetblue.com/)** | Multiple chatbot use cases. [Blog](https://www.databricks.com/blog/optimizing-databricks-llm-pipelines-dspy) | +| **[Replit](https://replit.com/)** | Synthesize diffs using code LLMs using a DSPy pipeline. [Blog](https://blog.replit.com/code-repair) | +| **[Databricks](https://www.databricks.com/)** | Research, products, and customer solutions around LM Judges, RAG, classification, and other applications. [Blog](https://www.databricks.com/blog/dspy-databricks) [Blog II](https://www.databricks.com/customers/ddi) | +| **[Sephora](https://www.sephora.com/)** | Undisclosed agent usecases; perspectives shared in [DAIS Session](https://www.youtube.com/watch?v=D2HurSldDkE). | +| **[Zoro UK](https://www.zoro.co.uk/)** | E-commerce applications around structured shopping. [Portkey Session](https://www.youtube.com/watch?v=_vGKSc1tekE) | +| **[VMware](https://www.vmware.com/)** | RAG and other prompt optimization applications. [Interview in The Register.](https://www.theregister.com/2024/02/22/prompt_engineering_ai_models/) [Business Insider.](https://www.businessinsider.com/chaptgpt-large-language-model-ai-prompt-engineering-automated-optimizer-2024-3) | +| **[Haize Labs](https://www.haizelabs.com/)** | Automated red-teaming for LLMs. [Blog](https://blog.haizelabs.com/posts/dspy/) | +| **[Plastic Labs](https://www.plasticlabs.ai/)** | Different pipelines within Honcho. [Blog](https://blog.plasticlabs.ai/blog/User-State-is-State-of-the-Art) | +| **[PingCAP](https://pingcap.com/)** | Building a knowledge graph. [Article](https://www.pingcap.com/article/building-a-graphrag-from-wikipedia-page-using-dspy-openai-and-tidb-vector-database/) | +| **[Salomatic](https://langtrace.ai/blog/case-study-how-salomatic-used-langtrace-to-build-a-reliable-medical-report-generation-system)** | Enriching medical reports using DSPy. [Blog](https://langtrace.ai/blog/case-study-how-salomatic-used-langtrace-to-build-a-reliable-medical-report-generation-system) | +| **[Truelaw](https://www.youtube.com/watch?v=O0F3RAWZNfM)** | How Truelaw builds bespoke LLM pipelines for law firms using DSPy. [Podcast](https://www.youtube.com/watch?v=O0F3RAWZNfM) | +| **[Moody's](https://www.moodys.com/)** | Leveraging DSPy to optimize RAG systems, LLM-as-a-Judge, and agentic systems for financial workflows. | +| **[Normal Computing](https://www.normalcomputing.com/)** | Translate specs from chip companies from English to intermediate formal languages | +| **[Procure.FYI](https://www.procure.fyi/)** | Process messy, publicly available technology spending and pricing data via DSPy. | +| **[RadiantLogic](https://www.radiantlogic.com/)** | AI Data Assistant. DSPy is used for the agent that routes the query, the context extraction module, the text-to-sql conversion engine, and the table summarization module. | +| **[Raia](https://raiahealth.com/)** | Using DSPy for AI-powered Personal Healthcare Agents. | +| **[Hyperlint](https://hyperlint.com)** | Uses DSPy to generate technical documentation. DSPy helps to fetch relevant information and synthesize that into tutorials. | +| **[Starops](https://staropshq.com/) & [Saya](https://heysaya.ai/)** | Building research documents given a user's corpus. Generate prompts to create more articles from example articles. | +| **[Tessel AI](https://tesselai.com/)** | Enhancing human-machine interaction with data use cases. | +| **[Dicer.ai](https://dicer.ai/)** | Uses DSPy for marketing AI to get the most from their paid ads. | +| **[Howie](https://howie.ai)** | Using DSPy to automate meeting scheduling through email. | +| **[Isoform.ai](https://isoform.ai)** | Building custom integrations using DSPy. | +| **[Trampoline AI](https://trampoline.ai)** | Uses DSPy to power their data-augmentation and LM pipelines. | +| **[Pretrain](https://pretrain.com)** | Uses DSPy to automatically optimize AI performance towards user-defined tasks based on uploaded examples. | + +WIP. This list mainly includes companies that have public posts or have OKed being included for specific products so far. + ## A Few Papers Using DSPy @@ -73,4 +104,4 @@ TODO: This list in particular is highly incomplete. There are a couple dozen oth | **Langtrace** | [Link](https://docs.langtrace.ai/supported-integrations/llm-frameworks/dspy) | | **Langfuse** | [Link](https://langfuse.com/docs/integrations/dspy) | -Credit: Some of these resources were originally compiled in the [Awesome DSPy](https://github.com/ganarajpr/awesome-dspy/tree/master) repo. \ No newline at end of file +Credit: Some of these resources were originally compiled in the [Awesome DSPy](https://github.com/ganarajpr/awesome-dspy/tree/master) repo. diff --git a/docs/docs/community/tutorials.md b/docs/docs/community/tutorials.md index 173fe7d85e..1eb79ee11e 100644 --- a/docs/docs/community/tutorials.md +++ b/docs/docs/community/tutorials.md @@ -1,4 +1,4 @@ -# Tutorials +# Resources This is the list of tutorials and blog posts on DSPy. If you would like to add your own tutorial, please make a PR. diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index f5237abd77..6cdca68664 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -84,7 +84,7 @@ nav: - YouRM: deep-dive/retrieval_models_clients/YouRM.md - Community: - - Tutorials: community/tutorials.md + - Community Resources: community/tutorials.md - Use Cases: community/related-projects.md - Contributing: - Roadmap: roadmap.md From df37332fc377d739c9f726da874124d29c2079e5 Mon Sep 17 00:00:00 2001 From: Amir Mehr Date: Wed, 30 Oct 2024 11:55:01 -0600 Subject: [PATCH 10/13] remove companies-using-dspy.md --- docs/docs/community/companies-using-dspy.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 docs/docs/community/companies-using-dspy.md diff --git a/docs/docs/community/companies-using-dspy.md b/docs/docs/community/companies-using-dspy.md deleted file mode 100644 index e69de29bb2..0000000000 From c47ee170ba4267e49eaea8fa09270a950296718f Mon Sep 17 00:00:00 2001 From: Amir Mehr Date: Wed, 30 Oct 2024 12:17:38 -0600 Subject: [PATCH 11/13] Add community resources and use cases documentation Create new markdown files for community resources and use cases highlighting helpful blogs, tutorials, videos, and company applications of DSPy. Update the contribution guidelines to include a note on development setup and remove the outdated reference in the navigation file. Adjust project dependencies by removing the unnecessary `json-repair` entry. --- docs/docs/community/{tutorials.md => community-resources.md} | 0 docs/docs/community/development-setup.md | 3 --- docs/docs/community/how-to-contribute.md | 5 +++++ docs/docs/community/{related-projects.md => use-cases.md} | 0 docs/mkdocs.yml | 1 - pyproject.toml | 5 ++--- 6 files changed, 7 insertions(+), 7 deletions(-) rename docs/docs/community/{tutorials.md => community-resources.md} (100%) delete mode 100644 docs/docs/community/development-setup.md rename docs/docs/community/{related-projects.md => use-cases.md} (100%) diff --git a/docs/docs/community/tutorials.md b/docs/docs/community/community-resources.md similarity index 100% rename from docs/docs/community/tutorials.md rename to docs/docs/community/community-resources.md diff --git a/docs/docs/community/development-setup.md b/docs/docs/community/development-setup.md deleted file mode 100644 index 355b5f5cdb..0000000000 --- a/docs/docs/community/development-setup.md +++ /dev/null @@ -1,3 +0,0 @@ -## Development Setup - -We are working on a development setup guide. If you're interested in contributing, please reach out to us on Discord. diff --git a/docs/docs/community/how-to-contribute.md b/docs/docs/community/how-to-contribute.md index 65a0f98d50..2a404a62cd 100644 --- a/docs/docs/community/how-to-contribute.md +++ b/docs/docs/community/how-to-contribute.md @@ -1,3 +1,7 @@ +## Development Setup + +We are working on a development setup guide. If you're interested in contributing, please reach out to us on Discord. + ## Contributing **What if I have a better idea for prompting or synthetic data generation?** Perfect. We encourage you to think if it's best expressed as a module or an optimizer, and we'd love to merge it in DSPy so everyone can use it. DSPy is not a complete project; it's an ongoing effort to create structure (modules and optimizers) in place of hacky prompt and pipeline engineering tricks. @@ -5,3 +9,4 @@ **How can I add my favorite LM or vector store?** Check out these walkthroughs on setting up a [Custom LM client](/deep-dive/language_model_clients/custom-lm-client) and [Custom RM client](/deep-dive/retrieval_models_clients/custom-rm-client). + diff --git a/docs/docs/community/related-projects.md b/docs/docs/community/use-cases.md similarity index 100% rename from docs/docs/community/related-projects.md rename to docs/docs/community/use-cases.md diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 6cdca68664..c2aef8991b 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -89,7 +89,6 @@ nav: - Contributing: - Roadmap: roadmap.md - How to get involved: community/how-to-contribute.md - - Development setup: community/development-setup.md - FAQ: faqs.md - Cheatsheet: cheatsheet.md diff --git a/pyproject.toml b/pyproject.toml index 0170fce95c..371f059e46 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,8 +42,7 @@ dependencies = [ "jinja2", "magicattr~=0.1.6", "litellm", - "diskcache", - "json-repair" + "diskcache" ] [project.optional-dependencies] @@ -136,7 +135,7 @@ jinja2 = "^3.1.3" magicattr = "^0.1.6" litellm = "1.49.1" diskcache = "^5.6.0" -json-repair = "^0.30.0" + [tool.poetry.group.dev.dependencies] pytest = "^6.2.5" From 64b4756f9c484f34d41bf7e88879f4c51c9bdbb7 Mon Sep 17 00:00:00 2001 From: Amir Mehr Date: Wed, 30 Oct 2024 12:19:33 -0600 Subject: [PATCH 12/13] Remove debugging section from navigation and update FAQ title in mkdocs configuration --- docs/docs/tutorials/debugging.md | 51 -------------------------------- docs/mkdocs.yml | 3 +- 2 files changed, 1 insertion(+), 53 deletions(-) delete mode 100644 docs/docs/tutorials/debugging.md diff --git a/docs/docs/tutorials/debugging.md b/docs/docs/tutorials/debugging.md deleted file mode 100644 index 754fd017ed..0000000000 --- a/docs/docs/tutorials/debugging.md +++ /dev/null @@ -1,51 +0,0 @@ -# Debugging DSPy Programs - -## Common Issues and Solutions - -### Context Length Errors - -If you're encountering "context too long" errors in DSPy, this typically happens when using DSPy optimizers that include demonstrations within your prompt, exceeding your current context window. Here are some solutions: - -1. **Reduce demonstration parameters**: - - Lower `max_bootstrapped_demos` and `max_labeled_demos` in your optimizer settings - - Reduce the number of retrieved passages/documents/embeddings - -2. **Increase token limit**: - ```python - lm = dspy.OpenAI(model="gpt-4", max_tokens=2048) # Adjust max_tokens as needed - ``` - -### Timeouts and Backoff Errors - -When dealing with timeout or backoff errors: - -1. **Check provider status**: - - Verify your LM/RM provider status - - Ensure you have sufficient rate limits - -2. **Adjust thread count**: - - Reduce the number of concurrent threads to prevent server overload - -3. **Configure backoff settings**: - ```python - # Global configuration - dspy.settings.configure(backoff_time=...) - - # Provider-specific configuration - with dspy.context(backoff_time=...): - dspy.OpenAI(...) - ``` - -### Caching Issues - -To manage caching in DSPy: - -1. **Disable cache**: - ```python - dspy.LM('openai/gpt-4', cache=False) - ``` - -2. **Set cache directory**: - ```python - os.environ["DSP_NOTEBOOK_CACHE"] = os.path.join(os.getcwd(), ".dspy_cache") - ``` diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index c2aef8991b..7e503ff9c8 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -18,7 +18,6 @@ nav: - Summarization: tutorials/summarization.md - Additional Resources: tutorials/other_tutorial.md - Examples: tutorials/examples.md - - Debugging: tutorials/debugging.md - Components: - Overview: building-blocks/solving_your_task.md - Signatures: @@ -89,7 +88,7 @@ nav: - Contributing: - Roadmap: roadmap.md - How to get involved: community/how-to-contribute.md - - FAQ: faqs.md + - FAQ & Troubleshooting: faqs.md - Cheatsheet: cheatsheet.md theme: From 0a39aea2b7b0347ebe463e81f1bc056e5f13561f Mon Sep 17 00:00:00 2001 From: Amir Mehr Date: Wed, 30 Oct 2024 12:25:09 -0600 Subject: [PATCH 13/13] Add json-repair to dependencies in pyproject.toml --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 371f059e46..0170fce95c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,8 @@ dependencies = [ "jinja2", "magicattr~=0.1.6", "litellm", - "diskcache" + "diskcache", + "json-repair" ] [project.optional-dependencies] @@ -135,7 +136,7 @@ jinja2 = "^3.1.3" magicattr = "^0.1.6" litellm = "1.49.1" diskcache = "^5.6.0" - +json-repair = "^0.30.0" [tool.poetry.group.dev.dependencies] pytest = "^6.2.5"