Skip to main content

JupyterLab extension that adds AI-powered Explain, Fix, and Generate buttons to notebook cells

Project description

jupyter-vibe-coding

A JupyterLab 4.x extension that adds AI-powered buttons to notebook cells

  • 💡 Explain – when a cell throws an error, click Explain to get a plain-language description of what went wrong, powered by an LLM via OpenAI's API.
  • 🔧 Fix – click Fix to automatically replace the erroneous cell code with an LLM-corrected version.
  • 🪄 Generate Code – a command (jupyter-vibe-coding:generate-code) is contributed to the Cell toolbar via jupyter.lab.toolbars; it opens a prompt dialog and replaces the current code cell with generated code.

Installation

pip install jupyter-vibe-coding

This installs both the Python server extension and the pre-built JupyterLab frontend extension.

You also need an OpenAI API key exported as an environment variable:

export OPENAI_API_KEY=sk-...

Alternatively, you can use environment variables to configure a different OpenAI-API compatible LLM server:

# Preferred API key variable (falls back to OPENAI_API_KEY)
export JUPYTER_VIBE_CODING_API_KEY=sk-...

# Optional custom OpenAI-compatible endpoint
export JUPYTER_VIBE_CODING_BASE_URL=https://api.openai.com/v1

# Optional model override (default: gpt-4o-mini)
export JUPYTER_VIBE_CODING_MODEL=gpt-4o-mini

Development install

The development install works on Windows, macOS, and Linux without requiring Administrator/Developer Mode privileges.

git clone https://github.com/haesleinhuepf/jupyter-vibe-coding.git
cd jupyter-vibe-coding

# 1. Install JupyterLab and build tools
pip install jupyterlab

# 2. Install JS dependencies
jlpm install

# 3. Build the frontend extension
jlpm run build

# 4. Install the Python package in editable mode
#    This also registers the server extension automatically.
pip install -e ".[test]"

After these steps, start JupyterLab normally:

jupyter lab

Verify both extensions are detected:

jupyter server extension list
jupyter labextension list

You should see jupyter_vibe_coding in the server list and jupyter-vibe-coding in the labextension list.

To pick up TypeScript source changes during development, rebuild and restart:

jlpm run build
jupyter lab

Usage

  1. Start JupyterLab: jupyter lab
  2. Open or create a Python notebook.
  3. Run a cell that contains an error – 💡 Explain and 🔧 Fix buttons appear below the output.
  4. Click 🪄 Generate Code in the Cell toolbar to open the prompt dialog.

Architecture

jupyter-vibe-coding/
├── src/
│   ├── index.ts      # JupyterLab plugin (frontend)
│   └── handler.ts    # Helper for calling the Jupyter server REST API
├── style/
│   └── index.css     # Button styles
├── jupyter_vibe_coding/
│   ├── __init__.py   # Server extension registration
│   ├── handlers.py   # Tornado handlers + LLM helper functions
│   └── tests/
│       └── test_handlers.py
├── package.json
├── tsconfig.json
└── pyproject.toml

API endpoints

Method Path Body Response
POST /jupyter-vibe-coding/explain {ename, evalue, traceback} {explanation}
POST /jupyter-vibe-coding/fix {code, ename, evalue, traceback} {fixed_code}
POST /jupyter-vibe-coding/generate {prompt} {code}

Running the tests

pip install -e ".[test]"
pytest jupyter_vibe_coding/tests/ -v

License

BSD 3-Clause – see LICENSE.

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

jupyter_vibe_coding-0.1.1.tar.gz (148.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupyter_vibe_coding-0.1.1-py3-none-any.whl (71.0 kB view details)

Uploaded Python 3

File details

Details for the file jupyter_vibe_coding-0.1.1.tar.gz.

File metadata

  • Download URL: jupyter_vibe_coding-0.1.1.tar.gz
  • Upload date:
  • Size: 148.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for jupyter_vibe_coding-0.1.1.tar.gz
Algorithm Hash digest
SHA256 471991da8b8fd1cf57f4a96831bbdeedbdf348444b10370ad2e02694637d2a96
MD5 08852223fab9ef156ed7d480a1885835
BLAKE2b-256 738d94b1a2406ee83bf20bd038ee96fd5ae5af9ac0555b2cbf02a24524b00a55

See more details on using hashes here.

File details

Details for the file jupyter_vibe_coding-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_vibe_coding-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 75c82b3d3983803ab7610c69a81664f15efb16bfc69acec48c29354bc98f03d1
MD5 877a94d352ad6605573191d9ad0ff8d4
BLAKE2b-256 822b3857deacfe272f3f2a21001a1ba7d55e33e8e7ece577261216b8aa1ef943

See more details on using hashes here.

Supported by

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