nbinlineai

AI questions inside your notebook

nbinlineai adds editable AI questions and paired answers to JupyterLab notebooks. Ask about nearby code, refer to a live Python value, or let the model call a function you explicitly offer. The conversation stays as readable Markdown when you save the notebook.

Start here

  1. Install nbinlineai in the environment running JupyterLab and restart the whole server. In a uv project, run uv add jupyterlab nbinlineai, then uv run jupyter lab.
  2. Open a Python notebook. Use Configure AI to sign in with ChatGPT or save an OpenAI or Anthropic API key; choose the notebook’s model in AI defaults.
  3. Click + AI Prompt, write a question, and press Shift+Enter. The answer appears in a separate Markdown cell.

Notebook defaults, an AI question, and its saved answer

Notebook defaults, an AI question, and its saved answer

The setup chapter walks through installation and connections. The user guide explains prompts, context, tools, editing, Run All, and saved notebook data.

Learn by doing

Version 0.1.19 includes parameter descriptions for model tools and a worked starter tutorial. The Tool API reference gives types, parameter descriptions, result descriptions and function docstrings from the Python source.

The notebook gallery has walkthroughs and complete tool-catalog notebooks. Each tool in the Tool catalog links to a concrete normal Python or JupyterLab action and an AI question. The examples use disposable inputs; copy a notebook before editing it.

A tool declaration gives the model access to a selected function, but it does not make the function run by itself. A direct browser-media call from Python returns a mutable receipt before browser work finishes. Its status and result can change after the call returns.

An AI call returns an initial snapshot. Inspect the receipt later, or ask operation_status in a later AI turn, before using a source ID, media result, or saved path. Browser media operations shows the pattern.

Find a topic

Guide What it covers
User guide A reading path through the eight manual chapters.
Tool catalog Function signatures, bounds, and exact notebook demonstrations.
Tool API reference Types, parameter descriptions, result descriptions and function docstrings.
Notebook examples Walkthroughs, complete catalog notebooks, and how to use their results.
FAQ Common questions about context, Keep answer, tools, and execution.
Architecture The browser, Jupyter server, notebook kernel, and model request boundary.
Prior art The ideas behind this notebook workflow.
Development Contributor setup and verification commands.

Questions and answers remain in the notebook. API keys stay in the server user’s configuration, and a confirmed image attaches only to the question you choose. Saved notebooks and privacy explains these boundaries.