Bring-your-own-LLM chat assistant for Jupyter notebooks — works with OpenAI, Anthropic, Gemini, AWS Bedrock, and any OpenAI-compatible endpoint.
Project description
notebook-assistant
Bring-your-own-LLM chat assistant for Jupyter notebooks. Load a DataFrame or markdown file, ask questions in plain English, get markdown-rendered answers right in your cell — with the provider you already pay for.
Supports OpenAI, Anthropic, Google Gemini, AWS Bedrock, and any OpenAI-compatible endpoint (e.g. Euron), routed through LiteLLM.
Install
pip install notebook-assistant
For AWS Bedrock also install the bedrock extra (adds boto3):
pip install "notebook-assistant[bedrock]"
Quickstart
Pick a provider, pass your key, ask a question.
OpenAI
from notebook_assistant import NotebookAssistant
assistant = NotebookAssistant(
model="openai/gpt-4o",
api_key="sk-...", # or set OPENAI_API_KEY env var
)
assistant.ask("Give me three exploratory questions for a sales dataset.")
Anthropic
assistant = NotebookAssistant(
model="anthropic/claude-3-5-sonnet-20241022",
api_key="sk-ant-...", # or ANTHROPIC_API_KEY
)
Google Gemini
assistant = NotebookAssistant(
model="gemini/gemini-1.5-pro",
api_key="...", # or GEMINI_API_KEY
)
AWS Bedrock
assistant = NotebookAssistant(
model="bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0",
aws_region="ap-south-1",
# aws_access_key_id / aws_secret_access_key optional — falls back to
# boto3's standard credential chain (env vars, IAM role, ~/.aws/credentials).
)
You can also pass an inference-profile ARN as the model id.
Euron (OpenAI-compatible)
assistant = NotebookAssistant(
model="openai/gpt-5.3-instant",
api_key="...", # your Euron API key
api_base="https://api.euron.one/api/v1/euri",
)
Any other OpenAI-compatible endpoint works the same way — pass
model="openai/<name>" with a matching api_base.
Loading context
import pandas as pd
from notebook_assistant import NotebookAssistant
df = pd.read_csv("sales.csv")
assistant = NotebookAssistant(model="openai/gpt-4o", api_key="sk-...")
assistant.add_context(
instructions="Focus on month-over-month trends.",
dataframes={"sales": df},
markdown_path="docs/glossary.md", # optional
)
assistant.ask("Which product saw the steepest decline last quarter?")
add_context accepts any combination of instructions, dataframes, and
markdown_path. The content becomes the first user message in the
conversation so every follow-up question sees it.
Interactive chat
assistant.chat() # type 'exit' to quit
Conversation management
assistant.history # list of {"role", "content"} dicts
assistant.reset() # clear context and history
Configuration reference
| Argument | Description |
|---|---|
model |
LiteLLM-style string: <provider>/<model>. See the LiteLLM provider list. |
api_key |
Provider API key. If omitted, LiteLLM reads the provider's standard env var. |
api_base |
Override endpoint — for Euron or self-hosted OpenAI-compatible gateways. |
aws_region, aws_access_key_id, aws_secret_access_key, aws_session_token |
Bedrock-specific credentials. Fall back to the boto3 credential chain. |
system_prompt |
Custom system prompt. Defaults to a data-analysis-focused prompt. |
temperature |
Sampling temperature (default 0.2). |
max_tokens |
Max response tokens (default 2048). |
read_timeout |
Per-request timeout in seconds (default 60). |
Examples
examples/quickstart.ipynb— end-to-end walkthrough with multiple providers.
Contributing
See CONTRIBUTING.md. Issues and PRs welcome.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file notebook_assistant-0.2.0.tar.gz.
File metadata
- Download URL: notebook_assistant-0.2.0.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b36166c05401c40200b6a96c430cc0082e8631a62e14372f6f9f81a70a7db1cd
|
|
| MD5 |
deef2e159a9f0dd324dcb8b001f2f0fb
|
|
| BLAKE2b-256 |
33e6747d2444b664c1625ff178ba1a817c08f0dcdaa76a574ff327fe163f8621
|
Provenance
The following attestation bundles were made for notebook_assistant-0.2.0.tar.gz:
Publisher:
publish.yml on BenRoshan100/NotebookAssistant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
notebook_assistant-0.2.0.tar.gz -
Subject digest:
b36166c05401c40200b6a96c430cc0082e8631a62e14372f6f9f81a70a7db1cd - Sigstore transparency entry: 1340580662
- Sigstore integration time:
-
Permalink:
BenRoshan100/NotebookAssistant@60009d641e9b446a62c0a8c0697e3eece3d7d505 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/BenRoshan100
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@60009d641e9b446a62c0a8c0697e3eece3d7d505 -
Trigger Event:
push
-
Statement type:
File details
Details for the file notebook_assistant-0.2.0-py3-none-any.whl.
File metadata
- Download URL: notebook_assistant-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34c431d8ab6278e178368677f8ef6aa344c80b0f16ca00f40eb3e4bd4d7d7d9e
|
|
| MD5 |
eb14e1ce9c2a2e27a691462cf323ad6a
|
|
| BLAKE2b-256 |
7ba219629b1343d2b9d9f1b997ae0fa6575b99c3a209899b6641eca98306c6d9
|
Provenance
The following attestation bundles were made for notebook_assistant-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on BenRoshan100/NotebookAssistant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
notebook_assistant-0.2.0-py3-none-any.whl -
Subject digest:
34c431d8ab6278e178368677f8ef6aa344c80b0f16ca00f40eb3e4bd4d7d7d9e - Sigstore transparency entry: 1340580665
- Sigstore integration time:
-
Permalink:
BenRoshan100/NotebookAssistant@60009d641e9b446a62c0a8c0697e3eece3d7d505 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/BenRoshan100
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@60009d641e9b446a62c0a8c0697e3eece3d7d505 -
Trigger Event:
push
-
Statement type: