No project description provided
Project description
pico-dspy
A stripped-down version of dspy: https://github.com/stanfordnlp/dspy
Use case
dspy may be too bulky and slow to import in some cases, especially
during highly iterative development with code auto
reloaders. pico-dspy lets you use the usual signature+predict flow
during development and switch your dspy-compatible signatures to the
regular dspy when you need GEPA, fine tuning, etc.
Limitations
Several features or limitations compared to dspy:
-
uses
pydantic-aiinstead oflitellm, aslitellmis infamously slow to import (https://github.com/BerriAI/litellm/issues/7605) -
uses lazy imports (with
wrapt) to reduce import time -
just inference, no GEPA or anything
-
only
JSONAdapter, only oneLMtype -
only
Predictsupported -
text inference only
-
no tool support
-
no async api
-
no loading and saving
-
no
dspy.configure -
tested only with gemini
What works
import pico_dspy as dspy
class EmailParse(dspy.Signature):
"""
Parse a raw email.
"""
raw_email = dspy.InputField(desc="Raw email")
subject = dspy.OutputField(desc="Email subject")
body = dspy.OutputField(desc="Email text body")
attachments: list[str] = dspy.OutputField(desc="Email text attachments")
RAW_EMAIL = """\
From : foo@example.net
To: bar@example.net
Subject: hello
Hello there
-- bar
"""
lm = dspy.LM('gemini/gemini-2.5-flash-lite')
pred = dspy.Predict(signature=EmailParse)
result = pred(lm=lm, raw_email=RAW_EMAIL)
print(dict(result))
print(result.get_lm_usage())
Install
pip install pico-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 pico_dspy-0.1.tar.gz.
File metadata
- Download URL: pico_dspy-0.1.tar.gz
- Upload date:
- Size: 35.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6922183c9fd80afac2c9bba879a839b1e764df207265f8d23bf2ba27829fb9d
|
|
| MD5 |
c5ceb88351277582ce07d2fd8c770a89
|
|
| BLAKE2b-256 |
f668e8654209e274c271397b4d38921d04d8be42f3cddd48dda133da61b6eaa3
|
Provenance
The following attestation bundles were made for pico_dspy-0.1.tar.gz:
Publisher:
publish.yml on mbachry/pico-dspy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pico_dspy-0.1.tar.gz -
Subject digest:
d6922183c9fd80afac2c9bba879a839b1e764df207265f8d23bf2ba27829fb9d - Sigstore transparency entry: 780800386
- Sigstore integration time:
-
Permalink:
mbachry/pico-dspy@63399649ae8bdc57db469485ffa6aca8a0579b4f -
Branch / Tag:
refs/tags/v0.1 - Owner: https://github.com/mbachry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@63399649ae8bdc57db469485ffa6aca8a0579b4f -
Trigger Event:
push
-
Statement type:
File details
Details for the file pico_dspy-0.1-py3-none-any.whl.
File metadata
- Download URL: pico_dspy-0.1-py3-none-any.whl
- Upload date:
- Size: 43.4 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 |
7dc3e2bceed0d19aed69ba2fd3d61fc77fa651cd4d22392bc524e122dced145d
|
|
| MD5 |
5c7703f3cb4c4a99a311fd309495b8b9
|
|
| BLAKE2b-256 |
7f4a97470892f0a76a7044cec7ceab52819cffb070916f8f558e37e36dfca7f3
|
Provenance
The following attestation bundles were made for pico_dspy-0.1-py3-none-any.whl:
Publisher:
publish.yml on mbachry/pico-dspy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pico_dspy-0.1-py3-none-any.whl -
Subject digest:
7dc3e2bceed0d19aed69ba2fd3d61fc77fa651cd4d22392bc524e122dced145d - Sigstore transparency entry: 780800387
- Sigstore integration time:
-
Permalink:
mbachry/pico-dspy@63399649ae8bdc57db469485ffa6aca8a0579b4f -
Branch / Tag:
refs/tags/v0.1 - Owner: https://github.com/mbachry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@63399649ae8bdc57db469485ffa6aca8a0579b4f -
Trigger Event:
push
-
Statement type: