Skip to main content

DSPy with litellm replaced by litelm and numpy made optional

Project description

dspy-lite

DSPy with litellm replaced by litelm and numpy made optional.

What this is

  • Same DSPy 3.1.3 -- signatures, modules (Predict, CoT, ReAct), 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
  • 88% smaller install (25 MB vs 213 MB, 30 packages vs 72)

Install

pip install dspy-lite

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.

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]
Install size 213 MB, 72 packages 25 MB, 30 packages
API unchanged unchanged

Known limitations

  • azure_ad_token_provider passthrough not yet supported (litelm gap)
  • Pydantic response_format routing to beta.chat.completions.parse() not yet supported (litelm gap)
  • Anthropic citation streaming (provider_specific_fields) not yet supported (litelm gap)

Documentation

Full DSPy documentation: dspy.ai

License

MIT (inherited from DSPy)

Project details


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.1.3.post3.tar.gz (265.8 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.1.3.post3-py3-none-any.whl (329.9 kB view details)

Uploaded Python 3

File details

Details for the file dspy_lite-3.1.3.post3.tar.gz.

File metadata

  • Download URL: dspy_lite-3.1.3.post3.tar.gz
  • Upload date:
  • Size: 265.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dspy_lite-3.1.3.post3.tar.gz
Algorithm Hash digest
SHA256 bcdcf83c10050fb865e770e4e2fd201729cb4112723120db5d6177a2dd0ab8e9
MD5 c1a12a04db280d349073aa626ba31ef1
BLAKE2b-256 5b47585f39e8485b22b955f82acba61ddc0481f8f663b54636e2865ed60a289f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dspy_lite-3.1.3.post3.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.1.3.post3-py3-none-any.whl.

File metadata

  • Download URL: dspy_lite-3.1.3.post3-py3-none-any.whl
  • Upload date:
  • Size: 329.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dspy_lite-3.1.3.post3-py3-none-any.whl
Algorithm Hash digest
SHA256 f2d7589da8c91be9791f6ed22152d51249c26c26e110d4af61d9c44ccca48066
MD5 12efd26fc8bd550978d6a2c23a1221a2
BLAKE2b-256 9936380128976a6772b92a0e5de47df97c3061ccf21a314a43a457b0ac3d7b79

See more details on using hashes here.

Provenance

The following attestation bundles were made for dspy_lite-3.1.3.post3-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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page