A composable language model workflow builder for DSPy with dictionary-based data storage
Project description
oddspy
orchstration device for dspy
I wanted a simple-ish workflow builder for LLM workflows and wanted to learn so wrote this - it's composable action blocks that all operate on a shared dictionary as the storage for output and memory. This has it's disadvantages but as long as it fits in memory, this seems useful to me for straightforward assembly of structured data through chains of LLM calls.
How it works
Building Blocks
You can create layers of Pipelines made of Steps.
Each Step (BaseStep or LMStep) uses Processors which define either arbitrary code execution and/or language-model use. dspy.Signatures are used in each Processor input into LMSteps.
Configuration allows for setting per-task modules and dspy.Modules such as Predict, ChainOfThought, and ReAct (soon, with tools).
Information Flow
Here are two example steps:
[
BaseStep(
step_type="test base step",
processor_class=ExampleBaseProcessor,
output_key="base_step_answer"
),
LMStep(
step_type="test lm step",
lm_name=LMForTask.DEFAULT,
processor_class=ExampleLMProcessor,
output_key="lm_step_answer",
depends_on=["*"]
),
]
The output_key of the BaseStep writes to a shared dictionary which the LMStep can access, and which accumulates the outputs of all prior steps. Passing depends_on=["*"] is passing all output keys generated before this step into the current step.
Alternatively for larger workflows you could pass in depends_on=["previously_written_key", "another_key.nested_key.another_nested_key"] for precise control of which information is passed into each step (hence, the keys available for context for the LLM calls within that step).
Installation
(you should use uv) uv pip install oddspy
or
git clone *url* && uv pip install -e .
Usage
- Define a
lm_config.yamlin your root based onlm_config.yaml.example - Define
OPENROUTER_API_KEYin your.envif using openrouter - Create! See
examples/example_pipeline.pyfor a basic workflow created using this framework
Desired Features to Add Next
dspy.ReActsupport + any other new modules- Checkpoint support - tracking step execution and restarting from any step
- Improved error transparency and aesthetics for logging
- Interactivity? Tool template if needed? Infra for code-writing/editing agents?
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 oddspy-0.0.1.tar.gz.
File metadata
- Download URL: oddspy-0.0.1.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d975e70bd104df151a86b1b69e9ee193f902c6273cadf9f63879f99feb96b406
|
|
| MD5 |
68c1841d9d36c768277dc71e28be4f76
|
|
| BLAKE2b-256 |
0d3d30b12e4161a57861bf4e4d76264ab3a8d9e5807d798464f0d143c4324841
|
Provenance
The following attestation bundles were made for oddspy-0.0.1.tar.gz:
Publisher:
python-publish.yml on crdandre/oddspy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oddspy-0.0.1.tar.gz -
Subject digest:
d975e70bd104df151a86b1b69e9ee193f902c6273cadf9f63879f99feb96b406 - Sigstore transparency entry: 165470728
- Sigstore integration time:
-
Permalink:
crdandre/oddspy@9f763285f1713c1faf7383cd63510611e97821b9 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/crdandre
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@9f763285f1713c1faf7383cd63510611e97821b9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file oddspy-0.0.1-py3-none-any.whl.
File metadata
- Download URL: oddspy-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e758867dfaaba1d4addce6ddbef10359d71c6085e9d1655291bea1effaed58a6
|
|
| MD5 |
7d1ff3664b9e42e144846d57bb489b8e
|
|
| BLAKE2b-256 |
4df04c2a68a0481aa82305b101ab7db5a0a27cd6d24aa13ac77327c9d0a74b2d
|
Provenance
The following attestation bundles were made for oddspy-0.0.1-py3-none-any.whl:
Publisher:
python-publish.yml on crdandre/oddspy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oddspy-0.0.1-py3-none-any.whl -
Subject digest:
e758867dfaaba1d4addce6ddbef10359d71c6085e9d1655291bea1effaed58a6 - Sigstore transparency entry: 165470730
- Sigstore integration time:
-
Permalink:
crdandre/oddspy@9f763285f1713c1faf7383cd63510611e97821b9 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/crdandre
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@9f763285f1713c1faf7383cd63510611e97821b9 -
Trigger Event:
release
-
Statement type: