Codeium in Jupyter Notebooks

Install the Codeium extension in your Jupyter Notebook, and start seeing suggestions as you write comments and code.

If you use Jupyter in Chrome, it is easier to install the Chrome extension (click the button below). To use Codeium with Jupyter Notebooks on other browsers, follow the instructions on this page.

Install Codeium


Install Jupyter Extension

Open a new Jupyter notebook. In a cell, paste the following code and run it (Shift + Enter). This will install the pip package and Jupyter extension needed to use Codeium. If you want to upgrade the extension to the latest version, simply rerun this command.
import sys
!{sys.executable} -m pip install -U pip --user
!{sys.executable} -m pip install -U codeium-jupyter --user
!jupyter nbextension install --py codeium --user
!jupyter nbextension enable --py codeium --user
!jupyter serverextension enable --py codeium --user
If you are running Jupyter inside a virtual environment, run this instead:
import sys
!{sys.executable} -m pip install -U pip
!{sys.executable} -m pip install -U codeium-jupyter
!jupyter nbextension install --py codeium --user
!jupyter nbextension enable --py codeium --user
!jupyter serverextension enable --py codeium --user
When the commands have finished running, close the notebook and quit the Jupyter server.


Launch Jupyter

Now relaunch Jupyter and open a new or existing notebook. You should see a new menu item named Codeium. Open it and click Log In, which should open the Codeium website in a new tab.

Tip: If you do not see the menu item, that likely means that you did not restart the Jupyter server. Make sure to Ctrl+C the process and restart the server using the jupyter notebook command.


Create Account

If you do not have a Codeium account yet, you will be redirected to create an account.

Why do we require an account? In order to remove abuse of the product and make sure that we know you are an early user, we ask to authorize Codeium extensions with an account before use. We do not use, share, or sell any identifying information for any purpose.


Sign In

If you are not signed in, please sign in with your account details. Once you successfully log in, you will be provided with an authentication token which you must enter into your notebook. In the Codeium menu, select Provide Authentication Token.
Then paste your provided token:


All Done!

After providing the token, the Codeium Icon in the status bar should become green:
You're all set to use Codeium!

Use Codeium


From Code

Codeium can suggest multiple lines of code given a fragment of code that you write! Give the following simple header a shot:
def fib(n):
Codeium should generate an entire function body in grayed text, giving you a working implementation for the Nth Fibonacci number!
Note: You may get slightly different results. This is due to a constantly improving model and sampling to increase the diversity of code generated.


Accept Suggestion

If you like the suggestion, just press Tab to accept.


From Comments

Codeium can also understand comments, allowing you to get code from just a description of the desired functionality! Let's try the earlier example, except instead just write a comment and def, the Python keyword for functions:
# Nth Fibonacci number
Codeium should generate not just the function body as before, but also the function header!