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

Commit 14dddee

Browse files
committed
docs: update the README.md
1 parent c086432 commit 14dddee

File tree

1 file changed

+126
-19
lines changed

1 file changed

+126
-19
lines changed

README.md

Lines changed: 126 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,69 @@
1-
# Cortex Monorepo
1+
# Cortex - CLI
22

3-
# Installation
3+
<p align="center">
4+
<a href="https://jan.ai/cortex">Documentation</a> - <a href="https://jan.ai/api-reference">API Reference</a>
5+
- <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>
6+
</p>
47

5-
## Prerequisites
8+
> ⚠️ **Cortex is currently in Development**: Expect breaking changes and bugs!
69
7-
### **Dependencies**
10+
## About
11+
Cortex is an openAI-compatible local AI server that developers can use to build LLM apps. It is packaged with a Docker-inspired command-line interface and a Typescript client library. It can be used as a standalone server, or imported as a library.
12+
13+
Cortex currently supports two inference engines:
14+
15+
- Llama.cpp
16+
- TensorRT-LLM
17+
18+
> Read more about Cortex at https://jan.ai/cortex
19+
20+
### Repo Structure
21+
```
22+
# Entity Definitions
23+
domain/ # This is the core directory where the domains are defined.
24+
abstracts/ # Abstract base classes for common attributes and methods.
25+
models/ # Domain interface definitions, e.g. model, assistant.
26+
repositories/ # Extensions abstract and interface
27+
28+
# Business Rules
29+
usecases/ # Application logic
30+
assistants/ # CRUD logic (invokes dtos, entities).
31+
chat/ # Logic for chat functionalities.
32+
models/ # Logic for model operations.
33+
34+
# Adapters & Implementations
35+
infrastructure/ # Implementations for Cortex interactions
36+
commanders/ # CLI handlers
37+
models/
38+
questions/ # CLI installation UX
39+
shortcuts/ # CLI chained syntax
40+
types/
41+
usecases/ # Invokes UseCases
42+
43+
controllers/ # Nest controllers and HTTP routes
44+
assistants/ # Invokes UseCases
45+
chat/ # Invokes UseCases
46+
models/ # Invokes UseCases
47+
48+
database/ # Database providers (mysql, sqlite)
49+
50+
# Framework specific object definitions
51+
dtos/ # DTO definitions (data transfer & validation)
52+
entities/ # TypeORM entity definitions (db schema)
53+
54+
# Providers
55+
providers/cortex # Cortex [server] provider (a core extension)
56+
repositories/extensions # Extension provider (core & external extensions)
57+
58+
extensions/ # External extensions
59+
command.module.ts # CLI Commands List
60+
main.ts # Entrypoint
61+
```
62+
## Installation
63+
64+
### Prerequisites
65+
66+
#### **Dependencies**
867

968
Before installation, ensure that you have installed the following:
1069

@@ -17,7 +76,7 @@ Before installation, ensure that you have installed the following:
1776

1877
</aside>
1978

20-
### **Hardware**
79+
#### **Hardware**
2180

2281
Ensure that your system meets the following requirements to run Cortex:
2382

@@ -37,11 +96,11 @@ Ensure that your system meets the following requirements to run Cortex:
3796

3897
- **Disk**: At least 10GB for app and model download.
3998

40-
## Cortex Installation
99+
### Cortex Installation
41100

42101
To install Cortex, follow the steps below:
43102

44-
### Step 1: Install Cortex
103+
#### Step 1: Install Cortex
45104

46105
Run the following command to install Cortex globally on your machine:
47106

@@ -50,7 +109,7 @@ Run the following command to install Cortex globally on your machine:
50109
npm i -g @janhq/cortex
51110
```
52111

53-
### Step 2: Verify the Installation
112+
#### Step 2: Verify the Installation
54113

55114
After installation, you can verify that Cortex is installed correctly by getting help information.
56115

@@ -59,7 +118,7 @@ After installation, you can verify that Cortex is installed correctly by getting
59118
cortex -h
60119
```
61120

62-
### Step 3: Initialize Cortex
121+
#### Step 3: Initialize Cortex
63122

64123
Once verified, you need to initialize the Cortex engine.
65124

@@ -69,23 +128,23 @@ Once verified, you need to initialize the Cortex engine.
69128
cortex init
70129
```
71130

72-
1. Select between `CPU` and `GPU` modes.
131+
2. Select between `CPU` and `GPU` modes.
73132

74133
```bash
75134
? Select run mode (Use arrow keys)
76135
> CPU
77136
GPU
78137
```
79138

80-
2. Select between GPU types.
139+
3. Select between GPU types.
81140

82141
```bash
83142
? Select GPU types (Use arrow keys)
84143
> Nvidia
85144
Others (Vulkan)
86145
```
87146

88-
3. Select CPU instructions (will be deprecated soon).
147+
4. Select CPU instructions (will be deprecated soon).
89148

90149
```bash
91150
? Select CPU instructions (Use arrow keys)
@@ -94,10 +153,10 @@ cortex init
94153
AVX-512
95154
```
96155

97-
1. 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.
98-
2. Once downloaded, Cortex is ready to use!
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!
99158

100-
### Step 4: Pull a model
159+
#### Step 4: Pull a model
101160

102161
From HuggingFace
103162

@@ -111,14 +170,14 @@ From Jan Hub (TBD)
111170
cortex pull llama3
112171
```
113172

114-
### Step 5: Chat
173+
#### Step 5: Chat
115174

116175
```bash
117176
cortex run janhq/phi-3-medium-128k-instruct-GGUF
118177
```
119178

120179
## Run as an API server
121-
180+
To run Cortex as an API server:
122181
```bash
123182
cortex serve
124183
```
@@ -135,18 +194,62 @@ To install Cortex from the source, follow the steps below:
135194
npx nest build
136195
```
137196

138-
1. Make the `command.js` executable:
197+
4. Make the `command.js` executable:
139198

140199
```bash
141200
chmod +x '[path-to]/cortex/cortex-js/dist/src/command.js'
142201
```
143202

144-
1. Link the package globally:
203+
5. Link the package globally:
145204

146205
```bash
147206
npm link
148207
```
149208

209+
## Cortex CLI Command
210+
The following CLI commands are currently available:
211+
> ⚠️ **Cortex is currently in Development**: More commands will be added soon!
212+
213+
```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
220+
221+
models list List all available models.
222+
Example: cortex models list
223+
224+
models pull Download a specified model.
225+
Example: cortex models pull llama3:8b
226+
227+
models remove Delete a specified model.
228+
Example: cortex models remove llama3:8b
229+
230+
models get Retrieve the configuration of a specified model.
231+
Example: cortex models config llama3:8b
232+
233+
models start Start a specified model.
234+
Example: cortex models start llama3:8b
235+
236+
models stop Stop a specified model.
237+
Example: cortex models stop llama3:8b
238+
239+
models update Update the configuration of a specified model.
240+
Example: cortex models update llama3:8b --ngl 32
241+
242+
engines Execute a specified command related to engines.
243+
Example: cortex engines llamacpp
244+
245+
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+
252+
```
150253
## Uninstall Cortex
151254

152255
Run the following command to uninstall Cortex globally on your machine:
@@ -155,3 +258,7 @@ Run the following command to uninstall Cortex globally on your machine:
155258
# Uninstall globally using NPM
156259
npm uninstall -g @janhq/cortex
157260
```
261+
## Contact Support
262+
- For support, please file a GitHub ticket.
263+
- For questions, join our Discord [here](https://discord.gg/FTk2MvZwJH).
264+
- For long-form inquiries, please email [hello@jan.ai](mailto:hello@jan.ai).

0 commit comments

Comments
 (0)