Jupyter kernel that can generate Python code from natural language prompts
Project description
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
undericortex/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
Built Distribution
File details
Details for the file icortex-0.1.1.tar.gz
.
File metadata
- Download URL: icortex-0.1.1.tar.gz
- Upload date:
- Size: 100.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3eeaf02d8315b53555e2a3abba14740c4fb61f9f6422bfca97d0e8b71984ded8 |
|
MD5 | 40b1308dba763200c132adf931ee13ea |
|
BLAKE2b-256 | 56b7c2fd87973297e529214f0e1cc5848da3a446bd4444bf7d4c87f358ebb8d3 |
File details
Details for the file icortex-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: icortex-0.1.1-py3-none-any.whl
- Upload date:
- Size: 103.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 042e6f32e4d10bffd3dfb4a91d184f63773c74f70fd2b2fccbfe70adb765603a |
|
MD5 | d192b028c3ae580acdd5f7f00471de94 |
|
BLAKE2b-256 | e0740f56611aa81e3cfa90fd5aeaab5381710f843382b7317070b27edaed88a9 |