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.2.tar.gz (157.0 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.2-py3-none-any.whl (79.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jupyter_vibe_coding-0.1.2.tar.gz
  • Upload date:
  • Size: 157.0 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.2.tar.gz
Algorithm Hash digest
SHA256 664820078b5da781d98f0c838b353d3983eea2cd61b056b98f295822dfe28ad3
MD5 115a36e10a52a67e192110af9f66f4d5
BLAKE2b-256 a4870ea382eee9de99956d82212d6177235ef6887ce5d0cbc88ada938d14e9e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jupyter_vibe_coding-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e1f51e7ac0e471960feec5fb970e0fc859f63a5f985647e5094a866e61552019
MD5 6e7f3b4e6b6fcffc67f66311e63885e5
BLAKE2b-256 baaf3167aa8f7264417a864413f6102037966c97fa97b67b831c68b3dc1bc828

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