Skip to main content

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 by litelm (2.6k LOC, 2 deps)
  • numpy moved 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

dspy_lite-3.3.1.post1.tar.gz (352.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dspy_lite-3.3.1.post1-py3-none-any.whl (423.7 kB view details)

Uploaded Python 3

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

Hashes for dspy_lite-3.3.1.post1.tar.gz
Algorithm Hash digest
SHA256 0212e4b5b13557c4e63e0d2d89a31cca3edc647cf930b92206e11f067071376c
MD5 6c7df54bd2592d5ea3a8fe94f255db97
BLAKE2b-256 a326980f722314605ebeff0016d73c93ed4303595eab487b13f7e13856de34fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for dspy_lite-3.3.1.post1.tar.gz:

Publisher: publish.yml on kennethwolters/dspy-lite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for dspy_lite-3.3.1.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 179bb7e0ffb6023f8e4d8b254a99faa295cdcb1a7c0bea075c345824c9be2872
MD5 03a13cf0142c3fcc83f37516588e7d4b
BLAKE2b-256 674cbdfc075bc4589dba0e6ecaa7e87db3463456914d1fd70b61eb384d46b06b

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

3.3.1.post1 This release

2 files

3.2.1.post2

2 files

3.2.1.post1

2 files

3.1.3.post7

2 files

3.1.3.post6

2 files

3.1.3.post5

2 files

3.1.3.post4

2 files

3.1.3.post3

2 files

3.1.3.post2

2 files

3.1.3.post1

2 files

3.1.3

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page