Reche Inc
Reche Inc
ENChange languagePortuguêsBook a diagnosisChat on WhatsApp
Back to blog
AI Tools

DSPy: programming AI models instead of writing prompts

DSPy, from Stanford, replaces manual prompt engineering with code: you declare the logic and optimizers automatically tune the prompts to maximize a metric.

Published on June 12, 20265 min readView on GitHub

Hand-written prompts are fragile: they break when the model changes and are hard to maintain. DSPy, created at Stanford NLP, proposes another approach: instead of writing prompts, you program the pipeline logic and let optimizers tune the prompts on their own.

What is DSPy?

You define the logic declaratively, with Modules and Signatures, and the "optimizers" (teleprompters) compile the pipeline, generating the examples and prompts that maximize your chosen metric. In practice it treats LLM pipelines as machine-learning programs that can be tuned on data.

Key features

  • Program the logic with Modules and Signatures instead of manual prompts
  • Optimizers generate few-shots and prompts to maximize a metric
  • Pipelines become testable programs tunable on data
  • Created by Stanford NLP, with strong academic and industry adoption
  • Around 24k GitHub stars

How Reche uses it

Robust AI systems need to be measured and optimized, not tweaked by eye. Reche applies that discipline, with metrics and evaluation, when building AI products, so quality does not depend on a lucky prompt.

Want to implement this in your product?

Reche's initial diagnosis defines scope, timeline, and budget. Credited to the project if you move forward.