Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit 858cfb8

Browse files
committed
Updated README
1 parent 2464099 commit 858cfb8

1 file changed

Lines changed: 45 additions & 16 deletions

File tree

README.md

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
[![License](https://img.shields.io/github/license/textcortex/icortex.svg?color=blue)](https://github.com/textcortex/icortex/blob/main/LICENSE)
55
[![](https://dcbadge.vercel.app/api/server/QtfGgKneHX?style=flat)](https://discord.textcortex.com/)
66

7-
ICortex is a [Jupyter kernel](https://jupyter-client.readthedocs.io/en/latest/kernels.html) that supercharges your Jupyter Notebook workflow by letting you generate Python code automatically from natural language prompts:
7+
ICortex is a [Jupyter kernel](https://jupyter-client.readthedocs.io/en/latest/kernels.html) that lets you program with plain English, by letting you generate Python code from natural language prompts:
88

99
https://user-images.githubusercontent.com/2453968/193281898-8f2b4311-2a3a-4bbf-a7d4-b31fcd4f5e08.mp4
1010

1111
It is ...
1212

1313
- a drop-in replacement for the IPython kernel. Prompts start with a forward slash `/`—otherwise the line is treated as regular Python code.
14-
- interactive—install missing packages directly, decide whether to execute the generated code or not, directly in the Jupyter Notebook cell.
14+
- a [Natural Language Programming](https://en.wikipedia.org/wiki/Natural-language_programming) interface—prompts written in plain English automatically generate Python code which can then be executed in the global namespace.
15+
- interactive—install missing packages directly, decide whether to execute the generated code or not, and so on, directly in the Jupyter Notebook cell.
1516
- 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`](icortex/services).
1617

1718
ICortex is currently in alpha, so expect breaking changes. We are giving free credits to our first users—[join our Discord](https://discord.textcortex.com/) to help us shape this product.
@@ -30,17 +31,23 @@ This will install the Python package and the `icortex` command line interface. Y
3031

3132
Before you can use ICortex in Jupyter, you need to configure it for your current project.
3233

33-
To do that, simply run in your terminal:
34+
If you are using the terminal:
3435

3536
```bash
3637
icortex init
3738
```
3839

39-
The shell will instruct you step by step and create a configuration file `icortex.toml` in your current directory.
40+
Alternatively, you can initialize directly in a Jupyter Notebook ([instructions on how to start JupyterLab](https://jupyterlab.readthedocs.io/en/stable/getting_started/starting.html)):
41+
42+
```
43+
//init
44+
```
45+
46+
The shell will then instruct you step by step and create a configuration file `icortex.toml` in the current directory.
4047

4148
### Choosing a code generation service
4249

43-
ICortex supports different code generation services such as the TextCortex code generation API, OpenAI Codex API, local HuggingFace transformers, and so on.
50+
ICortex supports different code generation services such as the TextCortex API, OpenAI Codex API, local HuggingFace transformers, and so on.
4451

4552
To use the TextCortex code generation API,
4653

@@ -54,18 +61,10 @@ If you use up the starter credits and would like to continue testing out ICortex
5461

5562
You can also try out different services e.g. OpenAI's Codex API, if you have access. You can also run code generation models from HuggingFace locally, which we have optimized to run on the CPU—though these produce lower quality outputs due to being smaller.
5663

57-
### Launch JupyterLab
58-
59-
Now that ICortex is configured for your project, you can launch JupyterLab:
60-
61-
```bash
62-
jupyter lab
63-
```
64-
65-
and choose ICortex as your kernel when creating a new notebook.
66-
6764
## Usage
6865

66+
### Executing prompts
67+
6968
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:
7069

7170
```
@@ -91,9 +90,39 @@ You can also specify variables or options with command line flags, e.g. to auto-
9190
/help
9291
```
9392

93+
### Using ICortex CLI
94+
95+
ICortex comes with a full-fledged CLI similar to git or Docker CLI, which you can use to configure how you generate code in your project. To see all the commands you can invoke, run
96+
97+
```sh
98+
icortex help
99+
```
100+
101+
For example the command `icortex service` lets you configure the code generation service you would like to use. To see how to use each command, call them with `help`
102+
103+
```
104+
icortex service help
105+
```
106+
107+
### Accessing ICortex CLI inside Jupyter
108+
109+
You can still access the `icortex` CLI in a Jupyter Notebook or shell by using the prefix `//`. For example running the following in the terminal switches to a local HuggingFace model:
110+
111+
```
112+
icortex service set huggingface
113+
```
114+
115+
To do the same in a Jupyter Notebook, you can run
116+
117+
```
118+
//service set huggingface
119+
```
120+
121+
in a cell, which initializes and switches to the new service directly in your Jupyter session.
122+
94123
## Getting help
95124

96-
To get support, join our [Discord](https://discord.textcortex.com/).
125+
Feel free to ask questions in our [Discord](https://discord.textcortex.com/).
97126

98127
## Uninstalling
99128

0 commit comments

Comments
 (0)