Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit cda53d7

Browse files
committed
docs: Update the Cortex and Cortex-cpp readme files
1 parent b704626 commit cda53d7

File tree

2 files changed

+70
-137
lines changed

2 files changed

+70
-137
lines changed

README.md

Lines changed: 33 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,28 @@ extensions/ # External extensions
5959
command.module.ts # CLI Commands List
6060
main.ts # Entrypoint
6161
```
62-
## Installation
62+
## Quicklinks
63+
Cortex
64+
- [Website](https://jan.ai/)
65+
- [GitHub](https://github.com/janhq/cortex)
66+
- [User Guides](https://jan.ai/cortex)
67+
- [API reference](https://jan.ai/api-reference)
6368

64-
### Prerequisites
69+
## Prerequisites
6570

66-
#### **Dependencies**
71+
### **Dependencies**
6772

6873
Before installation, ensure that you have installed the following:
6974

7075
- **Node.js**: Required for running the installation.
7176
- **NPM**: Needed to manage packages.
7277
- **CPU Instruction Sets**: Available for download from the [Cortex GitHub Releases](https://github.com/janhq/cortex/releases) page.
7378

74-
<aside>
75-
💡 The **CPU instruction sets** are not required for the initial installation of Cortex. This dependency will be automatically installed during the Cortex initialization if they are not already on your system.
7679

77-
</aside>
80+
>💡 The **CPU instruction sets** are not required for the initial installation of Cortex. This dependency will be automatically installed during the Cortex initialization if they are not already on your system.
7881
79-
#### **Hardware**
82+
83+
### **Hardware**
8084

8185
Ensure that your system meets the following requirements to run Cortex:
8286

@@ -96,85 +100,31 @@ Ensure that your system meets the following requirements to run Cortex:
96100

97101
- **Disk**: At least 10GB for app and model download.
98102

99-
### Cortex Installation
100-
101-
To install Cortex, follow the steps below:
102-
103-
#### Step 1: Install Cortex
104-
105-
Run the following command to install Cortex globally on your machine:
106-
107-
```bash
108-
# Install using NPM globally
103+
## Quickstart
104+
1. Install the NPM package:
105+
``` bash
109106
npm i -g @janhq/cortex
110107
```
111108

112-
#### Step 2: Verify the Installation
113-
114-
After installation, you can verify that Cortex is installed correctly by getting help information.
115-
116-
```bash
117-
# Get the help information
118-
cortex -h
119-
```
120-
121-
#### Step 3: Initialize Cortex
122-
123-
Once verified, you need to initialize the Cortex engine.
124-
125-
1. Initialize the Cortex engine:
126-
127-
```
109+
2. Initialize a compatible engine:
110+
``` bash
128111
cortex init
129112
```
130113

131-
2. Select between `CPU` and `GPU` modes.
132-
133-
```bash
134-
? Select run mode (Use arrow keys)
135-
> CPU
136-
GPU
114+
3. Download a GGUF model from Hugging Face
115+
``` bash
116+
cortex models pull janhq/TinyLlama-1.1B-Chat-v1.0-GGUF
137117
```
138-
139-
3. Select between GPU types.
140-
141-
```bash
142-
? Select GPU types (Use arrow keys)
143-
> Nvidia
144-
Others (Vulkan)
118+
4. Load the model
119+
``` bash
120+
cortex models start janhq/TinyLlama-1.1B-Chat-v1.0-GGUF
145121
```
146122

147-
4. Select CPU instructions (will be deprecated soon).
148-
149-
```bash
150-
? Select CPU instructions (Use arrow keys)
151-
> AVX2
152-
AVX
153-
AVX-512
123+
5. Start chatting with the model
124+
``` bash
125+
cortex chat tell me a joke
154126
```
155127

156-
5. Cortex will download the required CPU instruction sets if you choose `CPU` mode. If you choose `GPU` mode, Cortex will download the necessary dependencies to use your GPU.
157-
6. Once downloaded, Cortex is ready to use!
158-
159-
#### Step 4: Pull a model
160-
161-
From HuggingFace
162-
163-
```bash
164-
cortex pull janhq/phi-3-medium-128k-instruct-GGUF
165-
```
166-
167-
From Jan Hub (TBD)
168-
169-
```bash
170-
cortex pull llama3
171-
```
172-
173-
#### Step 5: Chat
174-
175-
```bash
176-
cortex run janhq/phi-3-medium-128k-instruct-GGUF
177-
```
178128

179129
## Run as an API server
180130
To run Cortex as an API server:
@@ -211,44 +161,24 @@ The following CLI commands are currently available:
211161
> ⚠️ **Cortex is currently in Development**: More commands will be added soon!
212162
213163
```bash
214-
cortex --help
215-
Usage: cortex <command>
216-
217-
Commands:
218-
chat Send a query to the chat service.
219-
Example: cortex chat "tell me a joke" --stream
220164

165+
serve Providing API endpoint for Cortex backend
166+
chat Send a chat request to a model
167+
init|setup Init settings and download cortex's dependencies
168+
ps Show running models and their status
169+
kill Kill running cortex processes
170+
pull|download Download a model. Working with HuggingFace model id.
171+
run [options] EXPERIMENTAL: Shortcut to start a model and chat
172+
models Subcommands for managing models
221173
models list List all available models.
222-
Example: cortex models list
223-
224174
models pull Download a specified model.
225-
Example: cortex models pull llama3:8b
226-
227175
models remove Delete a specified model.
228-
Example: cortex models remove llama3:8b
229-
230176
models get Retrieve the configuration of a specified model.
231-
Example: cortex models config llama3:8b
232-
233177
models start Start a specified model.
234-
Example: cortex models start llama3:8b
235-
236178
models stop Stop a specified model.
237-
Example: cortex models stop llama3:8b
238-
239179
models update Update the configuration of a specified model.
240-
Example: cortex models update llama3:8b --ngl 32
241-
242180
engines Execute a specified command related to engines.
243-
Example: cortex engines llamacpp
244-
245181
engines list List all available engines.
246-
Example: cortex engines list
247-
248-
Options:
249-
-h, --help Show this help message and exit.
250-
251-
252182
```
253183
## Uninstall Cortex
254184

cortex-cpp/README.md

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,43 @@
11
# cortex-cpp - Embeddable AI
22
<p align="center">
3-
<img alt="nitrologo" src="https://raw.githubusercontent.com/janhq/nitro/main/assets/Nitro%20README%20banner.png">
3+
<img alt="cortex-cpplogo" src="https://raw.githubusercontent.com/janhq/cortex-cpp/main/assets/Cortex-cpp%20README%20banner.png">
44
</p>
55

66
<p align="center">
7-
<a href="https://nitro.jan.ai/docs">Documentation</a> - <a href="https://nitro.jan.ai/api-reference">API Reference</a>
8-
- <a href="https://github.com/janhq/cortex/releases/">Changelog</a> - <a href="https://github.com/janhq/cortex/issues">Bug reports</a> - <a href="https://discord.gg/AsJ8krTT3N">Discord</a>
7+
<a href="https://jan.ai/cortex">Documentation</a> - <a href="https://jan.ai/api-reference">API Reference</a>
8+
- <a href="https://github.com/janhq/cortex/releases">Changelog</a> - <a href="https://github.com/janhq/cortex/issues">Bug reports</a> - <a href="https://discord.gg/AsJ8krTT3N">Discord</a>
99
</p>
1010

1111
> ⚠️ **cortex-cpp is currently in Development**: Expect breaking changes and bugs!
1212
13-
## Features
14-
- Fast Inference: Built on top of the cutting-edge inference library llama.cpp, modified to be production ready.
15-
- Lightweight: Only 3MB, ideal for resource-sensitive environments.
16-
- Easily Embeddable: Simple integration into existing applications, offering flexibility.
17-
- Quick Setup: Approximately 10-second initialization for swift deployment.
18-
- Enhanced Web Framework: Incorporates drogon cpp to boost web service efficiency.
19-
2013
## About cortex-cpp
2114

22-
cortex-cpp is a high-efficiency C++ inference engine for edge computing, powering [Jan](https://jan.ai/). It is lightweight and embeddable, ideal for product integration.
15+
Cortex.cpp is a stateless, C++ server that is 100% compatible with OpenAI API (stateless endpoints). It includes a Drogon server, with request queues, model orchestration logic, and hardware telemetry, and more, for prod environments.
2316

2417
The binary of cortex-cpp after zipped is only ~3mb in size with none to minimal dependencies (if you use a GPU need CUDA for example) make it desirable for any edge/server deployment 👍.
2518

26-
> Read more about Nitro at https://nitro.jan.ai/
19+
> Read more about Cortex-cpp at https://jan.ai/cortex
20+
21+
### Features
22+
- Fast Inference: Built on top of the cutting-edge inference library llama.cpp, modified to be production ready.
23+
- Lightweight: Only 3MB, ideal for resource-sensitive environments.
24+
- Easily Embeddable: Simple integration into existing applications, offering flexibility.
25+
- Quick Setup: Approximately 10-second initialization for swift deployment.
26+
- Enhanced Web Framework: Incorporates drogon cpp to boost web service efficiency.
2727

2828
### Repo Structure
2929

3030
```
3131
.
32-
├── controllers
33-
├── docs
34-
├── llama.cpp -> Upstream llama C++
35-
├── cortex-cpp-deps -> Dependencies of the cortex-cpp project as a sub-project
36-
└── utils
32+
├── common # Common libraries or shared resources
33+
├── controllers # Controller scripts or modules for managing interactions
34+
├── cortex-common # Shared components across different cortex modules
35+
├── cortex-cpp-deps # Dependencies specific to the cortex-cpp module
36+
├── engines # Different processing or computational engines
37+
├── examples # Example scripts or applications demonstrating usage
38+
├── test # Test scripts and testing frameworks
39+
└── utils # Utility scripts and helper functions
40+
3741
```
3842

3943
## Quickstart
@@ -43,13 +47,13 @@ The binary of cortex-cpp after zipped is only ~3mb in size with none to minimal
4347
- For Linux and MacOS
4448

4549
```bash
46-
curl -sfL https://raw.githubusercontent.com/janhq/nitro/main/install.sh | sudo /bin/bash -
50+
curl -sfL https://raw.githubusercontent.com/janhq/cortex-cpp/main/install.sh | sudo /bin/bash -
4751
```
4852

4953
- For Windows
5054

5155
```bash
52-
powershell -Command "& { Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/janhq/nitro/main/install.bat' -OutFile 'install.bat'; .\install.bat; Remove-Item -Path 'install.bat' }"
56+
powershell -Command "& { Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/janhq/cortex-cpp/main/install.bat' -OutFile 'install.bat'; .\install.bat; Remove-Item -Path 'install.bat' }"
5357
```
5458

5559
**Step 2: Downloading a Model**
@@ -116,7 +120,7 @@ Table of parameters
116120
|`grammar_file`| String |You can constrain the sampling using GBNF grammars by providing path to a grammar file|
117121
|`model_type` | String | Model type we want to use: llm or embedding, default value is llm|
118122

119-
***OPTIONAL***: You can run Nitro on a different port like 5000 instead of 3928 by running it manually in terminal
123+
***OPTIONAL***: You can run Cortex-cpp on a different port like 5000 instead of 3928 by running it manually in terminal
120124
```zsh
121125
./cortex-cpp 1 127.0.0.1 5000 ([thread_num] [host] [port] [uploads_folder_path])
122126
```
@@ -142,37 +146,37 @@ To compile cortex-cpp please visit [Compile from source](docs/docs/new/build-sou
142146
<tr>
143147
<td style="text-align:center"><b>Stable (Recommended)</b></td>
144148
<td style="text-align:center">
145-
<a href='https://github.com/janhq/nitro/releases/download/v0.3.22/nitro-0.3.22-win-amd64.tar.gz'>
149+
<a href='https://github.com/janhq/cortex-cpp/releases/download/v0.3.22/cortex-cpp-0.3.22-win-amd64.tar.gz'>
146150
<img src='./docs/static/img/windows.png' style="height:15px; width: 15px" />
147151
<b>CPU</b>
148152
</a>
149153
</td>
150154
<td style="text-align:center">
151-
<a href='https://github.com/janhq/nitro/releases/download/v0.3.22/nitro-0.3.22-win-amd64-cuda.tar.gz'>
155+
<a href='https://github.com/janhq/cortex-cpp/releases/download/v0.3.22/cortex-cpp-0.3.22-win-amd64-cuda.tar.gz'>
152156
<img src='./docs/static/img/windows.png' style="height:15px; width: 15px" />
153157
<b>CUDA</b>
154158
</a>
155159
</td>
156160
<td style="text-align:center">
157-
<a href='https://github.com/janhq/nitro/releases/download/v0.3.22/nitro-0.3.22-mac-amd64.tar.gz'>
161+
<a href='https://github.com/janhq/cortex-cpp/releases/download/v0.3.22/cortex-cpp-0.3.22-mac-amd64.tar.gz'>
158162
<img src='./docs/static/img/mac.png' style="height:15px; width: 15px" />
159163
<b>Intel</b>
160164
</a>
161165
</td>
162166
<td style="text-align:center">
163-
<a href='https://github.com/janhq/nitro/releases/download/v0.3.22/nitro-0.3.22-mac-arm64.tar.gz'>
167+
<a href='https://github.com/janhq/cortex-cpp/releases/download/v0.3.22/cortex-cpp-0.3.22-mac-arm64.tar.gz'>
164168
<img src='./docs/static/img/mac.png' style="height:15px; width: 15px" />
165169
<b>M1/M2</b>
166170
</a>
167171
</td>
168172
<td style="text-align:center">
169-
<a href='https://github.com/janhq/nitro/releases/download/v0.3.22/nitro-0.3.22-linux-amd64.tar.gz'>
173+
<a href='https://github.com/janhq/cortex-cpp/releases/download/v0.3.22/cortex-cpp-0.3.22-linux-amd64.tar.gz'>
170174
<img src='./docs/static/img/linux.png' style="height:15px; width: 15px" />
171175
<b>CPU</b>
172176
</a>
173177
</td>
174178
<td style="text-align:center">
175-
<a href='https://github.com/janhq/nitro/releases/download/v0.3.22/nitro-0.3.22-linux-amd64-cuda.tar.gz'>
179+
<a href='https://github.com/janhq/cortex-cpp/releases/download/v0.3.22/cortex-cpp-0.3.22-linux-amd64-cuda.tar.gz'>
176180
<img src='./docs/static/img/linux.png' style="height:15px; width: 15px" />
177181
<b>CUDA</b>
178182
</a>
@@ -181,28 +185,27 @@ To compile cortex-cpp please visit [Compile from source](docs/docs/new/build-sou
181185
<tr style="text-align: center">
182186
<td style="text-align:center"><b>Experimental (Nighlty Build)</b></td>
183187
<td style="text-align:center" colspan="6">
184-
<a href='https://github.com/janhq/nitro/actions/runs/8146271749'>
188+
<a href='https://github.com/janhq/cortex-cpp/actions/runs/8146271749'>
185189
<b>GitHub action artifactory</b>
186190
</a>
187191
</td>
188192
</tr>
189193
</table>
190194

191-
Download the latest version of Nitro at https://nitro.jan.ai/ or visit the **[GitHub Releases](https://github.com/janhq/cortex/releases)** to download any previous release.
195+
Download the latest version of Cortex-cpp at https://jan.ai/ or visit the **[GitHub Releases](https://github.com/janhq/cortex/releases)** to download any previous release.
192196

193197
## Nightly Build
194198

195-
Nightly build is a process where the software is built automatically every night. This helps in detecting and fixing bugs early in the development cycle. The process for this project is defined in [`.github/workflows/build.yml`](.github/workflows/build.yml)
199+
Nightly build is a process where the software is built automatically every night. This helps detect and fix bugs early in the development cycle. The process for this project is defined in [`.github/workflows/build.yml`](.github/workflows/build.yml)
196200

197-
You can join our Discord server [here](https://discord.gg/FTk2MvZwJH) and go to channel [github-nitro](https://discordapp.com/channels/1107178041848909847/1151022176019939328) to monitor the build process.
201+
You can join our Discord server [here](https://discord.gg/FTk2MvZwJH) and go to channel [cortex](https://discordapp.com/channels/1107178041848909847/1151022176019939328) to monitor the build process.
198202

199203
The nightly build is triggered at 2:00 AM UTC every day.
200204

201-
The nightly build can be downloaded from the url notified in the Discord channel. Please access the url from the browser and download the build artifacts from there.
205+
The nightly build can be downloaded from the URL notified in the Discord channel. Please access the URL from the browser and download the build artifacts from there.
202206

203207
## Manual Build
204-
205-
Manual build is a process where the software is built manually by the developers. This is usually done when a new feature is implemented or a bug is fixed. The process for this project is defined in [`.github/workflows/build.yml`](.github/workflows/build.yml)
208+
Manual build is a process in which the developers build the software manually. This is usually done when a new feature is implemented or a bug is fixed. The process for this project is defined in [`.github/workflows/build.yml`](.github/workflows/build.yml)
206209

207210
It is similar to the nightly build process, except that it is triggered manually by the developers.
208211

@@ -214,4 +217,4 @@ It is similar to the nightly build process, except that it is triggered manually
214217

215218
## Star History
216219

217-
[![Star History Chart](https://api.star-history.com/svg?repos=janhq/nitro&type=Date)](https://star-history.com/#janhq/nitro&Date)
220+
[![Star History Chart](https://api.star-history.com/svg?repos=janhq/cortex-cpp&type=Date)](https://star-history.com/#janhq/cortex-cpp&Date)

0 commit comments

Comments
 (0)