dspy-lite
DSPy with litellm replaced by litelm and numpy made optional.
What this is
- Same DSPy 3.2.1 -- signatures, modules (Predict, CoT, ReAct), optimizers (Bootstrap, MIPRO, SIMBA, GEPA, GRPO)
litellm(100k+ LOC, 70+ transitive deps) replaced bylitelm(2.6k LOC, 2 deps)numpymoved from core dep to optional[embeddings]extra- 83% smaller clean install (24 MB vs 144 MB, 36 packages vs 67)
- Unaffected by the litellm supply chain compromise (CVE-2026-33634) — zero litellm code or dependencies
Install
pip install dspy-lite
Supported Python versions: 3.10 through 3.14.
With provider extras:
pip install dspy-lite[anthropic] # Anthropic
pip install dspy-lite[bedrock] # AWS Bedrock
pip install dspy-lite[embeddings] # numpy for embeddings
pip install dspy-lite[all] # everything
Usage
import dspy
lm = dspy.LM("openai/gpt-4o-mini")
dspy.configure(lm=lm)
predict = dspy.Predict("question -> answer")
result = predict(question="What is DSPy?")
print(result.answer)
Everything from DSPy works -- the import is still import dspy.
Loading images, audio, and files
Resource validation never reads the filesystem or network implicitly. Load resources explicitly:
image = dspy.Image.from_path("./image.png")
image = dspy.Image.from_url("https://example.com/image.png") # explicit network request
image_reference = dspy.Image("https://example.com/image.png") # provider-fetched URL; no local request
audio = dspy.Audio.from_path("./audio.wav")
file = dspy.File.from_path("./document.pdf")
Applications must validate or allowlist untrusted URLs before calling from_url(); explicit downloads do not provide SSRF filtering.
Disk-cache safety
Disk caches use restricted pickle deserialization by default. Custom cached classes must be registered with dspy.configure_cache(safe_types=[...]). Setting restrict_pickle=False restores unrestricted pickle compatibility, emits a warning, and must only be used when the cache directory is fully trusted. Unsafe or incompatible legacy entries are treated as cache misses rather than retried with unrestricted deserialization.
What changed from DSPy
| DSPy | dspy-lite | |
|---|---|---|
| LM routing | litellm (34 MB, 201k LOC) | litelm (87 KB, 2.6k LOC) |
| numpy | core dep (60 MB) | optional [embeddings] |
| Clean install size | 144 MB, 67 packages | 24 MB, 36 packages |
| API | unchanged | unchanged |
Documentation
Full DSPy documentation: dspy.ai
Development disclosure
This project is maintained with AI-assisted coding. Through 2026-05-14, I used Claude Code with Claude Opus 4.6/4.7. As of 2026-05-14, I use pi with GPT-5.5. The human maintainer remains responsible for what is merged and released.
License
MIT (inherited from DSPy)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dspy_lite-3.2.1.post2.tar.gz.
File metadata
- Download URL: dspy_lite-3.2.1.post2.tar.gz
- Upload date:
- Size: 273.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b8ccb11c2a3028eea5f41ae6536730fd9c7fd12ce7c38357fc4f10fd60600c3
|
|
| MD5 |
17519b3b8d7275a13c000b1b0fdf958c
|
|
| BLAKE2b-256 |
e9aa77aff4642f193f537579a8a750987ecda21a15424be41b1f96ab2d692270
|
Provenance
The following attestation bundles were made for dspy_lite-3.2.1.post2.tar.gz:
Publisher:
publish.yml on kennethwolters/dspy-lite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dspy_lite-3.2.1.post2.tar.gz -
Subject digest:
3b8ccb11c2a3028eea5f41ae6536730fd9c7fd12ce7c38357fc4f10fd60600c3 - Sigstore transparency entry: 2794161641
- Sigstore integration time:
-
Permalink:
kennethwolters/dspy-lite@e9aa08ae46c95bbdb71edbd3adb9560e88e5e96f -
Branch / Tag:
refs/tags/v3.2.1.post2 - Owner: https://github.com/kennethwolters
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e9aa08ae46c95bbdb71edbd3adb9560e88e5e96f -
Trigger Event:
release
-
Statement type:
File details
Details for the file dspy_lite-3.2.1.post2-py3-none-any.whl.
File metadata
- Download URL: dspy_lite-3.2.1.post2-py3-none-any.whl
- Upload date:
- Size: 336.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adf74e2da8067b523050517d208b49b33e622b887dc3003879b49b51af63c460
|
|
| MD5 |
0a60b95df86f3cb648947255eaa63ef7
|
|
| BLAKE2b-256 |
dad52e65762de785800c5f51ee2825d11bb47701291c4492456f79805172ecc6
|
Provenance
The following attestation bundles were made for dspy_lite-3.2.1.post2-py3-none-any.whl:
Publisher:
publish.yml on kennethwolters/dspy-lite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dspy_lite-3.2.1.post2-py3-none-any.whl -
Subject digest:
adf74e2da8067b523050517d208b49b33e622b887dc3003879b49b51af63c460 - Sigstore transparency entry: 2794161703
- Sigstore integration time:
-
Permalink:
kennethwolters/dspy-lite@e9aa08ae46c95bbdb71edbd3adb9560e88e5e96f -
Branch / Tag:
refs/tags/v3.2.1.post2 - Owner: https://github.com/kennethwolters
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e9aa08ae46c95bbdb71edbd3adb9560e88e5e96f -
Trigger Event:
release
-
Statement type: