dspy-signatures

Installation
SKILL.md

DSPy Signatures

Guide the user through defining DSPy Signatures — typed declarations of what goes into and comes out of an LM call.

Step 1: What kind of signature?

Ask the user before diving in:

  1. How complex is your I/O? One input, one output (use inline)? Multiple fields, type constraints, or nested objects (use class-based)?
  2. Do you need structured output? If the output maps to a database model or API response, you likely want a Pydantic model as the output type.
  3. Are outputs constrained? If you need categories, booleans, or numeric ranges, you need type annotations.

Then jump to the relevant section below.

What is a Signature

A Signature declares the input/output contract for an LM call -- field names, types, and descriptions. DSPy compiles it into an optimized prompt automatically. You define the I/O spec; DSPy handles the prompting.

When to use each style

Installs
6
GitHub Stars
11
First Seen
Mar 17, 2026
dspy-signatures — lebsral/dspy-programming-not-prompting-lms-skills