SimpleDSPy is a lightweight Python library that simplifies building and running DSPy pipelines with an intuitive interface.
Note: This project is currently a work in progress and is not officially affiliated with or endorsed by the DSPy project. It is an independent effort to create a simplified interface for working with DSPy pipelines.
- Automatic module creation from input/output names
- Pipeline management and step tracking
- Clean, minimal API
- Built-in caching and configuration
- Type hints and documentation
pip install simpledspy
from simpledspy import pipe
# Basic text processing
cleaned_text = pipe("Some messy text with extra spaces")
print(cleaned_text) # "Some messy text with extra spaces"
# Multiple inputs/outputs
name, age = pipe("John Doe, 30 years old")
print(name) # "John Doe"
print(age) # 30
# Custom descriptions
full_name = pipe(
"John", "Doe",
description="Combine first and last names"
)
print(full_name) # "John Doe"
The pipe
function automatically:
- Detects input variable names
- Creates appropriate DSPy modules
- Tracks pipeline steps
- Returns processed outputs
Contributions are welcome! Please open an issue or pull request on GitHub.
MIT License