dspy-lite
DSPy with litellm replaced by litelm and numpy made optional.
What this is
- Same DSPy 3.3.1 -- signatures, modules (Predict, CoT, ReAct/ReActV2, RLM, Flex), 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- 85% smaller clean install (25 MB vs 171 MB, 34 packages vs 65)
- 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[deno] # managed Deno runtime for interpreters
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.
DSPy 3.3 APIs
This release includes DSPy 3.3.1's typed provider-neutral LM boundary, experimental ReActV2 and Flex, structured native tool-call history, interpreter isolation improvements, optional managed Deno runtime, and GEPA 0.1.4 integration. Review the upstream 3.3.0 and 3.3.1 notes for compatibility changes.
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 | 171 MB, 65 packages | 25 MB, 34 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.3.1.post1.tar.gz.
File metadata
- Download URL: dspy_lite-3.3.1.post1.tar.gz
- Upload date:
- Size: 352.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0212e4b5b13557c4e63e0d2d89a31cca3edc647cf930b92206e11f067071376c
|
|
| MD5 |
6c7df54bd2592d5ea3a8fe94f255db97
|
|
| BLAKE2b-256 |
a326980f722314605ebeff0016d73c93ed4303595eab487b13f7e13856de34fa
|
Provenance
The following attestation bundles were made for dspy_lite-3.3.1.post1.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.3.1.post1.tar.gz -
Subject digest:
0212e4b5b13557c4e63e0d2d89a31cca3edc647cf930b92206e11f067071376c - Sigstore transparency entry: 2795427341
- Sigstore integration time:
-
Permalink:
kennethwolters/dspy-lite@a7ff6835802fbc8e0ad87fb62a02e4c448eecf0d -
Branch / Tag:
refs/tags/v3.3.1.post1 - Owner: https://github.com/kennethwolters
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a7ff6835802fbc8e0ad87fb62a02e4c448eecf0d -
Trigger Event:
release
-
Statement type:
File details
Details for the file dspy_lite-3.3.1.post1-py3-none-any.whl.
File metadata
- Download URL: dspy_lite-3.3.1.post1-py3-none-any.whl
- Upload date:
- Size: 423.7 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 |
179bb7e0ffb6023f8e4d8b254a99faa295cdcb1a7c0bea075c345824c9be2872
|
|
| MD5 |
03a13cf0142c3fcc83f37516588e7d4b
|
|
| BLAKE2b-256 |
674cbdfc075bc4589dba0e6ecaa7e87db3463456914d1fd70b61eb384d46b06b
|
Provenance
The following attestation bundles were made for dspy_lite-3.3.1.post1-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.3.1.post1-py3-none-any.whl -
Subject digest:
179bb7e0ffb6023f8e4d8b254a99faa295cdcb1a7c0bea075c345824c9be2872 - Sigstore transparency entry: 2795427415
- Sigstore integration time:
-
Permalink:
kennethwolters/dspy-lite@a7ff6835802fbc8e0ad87fb62a02e4c448eecf0d -
Branch / Tag:
refs/tags/v3.3.1.post1 - Owner: https://github.com/kennethwolters
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a7ff6835802fbc8e0ad87fb62a02e4c448eecf0d -
Trigger Event:
release
-
Statement type: