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, including local installations using ollama:

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

# Optional custom OpenAI-compatible endpoint
export JUPYTER_VIBE_CODING_BASE_URL=http://localhost:11434/v1

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

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, fix_summary}
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.4.tar.gz (2.8 MB 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.4-py3-none-any.whl (80.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jupyter_vibe_coding-0.1.4.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • 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.4.tar.gz
Algorithm Hash digest
SHA256 6db09284238098fff01429cf046fab8d17ed3bc9621599d4f370aaf4b3e5b16b
MD5 be93328d421c3ddccebaf1e508b8710c
BLAKE2b-256 6a2c089f4795b329fbc3761e5d48bbc0dc9a17542fbc09ed4d6d86e458c55d21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jupyter_vibe_coding-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8daf9f289d93a42571ec56f6d91c7cb18637d7973527953fcc38c3bdb8380814
MD5 f5be41d0bd543df475f3b3baa129cc59
BLAKE2b-256 5377a6d104634a571b8f343e2d5631ddaf6fd2fd013c33061419f83628e97e02

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