Skip to main content

DSPy program/pipeline inspector widget for Jupyter/VSCode Notebooks.

Project description

dspy-inspector 🔍 BETA

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.

Demo

Dark theme is coming soon™.

Install

👉 pip install dspy-inspector

Usage

from dspy_inspector import inspect

class 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 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 notebooks

Run poetry run inv help for further commands and poetry run inv <command> --help for their usage.

Contribute

Feel free to contribute to this project : ) .

License

This project is licensed under the GPL-3.0 License - read the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dspy_inspector-0.7.0.tar.gz (26.9 kB view details)

Uploaded Source

Built Distribution

dspy_inspector-0.7.0-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file dspy_inspector-0.7.0.tar.gz.

File metadata

  • Download URL: dspy_inspector-0.7.0.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1019-azure

File hashes

Hashes for dspy_inspector-0.7.0.tar.gz
Algorithm Hash digest
SHA256 bce4b5ff37ec7f0242db99fb99ddda3c2f44ae5ad7aba1a80a575896d6685ca9
MD5 c867de3ea463c9e739a71c77411ad205
BLAKE2b-256 a05cf0eca5a3347932ac00a6b9e1be96282fd013e28ff1152e90a55e744b3857

See more details on using hashes here.

File details

Details for the file dspy_inspector-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: dspy_inspector-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 27.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1019-azure

File hashes

Hashes for dspy_inspector-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b1ef0922607d158b36726efe007e1b986d831cf179f222a4933638ea6b6eb95
MD5 ab883a9823bc6500652f48b0201afa75
BLAKE2b-256 1bddd83782176590e7e9c2d70ad48dbbd0790f006ae2e024ae5f326b7457c452

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page