aicoolies logo
DSPy logo
DSPy logo

DSPy

Programming — not prompting — LLMs

open sourceupdated Apr 21, 2026

Declarative framework from Stanford University for programming language models rather than prompting them. DSPy treats LLM interactions as programmable modules with input-output signatures and uses optimization algorithms to automatically compile these modules into effective prompts or fine-tuned weights, replacing brittle prompt strings with structured, modular AI software.

DSPy is a declarative framework from Stanford University for programming language models rather than prompting them, enabling developers to build modular AI software using structured code instead of brittle prompt strings. It solves the fundamental challenge of prompt engineering by treating LLM interactions as programmable modules with defined input-output signatures, then using optimization algorithms to automatically compile these modules into effective prompts or fine-tuned weights. DSPy shifts the paradigm from manually crafting prompts to declaring what you want and letting the framework figure out how to achieve it through systematic optimization.

DSPy applications are built using three core components: language models, signatures that declare program inputs and outputs, and modules that define the prompting technique. The framework provides optimizers that automatically improve pipelines by tuning prompts, adjusting instructions, adding optimal few-shot examples, or fine-tuning the model weights to maximize performance on specified metrics. DSPy supports building everything from simple classifiers to sophisticated RAG pipelines and agent loops, with composable modules that can be combined with different models, inference strategies, or learning algorithms for maximum flexibility.

DSPy is designed for AI researchers, machine learning engineers, and developers building LLM-powered applications who want to move beyond manual prompt engineering to systematic, reproducible optimization of their AI pipelines. It integrates with major model providers and can be used alongside other frameworks for retrieval, evaluation, and deployment. The framework is particularly valuable for teams working on production systems where prompt reliability and performance consistency are critical, as DSPy optimizers can automatically discover prompt configurations that outperform hand-tuned alternatives.

Pricing

Free

Platforms

Python

Categories

Tags

Use Cases

Related Tools

computed discovery: shared active categories · kept separate from editor-verified Alternatives

Agent Skills logo

Agent Skills

Open standard for portable skills across AI agents

Agent Skills is the open SKILL.md folder specification for packaging reusable instructions, scripts, references, and assets that compatible AI agents load through progressive disclosure. Originally developed by Anthropic and released as an open standard, it defines the portable format itself—not an example library, marketplace, or hosted agent product.

Open Source
BeeAI Framework logo

BeeAI Framework

Python and TypeScript framework for production multi-agent systems

BeeAI Framework is an Apache-2.0 toolkit for building production-ready AI agents and multi-agent systems in Python and TypeScript. Its docs cover agents, tools, RAG, memory, workflows, backend providers, serving, and A2A/MCP integration surfaces, making it a vendor-neutral option for teams comparing LangGraph, CrewAI, Mastra, and related agent runtimes.

Open SourceTelemetry
Superserve logo

Superserve

Open-source Firecracker sandboxes for long-running AI agents

Superserve is an open-source sandbox infrastructure layer for AI agents that need durable computers instead of short-lived shells. It runs isolated Firecracker microVMs, supports pause, resume, snapshot, fork, preview URLs, MCP connectivity, SDK/API control, Docker workloads, and self-hosting, while the hosted service adds pay-as-you-go agent sandboxes for teams.

Open Source
Anthropic Agent Skills logo

Anthropic Agent Skills

Official Claude Agent Skills examples, spec, and plugin marketplace for reusable agent capabilities

Anthropic Agent Skills is Anthropic's official reference repo and Claude Code plugin marketplace for reusable Skill folders. It packages example SKILL.md workflows, document skills, a Claude API skill, templates, and the Agent Skills spec so teams can turn repeatable instructions, scripts, and resources into on-demand Claude capabilities instead of copying prompts across sessions.

freeTelemetry
agmsg logo

agmsg

Cross-agent messaging for CLI coding agents

agmsg is an MIT-licensed Bash and SQLite messaging layer for CLI coding agents. It lets Claude Code, Codex, Gemini CLI, GitHub Copilot CLI, Antigravity, OpenCode, Hermes, and other terminal agents exchange messages through a shared local database instead of relying on a human copy-paste relay. It is intentionally not MCP, not a broker, and not a subagent framework.

Open Source
eve vercel

eve by Vercel

Filesystem-first framework for durable AI agents

Eve is Vercel's filesystem-first TypeScript framework for building durable AI agents as ordinary project files. It combines Markdown instructions and skills, typed tools, channels, connections, subagents, schedules, sandboxes, and evals with Vercel's agent runtime so teams can ship deployable agents without hand-rolling orchestration. The current beta fits Vercel-native backend agent projects.

Open Source

Comparisons

DSPy vs LangChain — Programmatic Prompt Optimization vs LLM Orchestration Framework

DSPy and LangChain represent two fundamentally different philosophies for building LLM-powered applications. LangChain provides an orchestration layer that connects language models to external tools, data sources, and custom logic through chains and agents. DSPy, developed at Stanford and backed by Databricks, takes a programmatic approach where prompts are treated as optimizable programs rather than handcrafted strings.

Ell vs DSPy — Prompt Versioning and Visualization vs Algorithmic Prompt Optimization

Ell and DSPy both improve how developers work with LLM prompts, but from opposite angles. Ell treats prompts as versioned Python functions with a TensorBoard-like studio for tracking evolution. DSPy treats prompts as programs to be algorithmically optimized through compilers and evaluators. This comparison helps ML engineers choose between human-driven prompt engineering and machine-driven prompt optimization.

EllDSPy

FAQ

What is DSPy?

Declarative framework from Stanford University for programming language models rather than prompting them. DSPy treats LLM interactions as programmable modules with input-output signatures and uses optimization algorithms to automatically compile these modules into effective prompts or fine-tuned weights, replacing brittle prompt strings with structured, modular AI software.

Is DSPy free?

Yes — DSPy is open source and free to use. Free

Is DSPy open source?

Yes — DSPy is open source.

What are the best DSPy alternatives?

The top editor-verified DSPy alternatives are LangChain, Promptfoo, Instructor.