https://github.com/Neoxelox/dspy-inspector
DSPy program/pipeline inspector widget for Jupyter/VSCode Notebooks.
https://github.com/Neoxelox/dspy-inspector
dspy dspy-inspector inspector jupyter jupyter-notebook notebook pipeline plugin program vscode widget
Last synced: about 2 months ago
JSON representation
DSPy program/pipeline inspector widget for Jupyter/VSCode Notebooks.
- Host: GitHub
- URL: https://github.com/Neoxelox/dspy-inspector
- Owner: neoxelox
- License: gpl-3.0
- Created: 2024-02-07T15:17:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-15T12:46:53.000Z (over 1 year ago)
- Last Synced: 2025-04-28T07:44:05.100Z (2 months ago)
- Topics: dspy, dspy-inspector, inspector, jupyter, jupyter-notebook, notebook, pipeline, plugin, program, vscode, widget
- Language: Python
- Homepage:
- Size: 24.8 MB
- Stars: 34
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-dspy - dspy-inspector - DSPy program/pipeline inspector widget for Jupyter/VSCode Notebooks. ([DSPy](https://github.com/stanfordnlp/dspy) - A library for compiling declarative language model calls into self-improving pipelines. / Projects)
README
# dspy-inspector π 
**`DSPy program/pipeline inspector widget for Jupyter/VSCode Notebooks.`** π
> _**Note**: DSPy is going through a big refactor at this moment. Updates in the parsing logic are going to be halted in the meantime._

> Dark theme is coming soonβ’.
## Install
π `pip install dspy-inspector`
## Usage
```python
from dspy_inspector import inspectclass MultiHopRAG(dspy.Module):
def __init__(self, passages_per_hop=3, max_hops=2):
...def forward(self, question):
...inspect(MultiHopRAG)
# Or π
program = MultiHopRAG()
inspect(program) # Automatically updates
program("How many storeys are in the castle that David Gregory inherited?")
```Check an example in the [`multi_hop_rag.ipynb`](examples/multi_hop_rag.ipynb) notebook.
> All example notebooks are cached, no calls to LLMs are needed to run them.
## Roadmap
This is a personal project I made to better understand what were my DSPy programs actually doing underneath. This extension is currently in **`BETA`**, so, expect bugs. For a roadmap on what things must be fixed or done check all the `TODOs` inside the source code.
## Developing
To setup the virtual developing environment, follow these steps:
1. Install dependencies: `poetry install`
2. Install tools: `poetry run inv tool.install --include "dev*"`
3. Create kernel: `poetry run python -m ipykernel install --user --name dspy-inspector --display-name "DSPy Inspector"`
4. Select `dspy-inspector` kernel in all notebooksRun `poetry run inv help` for further commands and `poetry run inv --help` for their usage.
## Contribute
Feel free to contribute to this project : ) .
## License
This project is licensed under the [GPL-3.0 License](https://opensource.org/licenses/GPL-3) - read the [LICENSE](LICENSE) file for details.