Skip to main content

Jupyter kernel that allows you generate code from natural language prompts

Project description

ICortex Kernel

Github Actions Status

ICortex is a Jupyter kernel that supercharges your Jupyter Notebook workflow by letting you use code generation services e.g. TextCortex's ICortex API, OpenAI's Codex API, HuggingFace transformers running locally to generate Python code automatically from user prompts.

  • It is a drop-in replacement for the IPython kernel. Prompts start with a forward slash / otherwise the line is treated as regular Python code.
  • It is interactive—install missing packages directly, decide whether to execute the generated code or not, directly in the Jupyter Notebook cell.
  • It is fully extensible—if you think we are missing a model or an API, you can request it by creating an issue, or implement it yourself by subclassing ServiceBase under icortex/services.

Installation

To install the ICortex Kernel, run the following in the main project directory:

pip install icortex
icortex

Launching ICortex

You can launch the ICortex shell directly in your terminal:

icortex

If there is no configuration file icortex.toml in the project directory, the shell will prompt you to create one step by step.

Or you can create a new Jupyter notebook. Start the JupyterLab server with

jupyter lab

and choose ICortex as your kernel when creating a new notebook.

Usage

To execute a prompt with ICortex, use the / character (forward slash, also used to denote division) as a prefix. Copy and paste the following prompt into a cell and try to run it:

/print Hello World. Then print the Fibonacci numbers till 100, all in the same line

If all goes well, you should see an output similar to the following:

print('Hello World.', end=' ')
a, b = 0, 1
while b < 100:
    print(b, end=' ')
    a, b = b, a+b

Hello World.
1 1 2 3 5 8 13 21 34 55 89

You can make the kernel attempt to auto-install packages and auto-execute the returned code.

/help

Uninstalling

To uninstall, run

pip uninstall icortex

This removes the package, however, it may still leave the kernel spec in Jupyter's kernel directories, causing it to continue showing up in JupyterLab. If that is the case, run

jupyter kernelspec uninstall icortex -y

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

icortex-0.0.1.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

icortex-0.0.1-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file icortex-0.0.1.tar.gz.

File metadata

  • Download URL: icortex-0.0.1.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for icortex-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a0a44793b635b30bf55c342dac2a4ea65427438a36877a771540ad1179705fdc
MD5 6fe58df7767560ee5c82f5c04df98a25
BLAKE2b-256 d69e64041ed9d6f62d7a84704460d052d2fea37b39b3e82bcc526f42571989da

See more details on using hashes here.

File details

Details for the file icortex-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: icortex-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for icortex-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b3d0d0c9684cd2c125ce1189051e223642f21c1152034b61ee26bc78dccde762
MD5 6146f4ea8592edcdb816bc97339db611
BLAKE2b-256 76853cd814fe2a48626473a7330779042a3cfe097d8cc0818a1c4c092b7be3fd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page