Coder Social home page Coder Social logo

neoxelox / dspy-inspector Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 3.0 25.38 MB

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

License: GNU General Public License v3.0

Python 75.90% CSS 11.34% SCSS 12.75%
dspy inspector jupyter jupyter-notebook notebook pipeline plugin program vscode widget dspy-inspector

dspy-inspector's Introduction

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.

dspy-inspector's People

Contributors

neoxelox avatar

Stargazers

Yetmens avatar Valério Cardoso avatar Ishan Marikar avatar Rodolfo Rodriguez Girbes avatar  avatar Straughter "BatmanOsama" Guthrie avatar Andrew Eisenhawer avatar evwilliams avatar  avatar Shreyas Prasad avatar Marco Patiño López avatar Kevin Armengol avatar Omar Khattab avatar  avatar

Watchers

 avatar  avatar Magdalena Lederbauer avatar

dspy-inspector's Issues

[BUG]: AttributeError: module 'dspy' has no attribute 'AzureOpenAI'

Impact

Hinder: It obstructs me to do what I want

Description

I am using dspy.AzureOpenAI with dspy-ai-2.4.0 There's a conflict with the specified version in the toml file

dspy-ai = "2.1.10"
Error: AttributeError: module 'dspy' has no attribute 'AzureOpenAI'

Please update the dspy-ai version in the toml file. Thank you.

Steps To Reproduce

In your terminal:

pip install dspy-ai
pip install dspy-inspector

Run Python code:

import dspy

api_key = 'api-key'
base = 'api-base'
engine = 'gpt-4'
version = '2024-02-15-preview'

llm = dspy.AzureOpenAI(model=engine, api_key=api_key, api_base=base, api_version=version, model_type="chat")

dspy.settings.configure(lm=llm)

Additional Information

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.