Skip to main content

jupyterlab_browser_ai

Github Actions Status lite-badge

In-browser AI in JupyterLab and Jupyter Notebook

Requirements

  • JupyterLab >= 4.5.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/Qwen3-0.6B-ONNX
  • onnx-community/granite-4.0-350m-ONNX-web
  • onnx-community/Qwen2.5-Coder-0.5B-Instruct
  • HuggingFaceTB/SmolLM2-360M-Instruct

With @huggingface/transformers@4 and the latest @browser-ai/transformers-js, good additional candidates are:

  • onnx-community/LFM2-1.2B-Tool-ONNX
  • onnx-community/Qwen2.5-0.5B-Instruct

Upstream browser-ai now also supports vision-capable Transformers.js models such as HuggingFaceTB/SmolVLM-256M-Instruct, but this extension's current chat integration only sends text/tool-calling messages, not multimodal image parts, so image chat would need follow-up UI work before that model is useful here.

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",
    "onnx-community/granite-4.0-350m-ONNX-web",
    "onnx-community/LFM2-1.2B-Tool-ONNX",
    "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"
  ]
}

Tool calling and context window

The WebLLM prebuilt models use a context window of 4096 tokens. The default Jupyternaut system prompt and the tool definitions nearly fill this window, so a chat that calls tools usually fails after the first tool result.

Set webLLMContextWindowSize to give the models a larger window. A larger window uses more GPU memory. Reload the page to apply a change.

{
  "webLLMContextWindowSize": 8192
}

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.7.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.7.0
File Size Uploaded Provenance Actions
jupyterlab_browser_ai-0.7.0.tar.gz 9.4 MB With provenance Details for jupyterlab_browser_ai-0.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 28.0 MB

Release files / jupyterlab_browser_ai-0.7.0.tar.gz

Download URL jupyterlab_browser_ai-0.7.0.tar.gz
Size 9.4 MB
Tags Source
SHA-256 checksum
How to use checksums
a4ff0fadea785204cdd0751bd3fdcf0f2db59d992b727bc55ebe9a032cb10531
BLAKE2b-256 checksum
How to use checksums
ff582f7b94b30982efb130e807bd55ab43a059afe8f39fe14c496064e54f063a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

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

Download URL jupyterlab_browser_ai-0.7.0-py3-none-any.whl
Size 18.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3635f8146ac000cf878737dd35edff8124976150c9a22f29a89b58379e59b646
BLAKE2b-256 checksum
How to use checksums
efbc93214d27821d0bfe2e74a5442527237d3bea0bc612a143f3dfd4368b9144
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for jupyterlab-browser-ai 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for jupyterlab_browser_ai-0.7.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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