Metadata-Version: 2.4
Name: dspy-lite
Version: 3.1.3.post1
Summary: DSPy with litellm replaced by litelm and numpy made optional
Project-URL: Homepage, https://github.com/kennethwolters/dspy-lite
Project-URL: Repository, https://github.com/kennethwolters/dspy-lite
Project-URL: Issues, https://github.com/kennethwolters/dspy-lite/issues
Project-URL: Documentation, https://dspy.ai
Author-email: Omar Khattab <okhattab@stanford.edu>
License: MIT License
        
        Copyright (c) 2023 Stanford Future Data Systems
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: ai,dspy,language-models,llm,prompt-optimization
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: anyio
Requires-Dist: asyncer==0.0.8
Requires-Dist: cachetools>=5.5.0
Requires-Dist: cloudpickle>=3.0.0
Requires-Dist: diskcache>=5.6.0
Requires-Dist: gepa[dspy]==0.0.27
Requires-Dist: json-repair>=0.54.2
Requires-Dist: litelm>=0.3.0
Requires-Dist: openai>=1.0.0
Requires-Dist: orjson>=3.9.0
Requires-Dist: pydantic>=2.0
Requires-Dist: regex>=2023.10.3
Requires-Dist: requests>=2.31.0
Requires-Dist: tqdm>=4.66.1
Requires-Dist: typeguard>=4.4.3
Requires-Dist: xxhash>=3.5.0
Provides-Extra: all
Requires-Dist: litelm[anthropic]; extra == 'all'
Requires-Dist: litelm[bedrock]; extra == 'all'
Requires-Dist: litelm[cloudflare]; extra == 'all'
Requires-Dist: numpy>=1.26.0; extra == 'all'
Provides-Extra: anthropic
Requires-Dist: litelm[anthropic]; extra == 'anthropic'
Provides-Extra: bedrock
Requires-Dist: litelm[bedrock]; extra == 'bedrock'
Provides-Extra: cloudflare
Requires-Dist: litelm[cloudflare]; extra == 'cloudflare'
Provides-Extra: dev
Requires-Dist: build>=1.0.3; extra == 'dev'
Requires-Dist: datamodel-code-generator>=0.26.3; extra == 'dev'
Requires-Dist: litelm>=0.3.0; extra == 'dev'
Requires-Dist: pillow>=10.1.0; extra == 'dev'
Requires-Dist: pre-commit>=3.7.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.26.0; extra == 'dev'
Requires-Dist: pytest-mock>=3.12.0; extra == 'dev'
Requires-Dist: pytest>=6.2.5; extra == 'dev'
Requires-Dist: ruff>=0.3.0; extra == 'dev'
Provides-Extra: embeddings
Requires-Dist: numpy>=1.26.0; extra == 'embeddings'
Provides-Extra: langchain
Requires-Dist: langchain-core; extra == 'langchain'
Provides-Extra: mcp
Requires-Dist: mcp; (python_version >= '3.10') and extra == 'mcp'
Provides-Extra: optuna
Requires-Dist: optuna>=3.4.0; extra == 'optuna'
Provides-Extra: test-extras
Requires-Dist: datasets>=2.14.6; extra == 'test-extras'
Requires-Dist: langchain-core; extra == 'test-extras'
Requires-Dist: mcp; (python_version >= '3.10') and extra == 'test-extras'
Requires-Dist: optuna>=3.4.0; extra == 'test-extras'
Requires-Dist: pandas>=2.1.1; extra == 'test-extras'
Provides-Extra: weaviate
Requires-Dist: weaviate-client~=4.5.4; extra == 'weaviate'
Description-Content-Type: text/markdown

# dspy-lite

DSPy with [litellm](https://github.com/BerriAI/litellm) replaced by [litelm](https://github.com/kennethwolters/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

```bash
pip install dspy-lite
```

With provider extras:

```bash
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

```python
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](https://dspy.ai)

## License

MIT (inherited from DSPy)
