Skip to main content

Jupyter kernel that can generate Python code from natural language prompts

Project description



Github Actions Status PyPI Latest Release Downloads Documentation Status License Discord Twitter

A Python library for soft-code development — program in plain English with AI code generation!


ICortex is a Jupyter kernel that lets you develop soft programs:

  • sets of instructions (i.e. prompts) written in natural language (such as English)
  • processed by language models that generate Python code
  • to perform useful work in various contexts
  • more flexibly than regular software.

To put it simply—in goes English, out comes Python:

https://user-images.githubusercontent.com/2453968/196814906-1a0de2a1-27a7-4aec-a960-0eb21fbe2879.mp4

TODO: Prompts are given using the %prompt magic now, update the video accordingly

ICortex is ...

  • a drop-in replacement for the IPython kernel. Prompts can be executed with the magic commands %prompt or %p for short.
  • interactive—install missing packages directly, decide whether to execute the generated code or not, and so on, directly in the Jupyter Notebook cell.
  • open source and 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.

It is similar to Github Copilot but with certain differences that make it stand out:

Feature GitHub Copilot ICortex
Generates code ... In the text editor In a Jupyter kernel (language backend that provides the execution environment)
From ... Existing code and comments Plain English prompts
Level of control over context used to generate code Low High
Plain language instructions are ... Just comments Standalone programs
The resulting program is ... Static Dynamic—adapts to the context it is executed in
Can connect to different code generation APIs No Yes

The main difference between ICortex and a code-generation plugin like GitHub Copilot is that ICortex is a programming paradigm similar to literate programming or natural language programming, where the natural language prompt is the first-class citizen, and which allows for fine-grained control over the code-generation context.

ICortex is currently in alpha, so expect breaking changes. We are giving free credits to our first users—join our Discord to help us shape it.

Installation

Install directly from PyPI:

pip install icortex
# This line is needed to install the kernel spec to Jupyter:
python -m icortex.kernel.install

Quickstart

Click here to visit the docs and get started using ICortex.

Getting help

Feel free to ask questions in our Discord.

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.1.1.tar.gz (100.0 kB view hashes)

Uploaded Source

Built Distribution

icortex-0.1.1-py3-none-any.whl (103.4 kB view hashes)

Uploaded Python 3

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