mrkeyoor.com_
Sun 08 Nov 15:35 UTC
LLM Toolsevaluationupdated 20 Oct 2026

dspy review

DSPy is a Python framework that turns language-model tasks into reusable programs and searches for better instructions or examples. You describe the inputs and expected outputs, then supply examples and a scoring rule so it can compare candidates.

+92stars / 7d
Verdict

Our DSPy run recorded 2,410 passing tests and 2 known vulnerabilities, making the checkout worth evaluating while leaving dependency review and task quality unresolved. Choose it when you have examples and a metric good enough to guide prompt optimization. If you cannot reliably score an answer, start by fixing that before adding an optimizer.

We ran it

Lab card: what happened when we ran dspyScreenshot of dspy (dspy.ai)
Install✓ · 55s173 packages · 680 MB
Build✓ · 5s
Tests✓ · 805s2410 passed · 0 failed · 584 skipped of 2410 (pytest)
Known vulns2(pip-audit)
Repo735 files~122,588 lines of source · 26.3 MB · 6 CI workflows · tests dir

Answers from our run

Does dspy build from source?

Dependencies installed in 55 seconds (173 packages), and the build succeeded in 5 seconds. We cloned commit 099982b into a clean Debian container with 3 CPUs and no project-specific setup.

Do dspy's tests pass?

Yes. The project's own test command finished in 805 seconds and reported 2410 passed, 0 failed, 584 skipped (pytest).

Does dspy have known vulnerabilities in its dependencies?

pip-audit flagged 2 known advisories in the dependency tree at the time of our run.

Who should not use dspy?

Teams without a trustworthy metric: the optimization guide starts with an existing system and a way to evaluate it, and warns that prompt optimizers can overfit.

What are the alternatives to dspy?

LangChain, Haystack. Our DSPy run recorded 2,410 passing tests and 2 known vulnerabilities, making the checkout worth evaluating while leaving dependency review and task quality unresolved.

Setup4/5Repository install, build, and test steps passed; live-model configuration and optimization were outside the measured run.
Docs4/5The guides explain model connections, evaluation splits, and optimization pitfalls; provider-specific behavior still needs checking.
CommunityN/APublic issue activity was inspected, but maintainer response and support outcomes were not assessed.
MaturityN/AThe sandbox covered repository commands, not production model quality, upgrade behavior, or long-running service operation.

Discussed on

  1. hnDSPy: Framework for programming with foundation models141 points
  2. hnDspy3 points

Who it’s for

Python engineers who already have labeled examples and can explain what a better answer means.
Teams maintaining extraction, classification, or retrieval workflows whose quality needs repeatable evaluation.
Researchers who want to compare prompt choices through a program rather than edit each prompt by hand.

Who it’s NOT for

Teams without a trustworthy metric: the optimization guide starts with an existing system and a way to evaluate it, and warns that prompt optimizers can overfit.
Developers seeking only a model client: configuring an LM is just the entry point, while modules and evaluation add work that a single request may not justify.
GEPA users whose reflection model cannot return structured output: the 3.4.1 release notes say proposals can fail while leaving the seed program unchanged.

Setup reality

Our sandbox installed DSPy in 55 seconds with 173 recorded dependencies and 680 MB on disk, then built it in 5 seconds. Pytest succeeded in 805 seconds with 2,410 passed, 0 failed, and 584 skipped. Pip-audit reported 2 known vulnerabilities.

Useful work needs credentials for a hosted model or a reachable local endpoint, plus examples and a metric for optimization. The model guide covers both hosted and local connections. Repeated optimization requests also need a spending limit you can enforce.

We measured commit 099982b on 2026-10-13 with 3 CPUs and 8 GB RAM. The recorded image was ghcr.io/astral-sh/uv:python3.12-bookworm, which does not verify the actual runtime or OS. The supplied test summary gives a total of 2,410 alongside 584 skips, so those fields should not be added into an inferred total.

DSPy is useful once you can score an answer

A prompt change that fixes an extraction example can break another. DSPy gives that familiar problem a repeatable workflow: describe a task, compose a Python program, and let an optimizer compare instructions or demonstrations against a metric. The framework's README names classifiers, retrieval pipelines, and agent loops as applications. The common requirement is a way to tell whether a change helped.

That makes DSPy a good candidate for an engineer maintaining a document extractor with reviewable answers. It is a harder sell for an open-ended assistant whose success means something different in every conversation. You can still write that assistant with DSPy, but the optimization machinery needs a target. Buying into the framework before defining one reverses the useful order of work.

What happened when we ran it

Our sandbox installed DSPy in 55 seconds, built it in 5 seconds, and completed pytest successfully in 805 seconds at commit 099982b on 2026-10-13. Installation recorded 173 dependencies and occupied 680 MB. Pytest reported 2,410 passed, 0 failed, and 584 skipped. The supplied summary also labels 2,410 as its total, so we report the fields separately rather than manufacture a reconciled denominator.

Pip-audit reported 2 known vulnerabilities. The supplied evidence does not identify their packages, severity, or exposure in a particular application. A passing suite does not answer those questions. Dependency review remains part of adopting this checkout, even though the repository commands all succeeded.

The sandbox configuration recorded 3 CPUs, 8 GB RAM, and the image ghcr.io/astral-sh/uv:python3.12-bookworm. That label alone does not establish the interpreter or operating-system version. These results cover repository setup and checks, not inference speed, answer accuracy, optimization cost, or a comparison with a manually written prompt. None of those outcomes was measured here.

The optimization guide asks you to separate development from evaluation

DSPy's optimization guide begins with an existing system and a way to evaluate it. It then calls for training and held-out data, and warns that prompt optimizers can overfit small training sets. That warning deserves more attention than the promise of automatic improvement. Searching many candidates gives you more opportunities to exploit a weak scorer.

For an extractor, a sensible trial would keep reviewed documents aside and compare the original program with the optimized version on those untouched examples. This is an adoption recommendation, not a result from our sandbox. Check the errors as well as the aggregate score: a metric that accepts the wrong invoice amount is a poor guide even if it rewards the correct output format.

The extra work is defensible when you expect to revise a task repeatedly. It is harder to justify when a short prompt already meets a clear requirement and rarely changes. DSPy moves engineering effort into the program, examples, and evaluation rule. Those assets need owners just as application code does.

A configured model still needs an endpoint and a request budget

The model guide documents hosted credentials and local endpoints. Running locally therefore means supplying a model service as well as the Python framework. A successful package install says nothing about whether your chosen model is reachable or follows the output contract well enough for your task.

Optimization evaluates candidates through model requests. Set a budget and record the provider and model configuration before comparing results. DSPy's documentation describes request history and usage metadata, which can help inspection, but our run did not validate provider billing or enforce a monetary ceiling. Treat those as separate operational checks.

GEPA can finish without improving the seed program

The 3.4.1 release notes say a reflection model must return parseable JSON. When a proposal fails, GEPA can keep the current candidate and finish with the seed unchanged. That is a specific reason to inspect optimization logs and compare the resulting program with the starting one. Completion alone does not establish improvement.

The same release notes describe compatibility changes in reflection requests. Keep the measured commit distinct from whichever release you adopt. Our green run does not certify every later configuration, and a release note describes intended behavior rather than an independent result for your workload.

Choose the framework around the work you need to repeat

LangChain centers agents, model interfaces, and integrations. Prefer it when connecting components is the main problem. Haystack describes explicit control over retrieval, routing, memory, and generation through modular pipelines. Prefer that structure when tracing document flow matters more than searching instructions. These are architectural choices, not a performance ranking.

Our setup score of 4/5 means the measured repository commands passed while live-model setup remains unverified. The documentation score of 4/5 reflects concrete connection and optimization guidance with application-specific checks still required. Community support and production maturity remain unscored because this investigation did not establish either.

Before adopting DSPy, write down an error you need to reduce and collect examples that expose it. If you cannot agree on how to score those examples, an optimizer will make that disagreement more expensive.

Alternatives

ProjectWhat it isPick it when
LangChain gh↗A framework for agents and language-model applications with interoperable components and integrations.Pick this instead when connecting models and tools is the main job, and you do not need DSPy to search prompt candidates.
Haystack gh↗A Python framework for modular retrieval pipelines and agent workflows.Pick this instead when you want explicit control over retrieval and routing as the organizing structure of the application.

What people are saying

  1. [hackernews] Imp is a full port of DSPy to the BEAM

Sources

  1. DSPy README
  2. Optimization in DSPy
  3. DSPy language models
  4. DSPy releases
  5. LangChain README
  6. Haystack README

More llm tools reviews

gemini-api-cli · MCPJungle · octomind · kimi-k3-in-c · nanochat · FreeToken · the whole board →