DSPy 3.4.1: our test log
DSPy 3.4.1 passed our one-tool task on a local 3B model: 3 of 3 trials; cold uv install 3.7 s.
Tested by us on 2026-10-25. Local open-weight model, not the vendor's hosted models. A smoke test on a CPU-only box, not a benchmark.
Result at a glance
| Field | Value |
|---|---|
| Result | Passed |
| Version tested | 3.4.1 |
| Date and time | 2026-10-25, 23:19 to 23:20 CDT (America/Chicago) |
| Task | Give a local model one Python function, add_numbers(a, b), and ask it to use that tool to compute 17 + 25 and report the result. Pass means the function was called with 17 and 25 and the final answer contains 42. Three trials per tool, all on the same local model. |
| Model used | Qwen2.5-3B-Instruct (Q4_K_M) through Ollama 0.40.11 |
| Hardware | Linux x86_64 virtual machine (Debian 13), 8 vCPU (Intel Xeon, 1 thread per core), 15 GiB RAM, no GPU |
| Installed size (uv) | 231 MB in 66 packages |
| Install time (uv, cold) | 3.7 s |
| Install time (pip, cold) | 23.3 s |
| Installed size (pip) | 327 MB in 67 packages |
| Task trials passed | 3 of 3 |
| Task wall time (median, includes imports) | 23.7 s (range 16.3 to 31.6 s) |
| Machine load during trials | 9.1 to 10.1 (1-minute load average, 8 vCPU) |
What we found
- 3 of 3 task trials passed: the model's tool call reached the framework, the function ran with 17 and 25, and the final answer contained 42.
- Cold install took 3.7 s with uv and 23.3 s with pip, and left 231 MB in 66 packages (uv).
- Used dspy.ReAct with a plain Python function as the tool. DSPy's main feature, optimising prompts against a metric, was not exercised.
- A first run looked suspiciously fast (about 0.7 s) because DSPy caches LM calls by default; we disabled both caches and re-ran, which is what the timings here are.
What we ran, step by step
| Step | Wall time | Exit code | Notes |
|---|---|---|---|
| Install with uv (cold, no cache) | 3.7 s | 0 | Machine load average before the run: 0.59. |
| Install with pip (cold, no cache) | 23.3 s | 0 | Load average before: 1.24. Second run; the first pip run was discarded (see the research page). |
| Task command (all trials) | n/a | n/a | Run from a directory that contains common.py (shown below). Telemetry switches were set for tools that have them. |
| Task trial 1 | 31.6 s | 0 | Tool called with [[17, 25], [17, 25], [17, 25]]; answer: The result of adding 17 and 25 is 42. [[ ## completed ## ##]] Load 10.07. |
| Task trial 2 | 16.3 s | 0 | Tool called with [[17, 25]]; answer: The result of adding 17 and 25 is 42. Load 9.38. |
| Task trial 3 | 23.7 s | 0 | Tool called with [[17, 25]]; answer: The result of adding 17 and 25 is 42. Load 9.14. |
# Install with uv (cold, no cache)
uv venv -q -p 3.13 work/py/dspy && VIRTUAL_ENV=work/py/dspy uv pip install --no-cache -q dspy
# Install with pip (cold, no cache)
uv venv -q --seed -p 3.13 work/pip/dspy && work/pip/dspy/bin/pip install --no-cache-dir -q dspy
# Task command (all trials)
OTEL_SDK_DISABLED=true work/py/dspy/bin/python tasks/dspy_react.pyRaw output (excerpts)
from common import *
import dspy
dspy.configure_cache(enable_disk_cache=False, enable_memory_cache=False)
dspy.configure(lm=dspy.LM(f"openai/{MODEL}", api_base=BASE, api_key=KEY, temperature=0))
agent = dspy.ReAct("question -> answer", tools=[add_numbers], max_iters=4)
r = agent(question=TASK)
report(r.answer)import json, os
BASE = "http://127.0.0.1:11434/v1"
MODEL = os.environ.get("MODEL", "qwen2.5-3b")
KEY = "ollama"
TASK = "Use the add_numbers tool to compute 17 + 25, then tell me the result."
CALLS = []
def add_numbers(a: int, b: int) -> int:
"""Add two integers and return the sum."""
CALLS.append((a, b))
return int(a) + int(b)
def report(final):
ok = any({int(x), int(y)} == {17, 25} for x, y in CALLS) and "42" in str(final)
print("RESULT_JSON " + json.dumps({"calls": CALLS, "final": str(final)[:300], "ok": ok}))RESULT_JSON {"calls": [[17, 25], [17, 25], [17, 25]], "final": "The result of adding 17 and 25 is 42.\n\n[[ ## completed ## ##]]", "ok": true}Gotchas and things that broke
- DSPy caches LM responses on disk and in memory by default. For any timing or reliability test, call dspy.configure_cache with both caches off, or the second run measures the cache.
What we did not test
- Any vendor-hosted model: everything ran on a local 3B model, so tool-call reliability with frontier models is not measured here.
- Multi-agent flows, memory, long conversations, streaming, tracing and cloud deployment.
- Anything beyond one tool and one question; three trials is a smoke test, not a benchmark.
- Optimizers (MIPRO, GEPA, BootstrapFewShot) and evaluation, which are the reason to use DSPy.
Reproduce it
Versions change. These commands install whatever is latest on the day you run them unless a version is pinned, so expect different results later. The version we measured is in the table above.
# 1. Serve any local model that supports tool calling behind an OpenAI-compatible endpoint, registered as qwen2.5-3b:
# http://127.0.0.1:11434/v1 (we used Ollama with a Qwen2.5-3B-Instruct Q4_K_M GGUF)
uv venv -p 3.13 .venv && VIRTUAL_ENV=.venv uv pip install dspy
# 2. Save common.py (above) and the task script next to each other, then:
.venv/bin/python dspy_react.pyHow to read this test
Every number on this page was measured on this one machine, which also ran other jobs, so timings are indicative and vary run to run. A pass means our small task worked once or as stated, a fail means it did not work as we ran it; neither says how the tool behaves with a vendor's frontier model, on a GPU, or at scale. Where a tool could not run without an account or a GPU, we say so instead of guessing.
See the testing rig for the hardware, the local model and the rules we follow, and the test hub for every other test.
Related tests: agent frameworks and sdks
- Google ADK (Python): Google ADK (Python) 2.13.0 passed our one-tool task on a local 3B model: 3 of 3 trials; cold uv install 1.7 s.
- Haystack: Haystack 3.4.1 passed our one-tool task on a local 3B model: 3 of 3 trials; cold uv install 2.3 s.
- Instructor: Instructor 1.17.0 returned a validated Pydantic object from a local 3B model in 3 of 3 trials (structured extraction, not a tool call); cold uv install 1.4 s.
- LangChain: LangChain 1.4.7 passed our one-tool task on a local 3B model: 3 of 3 trials; cold uv install 0.8 s.
- LangChain.js: LangChain.js 1.5.19 passed our one-tool task 3 of 3 on Node 20 and 3 of 3 on Node 24; about 101 MB in 36 packages.
- LangGraph: LangGraph 1.2.17 passed our one-tool task on a local 3B model: 3 of 3 trials; cold uv install 2.5 s.
FAQ
Does DSPy work with a local model?
In our run it did for this one task: 3 of 3 trials passed against a local Qwen2.5-3B model served by Ollama. We did not test other models, and results depend heavily on the model's tool-calling ability.
How big is a fresh DSPy install?
231 MB in 66 packages with uv on 3.4.1, measured on 2026-10-25.
Sources
- DSPy repository (fetched 2026-10-25)
- DSPy documentation (fetched 2026-10-25)
Related
Markdown version for agents: /tests/dspy.md