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 bylitelm(2.6k LOC, 2 deps)numpymoved 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_providerpassthrough not yet supported (litelm gap)- Pydantic
response_formatrouting tobeta.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
Release history Release notifications | RSS feed
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.1.3.post1.tar.gz.
File metadata
- Download URL: dspy_lite-3.1.3.post1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87b7f99b8d3ca893cd6d6c37f7c88ea29e207c60c6a11694d2da6c93cc775b33
|
|
| MD5 |
747ebf7af884817f444a2f74b61599c8
|
|
| BLAKE2b-256 |
722c9b08e5c8cb3c784e5406eafbac70fa5a827be815252d17259775bee46d5d
|
Provenance
The following attestation bundles were made for dspy_lite-3.1.3.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.1.3.post1.tar.gz -
Subject digest:
87b7f99b8d3ca893cd6d6c37f7c88ea29e207c60c6a11694d2da6c93cc775b33 - Sigstore transparency entry: 1111994014
- Sigstore integration time:
-
Permalink:
kennethwolters/dspy-lite@94c85e0af3b2f6eb102cf5dd8ede872337cedaab -
Branch / Tag:
refs/tags/v3.1.3.post1 - Owner: https://github.com/kennethwolters
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@94c85e0af3b2f6eb102cf5dd8ede872337cedaab -
Trigger Event:
release
-
Statement type:
File details
Details for the file dspy_lite-3.1.3.post1-py3-none-any.whl.
File metadata
- Download URL: dspy_lite-3.1.3.post1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ce7c127f7a452250b1436e0654d9f9439a8f1f17b47281d980f489ffda4509b
|
|
| MD5 |
357da5dc4790a0ae6ba970140f428f76
|
|
| BLAKE2b-256 |
e759035a882e51428c3402bfb99a0a9191b69130c66d9c7e1ad177b0db63e560
|
Provenance
The following attestation bundles were made for dspy_lite-3.1.3.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.1.3.post1-py3-none-any.whl -
Subject digest:
6ce7c127f7a452250b1436e0654d9f9439a8f1f17b47281d980f489ffda4509b - Sigstore transparency entry: 1111994055
- Sigstore integration time:
-
Permalink:
kennethwolters/dspy-lite@94c85e0af3b2f6eb102cf5dd8ede872337cedaab -
Branch / Tag:
refs/tags/v3.1.3.post1 - Owner: https://github.com/kennethwolters
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@94c85e0af3b2f6eb102cf5dd8ede872337cedaab -
Trigger Event:
release
-
Statement type: