|
1 | | -<p align="center"> |
2 | | - <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a> |
3 | | -</p> |
4 | | - |
5 | | -[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 |
6 | | -[circleci-url]: https://circleci.com/gh/nestjs/nest |
7 | | - |
8 | | - <p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p> |
9 | | - <p align="center"> |
10 | | -<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a> |
11 | | -<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a> |
12 | | -<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a> |
13 | | -<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a> |
14 | | -<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a> |
15 | | -<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a> |
16 | | -<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a> |
17 | | -<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a> |
18 | | - <a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a> |
19 | | - <a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a> |
20 | | - <a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a> |
21 | | -</p> |
22 | | - <!--[](https://opencollective.com/nest#backer) |
23 | | - [](https://opencollective.com/nest#sponsor)--> |
24 | | - |
25 | | -## Description |
26 | | - |
27 | | -[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. |
28 | | - |
29 | | -## Installation |
| 1 | +# Install |
| 2 | +## Prerequisites |
| 3 | + |
| 4 | +### **Dependencies** |
| 5 | + |
| 6 | +Before installation, ensure that you have installed the following: |
| 7 | + |
| 8 | +- **Node.js**: Required for running the installation. |
| 9 | +- **NPM**: Needed to manage packages. |
| 10 | +- **CPU Instruction Sets**: Available for download from the [Cortex GitHub Releases](https://github.com/janhq/cortex/releases) page. |
| 11 | + |
| 12 | +<aside> |
| 13 | +💡 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. |
| 14 | + |
| 15 | +</aside> |
| 16 | + |
| 17 | +### **Hardware** |
| 18 | + |
| 19 | +Ensure that your system meets the following requirements to run Cortex: |
| 20 | + |
| 21 | +- **OS**: |
| 22 | + - MacOSX 13.6 or higher. |
| 23 | + - Windows 10 or higher. |
| 24 | + - Ubuntu 12.04 and later. |
| 25 | +- **RAM (CPU Mode):** |
| 26 | + - 8GB for running up to 3B models. |
| 27 | + - 16GB for running up to 7B models. |
| 28 | + - 32GB for running up to 13B models. |
| 29 | +- **VRAM (GPU Mode):** |
| 30 | + - 6GB can load the 3B model (int4) with `ngl` at 120 ~ full speed on CPU/ GPU. |
| 31 | + - 8GB can load the 7B model (int4) with `ngl` at 120 ~ full speed on CPU/ GPU. |
| 32 | + - 12GB can load the 13B model (int4) with `ngl` at 120 ~ full speed on CPU/ GPU. |
| 33 | + |
| 34 | +- **Disk**: At least 10GB for app and model download. |
| 35 | + |
| 36 | +## Cortex Installation |
| 37 | + |
| 38 | +To install Cortex, follow the steps below: |
| 39 | + |
| 40 | +### Step 1: Install Cortex |
| 41 | + |
| 42 | +Run the following command to install Cortex globally on your machine: |
30 | 43 |
|
31 | 44 | ```bash |
32 | | -$ yarn install |
| 45 | +# Install using NPM globally |
| 46 | +npm i -g @janhq/cortex |
33 | 47 | ``` |
34 | 48 |
|
35 | | -## Running the app |
| 49 | +### Step 2: Verify the Installation |
| 50 | + |
| 51 | +After installation, you can verify that Cortex is installed correctly by getting help information. |
36 | 52 |
|
37 | 53 | ```bash |
38 | | -# development |
39 | | -$ yarn run start |
| 54 | +# Get the help information |
| 55 | +cortex -h |
| 56 | +``` |
| 57 | + |
| 58 | +### Step 3: Initialize Cortex |
40 | 59 |
|
41 | | -# watch mode |
42 | | -$ yarn run start:dev |
| 60 | +Once verified, you need to initialize the Cortex engine. |
43 | 61 |
|
44 | | -# production mode |
45 | | -$ yarn run start:prod |
| 62 | +1. Initialize the Cortex engine: |
| 63 | + |
| 64 | +``` |
| 65 | +cortex init |
46 | 66 | ``` |
47 | 67 |
|
48 | | -## Test |
| 68 | +1. Select between `CPU` and `GPU` modes. |
49 | 69 |
|
50 | 70 | ```bash |
51 | | -# unit tests |
52 | | -$ yarn run test |
| 71 | +? Select run mode (Use arrow keys) |
| 72 | +> CPU |
| 73 | + GPU |
| 74 | +``` |
53 | 75 |
|
54 | | -# e2e tests |
55 | | -$ yarn run test:e2e |
| 76 | +2. Select between GPU types. |
56 | 77 |
|
57 | | -# test coverage |
58 | | -$ yarn run test:cov |
| 78 | +```bash |
| 79 | +? Select GPU types (Use arrow keys) |
| 80 | +> Nvidia |
| 81 | + Others (Vulkan) |
59 | 82 | ``` |
| 83 | +3. Select CPU instructions (will be deprecated soon). |
60 | 84 |
|
61 | | -## Support |
| 85 | +```bash |
| 86 | +? Select CPU instructions (Use arrow keys) |
| 87 | +> AVX2 |
| 88 | + AVX |
| 89 | + AVX-512 |
| 90 | +``` |
62 | 91 |
|
63 | | -Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). |
| 92 | +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. |
| 93 | +2. Once downloaded, Cortex is ready to use! |
64 | 94 |
|
65 | | -## Stay in touch |
| 95 | +### Step 4: Pull a model |
| 96 | +From HuggingFace |
| 97 | +```bash |
| 98 | +cortex pull janhq/phi-3-medium-128k-instruct-GGUF |
| 99 | +``` |
66 | 100 |
|
67 | | -- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com) |
68 | | -- Website - [https://nestjs.com](https://nestjs.com/) |
69 | | -- Twitter - [@nestframework](https://twitter.com/nestframework) |
| 101 | +From Jan Hub (TBD) |
| 102 | +```bash |
| 103 | +cortex pull llama3 |
| 104 | +``` |
| 105 | + |
| 106 | +### Step 5: Chat |
| 107 | +```bash |
| 108 | +cortex run janhq/phi-3-medium-128k-instruct-GGUF |
| 109 | +``` |
| 110 | + |
| 111 | +## Run as an API server |
| 112 | +```bash |
| 113 | +cortex serve |
| 114 | +``` |
| 115 | + |
| 116 | +## Build from Source |
| 117 | + |
| 118 | +To install Cortex from the source, follow the steps below: |
| 119 | + |
| 120 | +1. Clone the Cortex repository [here](https://github.com/janhq/cortex/tree/dev). |
| 121 | +2. Navigate to the `cortex-js` folder. |
| 122 | +3. Open the terminal and run the following command to build the Cortex project: |
| 123 | + |
| 124 | +```bash |
| 125 | +npx nest build |
| 126 | +``` |
| 127 | + |
| 128 | +1. Make the `command.js` executable: |
| 129 | + |
| 130 | +```bash |
| 131 | +chmod +x '[path-to]/cortex/cortex-js/dist/src/command.js' |
| 132 | +``` |
| 133 | + |
| 134 | +1. Link the package globally: |
70 | 135 |
|
71 | | -## License |
| 136 | +```bash |
| 137 | +npm link |
| 138 | +``` |
| 139 | + |
| 140 | +## Uninstall Cortex |
72 | 141 |
|
73 | | -Nest is [MIT licensed](LICENSE). |
| 142 | +Run the following command to uninstall Cortex globally on your machine: |
| 143 | + |
| 144 | +``` |
| 145 | +# Uninstall globally using NPM |
| 146 | +npm uninstall -g @janhq/cortex |
| 147 | +``` |
0 commit comments