Skip to main content

🧠 JupyterPilot AI

JupyterPilot AI (jupyterpilot-ai) is a lightweight, provider-agnostic AI coding partner for IPython and Jupyter. It brings natural language code generation (%do) and automated error healing (%fix) to your notebook.


🚀 Features

  • %do : Transform instructions into Python code instantly.
  • %fix: Post-mortem self-healing for your last error.
  • %review: Analyze the previous cell and get optimization suggestions or code reviews.
  • Context Awareness: Remembers your last 3 cells for accurate variable usage.
  • Data Observer (New): Automatically detects Pandas DataFrames, SQL engines, and MongoDB databases to provide schema context to the AI.
    • Smart MongoDB Introspection: Aggregates schema keys from the 20 most recent documents and extracts collection indexes, helping the AI write highly optimized queries.
  • Hybrid Support: Switch between local Ollama and cloud GPT-4o/Claude via LiteLLM.

📥 Installation

pip install jupyterpilot-ai

Enable Data Observer (Optional)

To enable automatic schema detection for Pandas, SQL, and MongoDB, install the data extras:

pip install "jupyterpilot-ai[data]"

Enable the Extension

Add this to any cell in your notebook or your IPython startup script:

%load_ext jupyterpilot_ai

⚙️ Configuration

JupyterPilot AI looks for a configuration file at ~/.jupyterpilot/config.json.

Switching Modes

To switch between local and paid models, simply change the "mode" value in your config file:

{
    "mode": "cloud", 
    "local": {
        "url": "http://localhost:11434/api/generate",
        "model": "qwen2.5-coder:7b"
    },
    "cloud": {
        "provider": "openai",
        "model": "gpt-4o",
        "api_key": "sk-..."
    },
    "custom_link_ai": {
        "url": "",
        "model": "",
        "api_key": ""
    }
}
  • Local Mode ("mode": "local"):

    • Uses Ollama by default.
    • Requires Ollama to be running (ollama run qwen2.5-coder:7b).
    • You can customize the url and model in the local block.
  • Cloud Mode ("mode": "cloud"):

    • Uses LiteLLM to connect to paid providers.
    • Supports OpenAI, Anthropic (Claude), Google (Gemini), etc.
    • Specify your provider, model, and api_key.
  • Custom Link AI Mode ("mode": "custom_link_ai"):

    • Connect to your custom AI API endpoint directly.
    • Set your custom url, model, and api_key.

🛠️ Usage

Basic Commands

  • %do plot a sine wave
  • %fix (after an error)
  • %review (to review the last run cell)

Advanced Data Observer Example

If you have jupyterpilot-ai[data] installed, simply connecting to your database in a cell is enough for the AI to understand your schema.

# Cell 1: Connect to your database (Pandas, SQL, or Mongo)
from pymongo import MongoClient
client = MongoClient("mongodb://localhost:27017/")
db = client["Testing"]
# Cell 2: Ask the AI to write a query without explaining your collections or fields!
%do find the most recently active admin user

Behind the scenes, JupyterPilot automatically extracts the collection names, schema keys, and indices from db and injects them into the AI's context so it generates perfect code.


📬 Contact

Wajoud Noorani - Wajoudnoorani59@gmail.com


📄 License

MIT

Metadata

Release files for jupyterpilot-ai 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jupyterpilot-ai 0.3.2
File Size Uploaded Provenance Actions
jupyterpilot_ai-0.3.2.tar.gz 9.2 kB Without provenance Details for jupyterpilot_ai-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jupyterpilot-ai 0.3.2
File Interpreter ABI Platform Actions
jupyterpilot_ai-0.3.2-py3-none-any.whl Python 3 none any Details for jupyterpilot_ai-0.3.2-py3-none-any.whl

Total release size: 17.9 kB

Release files / jupyterpilot_ai-0.3.2.tar.gz

Download URL jupyterpilot_ai-0.3.2.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
426d6b8222022da7c84d560df82d35946b3d88e0bd807e1e0f28fdf3b7a8dcfc
BLAKE2b-256 checksum
How to use checksums
5563b6d34bc68c31e6c03813cb87300c5df3849ca50d883cec16ba694f293752
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / jupyterpilot_ai-0.3.2-py3-none-any.whl

Download URL jupyterpilot_ai-0.3.2-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2fbbdf938856f3954221075961e403237e5da6b598c24612d7606c7f2a07f207
BLAKE2b-256 checksum
How to use checksums
b33959754eca787406ceee2386ba16cb163b3b6eec4a18f3b3afc7c6df4f4f09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for jupyterpilot-ai 0.3.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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