dspy

Compose declarative language-model pipelines with signatures and optimization loops.

Updated May 11, 2026
One-click install
npx skills add https://github.com/jason660519/Project-Manager --skill dspy-jason660519
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy
Source: https://github.com/jason660519/Project-Manager/tree/main/hermes-agent/optional-skills/mlops/research/dspy
Command: npx skills add https://github.com/jason660519/Project-Manager --skill dspy-jason660519

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dspy, openai, anthropic.

What problem does it solve?

DSPy provides a structured approach to building scalable, self-improving language-model pipelines by composing modular prompts, reasoning steps, and optimization loops to reduce manual prompt engineering overhead.

Core Features & Use Cases

  • Declarative signatures and modular composition enable complex tasks with clearer definitions and better maintainability.
  • Built-in reasoning and tool-use patterns (ChainOfThought, ReAct, ProgramOfThought, RAG) support multi-step reasoning and integration with external tools.
  • Teleprompters and optimizers (BootstrapFewShot, MIPRO, COPRO, BootstrapFinetune) automate prompt and weight optimization to improve performance across models.
  • End-to-end production workflows across diverse domains with evaluation, monitoring, and versioned modules.

Quick Start

Install DSPy and run a basic end-to-end pipeline to observe structured LM calls and automatic improvement.

Frequently Asked Questions about dspy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate prompt engineering for LLM pipelines?

Automate prompt engineering by composing declarative modules and optimization loops. You define task signatures, supply a labeled trainset and evaluation metric, then run a teleprompter to automatically generate and refine prompts for deployment.

How does declarative LM programming work for building reasoning pipelines?

Declarative LM programming works by defining task signatures and composing modular reasoning steps like ChainOfThought or ReAct. This structure replaces manual prompt tweaking with composable modules that execute multi-step reasoning and tool use.

Can I optimize RAG pipelines and few-shot prompts across different language models?

Yes, you can optimize RAG pipelines and few-shot prompts across models. By configuring an LM provider and applying optimizers like BootstrapFewShot or MIPRO, the system automatically improves module performance based on your defined metric.

Do I need labeled data and a custom metric to run language model optimizations?

Yes, you need a labeled trainset and a custom metric to run language model optimizations. The optimizers require labeled examples to bootstrap few-shot prompts and a metric to evaluate and guide the automatic improvement of your modules.

What is the best way to reduce manual prompt overhead in production language model workflows?

The best way to reduce manual prompt overhead is using automated teleprompters. Optimizers like COPRO and BootstrapFinetune systematically tune prompts and weights, replacing manual adjustments with versioned, self-improving modules for production workflows.

Why use declarative signatures instead of manual prompt engineering for complex tasks?

Declarative signatures provide clearer task definitions and better maintainability than manual prompt engineering. By defining inputs and outputs structurally, you enable optimizers to automatically tune the underlying prompts, ensuring scalable and consistent performance.