Day 34 / Daily GitHub Discovery / AI / LLMs

DSPy

Build LLM programs from typed signatures and optimize them against examples.

~22,000 stars · checked Sep 28, 2026
PythonPydanticLLM providers
Visit GitHub (opens in a new tab)

What it does

DSPy provides signatures and modules for composing language-model programs. Optimizers can tune instructions and demonstrations against a metric and dataset.

Why it’s interesting

Treating prompts as program parameters encourages measurable iteration. Results depend on representative examples, metrics, and model access.

Real-world use case

Tune a question-answering pipeline against a small evaluation set before switching models.

What I can learn

  • 01

    Declarative input and output signatures

    See how typed input and output fields define a task contract independently from prompt wording.

  • 02

    Prompt and demonstration optimization

    Understand how an optimizer scores candidate instructions and examples against a metric to improve a program.

  • 03

    Composable and testable modules

    Learn how predictors can be assembled into explicit-input/output modules that are easier to test and reuse.

One thing to explore

Signatures and optimizers

Follow the dspy/signatures implementation and connect it to the concepts above.

Explore the source (opens in a new tab)

10-Minute Challenge

Define a structured predictor

Before you start: Python and a supported LLM provider API key; never commit the key.

  1. Install DSPy in a Python environment.
  2. Configure a supported model using an environment variable for its API key.
  3. Run a ChainOfThought predictor on one example and inspect structured fields.
Terminal
pip install dspy

Keep exploring

All repositories →