nbinlineai

AI prompts in JupyterLab notebooks

View the Project on GitHub rahuldave/nbinlineai

AI conversations inside your notebook

nbinlineai adds AI prompt cells to JupyterLab. Ask about the code and notes above a cell, refer to live Python values, and let a model call functions you explicitly name. Prompts and answers stay in the notebook as readable Markdown.

New in 0.1.14: choose a default connection for notebooks without saved choices, keep cell provider choices inherited unless explicitly overridden, and see a clean waiting answer cell before text streams in.

Start here

  1. Install nbinlineai from JupyterLab’s Extension Manager, then restart the whole Jupyter server.
  2. Open a Python notebook and use Configure AI to sign in with ChatGPT or save an OpenAI or Anthropic API key. Set Default connection for new notebooks there if you want a user preference.
  3. Choose this notebook’s connection, model, and style in AI defaults. Individual cells inherit them unless overridden.
  4. Click + AI Prompt, write a question, and press Shift+Enter.

For a uv project:

uv add jupyterlab nbinlineai
uv run jupyter lab

Notebook defaults, an AI prompt, and its saved answer

User guide chapters

The user guide index shows the reading order. Open the chapter you need:

  1. Install and connect — install, sign in with ChatGPT, or save an API key.
  2. Write and run AI questions — prompts, answers, code copying, and insertion.
  3. Models, styles, and effort — notebook and cell choices.
  4. Edit, rerun, and run notebooks — Keep answer, corrections, and Run All.
  5. Choose notebook context — cell choices, previews, and provider budgets.
  6. Live values and tools — kernel references and declared functions.
  7. Saved notebooks and privacy — cells, keys, and account state.
  8. Troubleshooting and limits — common failures and size limits.

Read more

Guide What you will find
User guide index The reading order and links to all eight chapters.
Tools reference Import and declare tools; check the 51 functions, groups, and limits.
Examples guide Try task walkthroughs and downloadable teaching notebooks.
FAQ Run All and cell toggles, correcting answers, kernel loss, restarts, cancellation, and other edge cases.
Architecture How the browser, Jupyter Server, notebook kernel, and model provider work together; saved data and tool schemas.
Development Set up with uv, build the extension, run the tests, and maintain these docs.

New in version 0.1.14

Added in version 0.1.13

Added in version 0.1.12

Added in version 0.1.11

Added in version 0.1.10

Added in version 0.1.9

The Context toolbar now shows just the notebook mode and Details, with one disclosure arrow. Question-specific information and the optional Check context action are inside Details. A check shows progress, then cell/tool counts and a completion time, or a visible failure reason. Running an AI question always calculates context automatically.

Each cell’s Context/Tools controls now sit above its content, aligned with the text. AI question controls move above the question too, and the current question is plainly labeled as always included.

Added in version 0.1.8

Version 0.1.8 adds selectable notebook context.

In version 0.1.7

Notebook conversations

ChatGPT subscription use has account limits and may use additional credits. OpenAI and Anthropic API requests are billed separately by those providers.

Install from PyPI · Source on GitHub · Report an issue

Licensed under GPL-3.0-only, matching ai-jup.