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 caching
-
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
Install your preferred variant of pydantic-ai, eg. pip install pydantic-ai-slim[google].
Metadata
Release files for pico-dspy 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pico_dspy-0.2.tar.gz | 17.7 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pico_dspy-0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.1 kB
Release files / pico_dspy-0.2.tar.gz
| Download URL | pico_dspy-0.2.tar.gz |
|---|---|
| Size | 17.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7951be8e1f9993e43b3b04ea0d70f2171bca19d126bba08825204e50b84a6093
|
|
BLAKE2b-256 checksum How to use checksums |
d796f32b812d3c6b6b51f9359e03a08c4af183fca5b70334173b43a5756167db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 28, 2025.
Transparency logRelease files / pico_dspy-0.2-py3-none-any.whl
| Download URL | pico_dspy-0.2-py3-none-any.whl |
|---|---|
| Size | 20.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e71184a0057f3e8c45427e9f677209476b6e7ad7059b70c44376f366e036fc7b
|
|
BLAKE2b-256 checksum How to use checksums |
d4f94d8224cefaa5cbb7978942705f9189fbf0b6c3eadf2757928052b5952240
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 28, 2025.
Transparency logSecurity for pico-dspy 0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for pico_dspy-0.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 28, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.