Optional: Install Jupyter AI
Step 1 — Install Jupyter AI
Activate the environment you built in Week 2, then install:
mamba activate esa_env
mamba install -c conda-forge jupyter-ai
Check you got version 3.x:
mamba list jupyter-ai
Jupyter AI is only the chat host. It ships with no assistant of its own — that is Step 2.
Step 2 — Install one assistant
Option A — Claude, with a Claude subscription
Claude Code is a command-line agent. You log into it once in a terminal using the account you already pay for, and Jupyter AI then drives it.
1. Install Claude Code.
macOS or Linux:
curl -fsSL https://claude.ai/install.sh | bash
Windows, in PowerShell:
irm https://claude.ai/install.ps1 | iex
2. Close and reopen the terminal, then log in. Running claude opens your browser; sign in
with your Claude account. Type /exit when it is done.
claude
3. Install the adapter that lets Jupyter AI talk to it:
mamba activate esa_env
mamba install -c conda-forge nodejs
npm install -g @agentclientprotocol/claude-agent-acp
Requires a paid Claude plan — Pro, Max, Team, or Enterprise. The free claude.ai tier does not include Claude Code.
Option B — GPT, with a ChatGPT subscription
Codex is OpenAI's command-line agent. Signing in with your ChatGPT account draws on your plan's included allowance rather than API billing.
1. Install the Codex CLI and log in. At the first run choose Sign in with ChatGPT — not the API key option, which would bill you separately. Quit Codex once you are signed in.
mamba activate esa_env
mamba install -c conda-forge nodejs
npm install -g @openai/codex
codex
2. Install the adapter:
npm install -g @agentclientprotocol/codex-acp
Option C — Gemini (free)
Jupyternaut is a chat assistant that reaches a hosted model with an API key.
1. Install it, with esa_env still active:
pip install "jupyter-ai-jupyternaut>=0.1.0b1"
2. Get a free Google Gemini API key:
- Go to https://aistudio.google.com/app/apikey and sign in with a Google account.
- Click Create API key. If it asks you to choose a project, any project will do.
- Copy the key — it is shown once. If you lose it, delete it there and create a new one.
Keep the key on your clipboard. You will paste it into JupyterLab in Step 3 — there is no file to edit.
Step 3 — Create a chat
Restart Jupyter Lab so it picks up what you installed:
jupyter lab
Click the Chat card on the launcher page, or the + button in the chat sidebar, and give the chat a name. Then click the persona menu in the message toolbar and choose the one you installed:
| You installed | Choose this persona | Then |
|---|---|---|
| Option A (Claude) | Claude | Nothing else — it uses your logged-in account |
| Option B (GPT) | Codex | Nothing else — it uses your logged-in account |
| Option C (Gemini) | Jupyternaut | Add your key and pick a model, below |
Option C only — add the key in the settings. In the chat panel, open the Jupyternaut settings (the gear icon), paste your Gemini API key into the API key field, and save. Then set the chat model to:
gemini/gemini-3.6-flash
The model picker has a search box; type part of the name to find it. This is much easier than
editing files by hand, and it is the recommended way. JupyterLab stores the key in a .env file
in your workspace for you — so if you see one appear, that is why. Never submit or share that
file, and if the key ever leaks, revoke it at the AI Studio link above and create a new one.
Ask your assistant something to confirm it works:
What does the pandas groupby method do?
If your persona is not in the menu, Jupyter AI could not find what it needs: the package or the
adapter is not installed, it was installed outside esa_env, or Jupyter Lab has not been restarted
since you installed it.
If Jupyternaut answers but says no model is available, the key was not saved — reopen the settings and check it is there.
If Claude or Codex replies asking you to log in, run claude or codex in a terminal, finish
the sign-in there, and restart Jupyter Lab.
Recording your prompts
Section 4.5 of the notebook asks for a log of every prompt you used and what you did with each answer. That log is required however you access your assistant.
Jupyter AI makes it a little easier: every chat is saved as a .chat file in the same folder as
your notebook, so your prompts are recorded for you and you can attach that file instead of
retyping them. You still have to say what you did with each answer — used as-is, edited, or
rejected.