← Open Source
santiagobasulto

ipython-gpt

An ChatGPT integration for Jupyter Notebooks and the IPython Shell.

ApplicationsCodingPython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
577
Stars
38
Forks
+-2
This week
3
Contributors
Created 2023-04-15 · Updated 2026-10-11 · #16701 today
Top developers
12rambausantiagobasultokxxt

santiagobasulto/ipython-gpt is ranked 16,701 with 577 stars.

Same-category comparison

santiagobasulto/ipython-gpt is ranked 16,701 among these 8 peers; zarazhangrui/youtube-to-ebook is ranked 16,704.

Same-category comparison
NameRankMetrics
JeremiahPetersen/RepoToText16,652
Language:
Python
Stars:
579
Forks:
65
Description:
Turn an entire GitHub Repo into a single organized .txt file to use with LLM's (ChatGPT, Claude, Gemini, etc).
kochlisGit/ProphitBet-Soccer-Bets-Predictor16,660
Language:
Python
Stars:
579
Forks:
162
Description:
ProphitBet is a Machine Learning Soccer Bet prediction application. It analyzes the form of teams, computes match statistics and predicts the outcomes of a match using Advanced Machine Learning (ML) methods. The supported algorithms in this application are Neural Networks, Random Forests & Ensembl Models.
google-deepmind/ithaca16,674
Language:
Jupyter Notebook
Stars:
578
Forks:
65
Description:
Restoring and attributing ancient texts using deep neural networks.
efugier/smartcat16,691
Language:
Rust
Stars:
577
Forks:
33
Description:
Putting a brain behind `cat`🐈‍⬛ Integrating language models in the Unix commands ecosystem through text streams.
zarazhangrui/youtube-to-ebook16,704
Language:
Python
Stars:
577
Forks:
122
Description:
Claude skill for turning YouTube transcripts from your favorite channels into EPUB ebooks, delivered to your email inbox regularly.
LemonQu-GIT/ChatGLM-6B-Engineering16,706
Language:
Python
Stars:
576
Forks:
98
Description:
ChatGLM-6B Prompt Engineering Project.
laigeoffer/pmhub16,715
Language:
Java
Stars:
576
Forks:
192
zhulin025/Codex-QQ-Skin16,720
Language:
JavaScript
Stars:
576
Forks:
58
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryApplications
SubcategoryCoding
KeywordsIDE
Stars577
Forks38
Contributors3
Created date2023-04-15
Updated date2026-10-11
Stars in 1 day0
Stars in 7 days-2
Rank16,701
Previous rank16,488
Rank change-213
7-day stars rank18,488
Previous 7-day stars rank18,424
7-day stars rank change-64
Total stars rank17,313
Previous total stars rank17,283
Total stars rank change-30
CountryItaly
README summary

IPython ChatGPT extension This (standalone, no external dependencies required) extension allows you to use ChatGPT directly from your Jupyter Notebook or IPython Shell (Demo). ** This is a very early and raw version, I have a lot of things to improve regarding code quality and missing functionality. Installation Then in your notebook or ipython shell: Setup You must first generate an API key at OpenAI ( and set is an environment variable . You can do it by modifying your or starting jupyter

with it: If you're working on Google Colab, you can use the magic method (keep in mind that if you don't delete the cell, your key will be visible): There are a few other ways to set the API KEY, but the envvar is the recommended one. ChatGPT API The command interfaces with ChatGPT. It accepts multiple parameters (see Usage). Here's an example: **Important** by default, the command preserves the conversation to give the Agent some context, in the same

way that ChatGPT works. You can "reset" its status passing the flag . Agent's role (system message) and other chat parameters By default, the Chat is started with the role: _"You're a python data science coding assistant"_. You can change that by passing something different in your first : Once the conversation has started, you can't change the original message, as the context is preserved. To do so, you must reset the conversation: Setting global config You can change the defaults using

the line magic: Invoke it without parameters to see the defaults set: Other methods Display available models Usage: Available models: Display usage and accepted parameters Alternative authentication Aside from setting the environment variable, you can also set as a global variable in your notebook, or pass it directly as a parameter in any method . These alternative methods are NOT recommended, as you might leak your API Key in the notebooks' history, stored in .

Frequently asked questions

How many stars and forks are recorded?

santiagobasulto/ipython-gpt has 577 stars and 38 forks.

What is the repository rank?

santiagobasulto/ipython-gpt is ranked 16,701.

What language and category are recorded?

santiagobasulto/ipython-gpt has 577 stars, uses Python and belongs to Applications.

Which repository is closest in rank?

santiagobasulto/ipython-gpt is compared with zarazhangrui/youtube-to-ebook, ranked 16,704 with 577 stars.

README

IPython ChatGPT extension

This (standalone, no external dependencies required) extension allows you to use ChatGPT directly from your Jupyter Notebook or IPython Shell (Demo).

Important! This is a very early and raw version, I have a lot of things to improve regarding code quality and missing functionality. Check this issue for a rough "roadmap".

Installation

!pip install ipython-gpt

Then in your notebook or ipython shell:

%load_ext ipython_gpt

Setup

You must first generate an API key at OpenAI (https://platform.openai.com/account/api-keys) and set is an environment variable OPENAI_API_KEY. You can do it by modifying your .bashrc/.zshrc or starting jupyter with it:

$ OPENAI_API_KEY=[YOUR-KEY] jupyter lab
# ...
$ OPENAI_API_KEY=[YOUR-KEY] ipython

If you're working on Google Colab, you can use the %env magic method (keep in mind that if you don't delete the cell, your key will be visible):

%env OPENAI_API_KEY=sk-W8b0... your key ...

There are a few other ways to set the API KEY, but the envvar is the recommended one.

ChatGPT API

The command %%chat interfaces with ChatGPT. It accepts multiple parameters (see Usage). Here's an example:

%%chat --max-tokens=25

What's the purpose of life?
...

>>> CHAT RESPONSE

Important by default, the %%chat command preserves the conversation to give the Agent some context, in the same way that ChatGPT works. You can "reset" its status passing the flag --reset-conversation.

%%chat --reset-conversation

How can I avoid pandas using scientific notation in outputs, and do it globally?
...
...
>>> CHAT RESPONSE

Agent's role (system message) and other chat parameters

By default, the Chat is started with the role: "You're a python data science coding assistant". You can change that by passing something different in your first %%chat:

%%chat --system-message="You're a R Data Science assistant"

Your message...

Once the conversation has started, you can't change the original message, as the context is preserved. To do so, you must reset the conversation:

%%chat --system-message="You're a R Data Science assistant" --reset-conversation

Your message...

Setting global config

You can change the defaults using the %chat_config line magic:

%chat_config --system-message="You're an R data scientist coding assistant specialized in visualizations" --model "other model" --reset-conversation

Invoke it without parameters to see the defaults set:

%chat_config
...

>>>
##### Conf set:

* **Default model**: gpt-3.5-turbo
* **Default system message**: You're a python data science coding assistant
* **Chat history length**: 0

Other methods

Display available models

Usage:

%chat_models [--all-models]
%chat_models
Available models:
- gpt-3.5-turbo-0301
- gpt-3.5-turbo

Display usage and accepted parameters

%reload_ext ipython_gpt
%chat_help
...


    usage: ipykernel_launcher.py [-h] [--openai-api-key OPENAI_API_KEY]
                                 [--reset-conversation]
                                 [--system-message SYSTEM_MESSAGE]
                                 [--no-system-message] [--model MODEL]
                                 [--temperature TEMPERATURE]
                                 [--max-tokens MAX_TOKENS] [--all-models]

Alternative authentication

Aside from setting the environment variable, you can also set OPENAI_API_KEY as a global variable in your notebook, or pass it directly as a parameter in any method --openai-api-key=YOUR-KEY.

These alternative methods are NOT recommended, as you might leak your API Key in the notebooks' history, stored in .ipynb_checkpoints.

Nearby in the ranking
Similar items