Skip to main content

jupyterlab_browser_ai

Github Actions Status lite-badge

In-browser AI in JupyterLab and Jupyter Notebook

Requirements

  • JupyterLab >= 4.0.0

Install

To install the extension, execute:

pip install jupyterlab_browser_ai

Chrome AI

This extension provides several features powered by Chrome's built-in AI APIs. These features require no API key and run fully on-device. They are automatically enabled when the browser supports the corresponding API and gracefully disabled otherwise.

Enabling Chrome AI

See the official Get started with built-in AI guide for full details. In short:

  1. Open chrome://flags/#optimization-guide-on-device-model and set it to Enabled.
  2. Open chrome://flags/#prompt-api-for-gemini-nano and set it to Enabled.
  3. Restart Chrome.
  4. Verify by running await LanguageModel.availability(); in the DevTools console — it should return "available".

System requirements:

  • Chrome on Windows 10/11, macOS 13+, Linux, or ChromeOS (Chromebook Plus)
  • At least 22 GB of free disk space on the volume containing your Chrome profile
  • GPU with > 4 GB VRAM, or 16 GB RAM with 4+ CPU cores

Chat provider

Chrome Built-in AI is registered as a chat provider (provider ID chrome-ai). Select it in the JupyterLab AI provider dropdown to chat with the on-device model — no API key or model download required.

Alt text generation

Right-click any image in a notebook markdown cell and select Generate Alt Text with ChromeAI. The extension sends the image to Chrome's Prompt API, generates a concise alt text description, and updates the markdown source. The alt text is also copied to the clipboard as a fallback.

Audio transcription

Right-click an audio file (.mp3, .wav, .ogg, .m4a, .aac, .flac, .opus) in the file browser and select Generate Transcript with ChromeAI. The transcript is saved as <filename>_transcript.txt in the same directory.

Notebook proofreader

Open a notebook and run the Proofread Notebook command from the command palette (or the toolbar button). The extension uses Chrome's Proofreader API to check grammar and spelling in all markdown cells and applies corrections in-place.

File summarizer

When Chrome's Summarizer API is available, files in the file browser (.ipynb, .md, .txt, .py, .js, .ts) display a sparkle badge. Click the badge to generate a TL;DR summary shown in a tooltip. Summaries are cached and automatically invalidated when the file is saved.

Transformers.js models

Transformers.js model IDs can be discovered on Hugging Face:

By default, this extension uses:

  • onnx-community/Qwen2.5-Coder-0.5B-Instruct
  • onnx-community/Qwen2.5-0.5B-Instruct
  • HuggingFaceTB/SmolLM2-360M-Instruct

The transformersJsModels setting for jupyterlab-browser-ai controls the full dropdown list. If you set it, your list replaces the defaults.

For example:

{
  "transformersJsModels": [
    "onnx-community/Qwen3-0.6B-ONNX",
    "your-org/your-custom-model",
    "HuggingFaceTB/SmolLM2-360M-Instruct"
  ]
}

WebLLM models

WebLLM model IDs can be discovered in the WebLLM prebuilt model config:

To print the model IDs from the exact @mlc-ai/web-llm version installed in this project:

node -e "import('@mlc-ai/web-llm').then(w => console.log(w.prebuiltAppConfig.model_list.map(m => m.model_id).join('\n')))"

By default, this extension uses:

  • Llama-3.2-3B-Instruct-q4f16_1-MLC
  • Llama-3.2-1B-Instruct-q4f16_1-MLC
  • Phi-3.5-mini-instruct-q4f16_1-MLC
  • gemma-2-2b-it-q4f16_1-MLC
  • Qwen3-0.6B-q4f16_1-MLC

The webLLMModels setting in jupyterlab-browser-ai controls the full WebLLM model dropdown list. If you set it, your list replaces the defaults.

For example:

{
  "webLLMModels": [
    "Qwen3-0.6B-q4f16_1-MLC",
    "Llama-3.2-1B-Instruct-q4f16_1-MLC",
    "gemma-2-2b-it-q4f16_1-MLC"
  ]
}

Uninstall

To remove the extension, execute:

pip uninstall jupyterlab_browser_ai

Contributing

Development install

Note: You will need NodeJS to build the extension package.

The jlpm command is JupyterLab's pinned version of yarn that is installed with JupyterLab. You may use yarn or npm in lieu of jlpm below.

# Clone the repo to your local environment
# Change directory to the jupyterlab_browser_ai directory
# Install package in development mode
pip install -e "."
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm build

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter lab

With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).

By default, the jlpm build command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:

jupyter lab build --minimize=False

Development uninstall

pip uninstall jupyterlab_browser_ai

In development mode, you will also need to remove the symlink created by jupyter labextension develop command. To find its location, you can run jupyter labextension list to figure out where the labextensions folder is located. Then you can remove the symlink named jupyterlab-browser-ai within that folder.

Packaging the extension

See RELEASE

Metadata

Release files for jupyterlab-browser-ai 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jupyterlab-browser-ai 0.6.0
File Size Uploaded
jupyterlab_browser_ai-0.6.0.tar.gz 7.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for jupyterlab-browser-ai 0.6.0
File Interpreter ABI Platform
jupyterlab_browser_ai-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.0 MB

Release files / jupyterlab_browser_ai-0.6.0.tar.gz

Download URL jupyterlab_browser_ai-0.6.0.tar.gz
Size 7.8 MB
Tags Source
SHA-256 checksum
How to use checksums
51a67b6fd9f2da294a87562812fdfeb767ad11f71af29da5ac54b2a7c1ff1c0c
BLAKE2b-256 checksum
How to use checksums
9a54524813e0abaa199289aea569e85449fa32d454c25d3d7ced50f33431ecc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / jupyterlab_browser_ai-0.6.0-py3-none-any.whl

Download URL jupyterlab_browser_ai-0.6.0-py3-none-any.whl
Size 15.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
22ac7199febbc8e87336da71009925dad85ec8d7960f91221683defbb1ff23c8
BLAKE2b-256 checksum
How to use checksums
a699671c1dc19d155d699943c8bd692da26717acff7c83f55d96752ed1ea350f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page