Before installation, ensure that you have installed the following:
- Node.js: Required for running the installation.
- NPM: Needed to manage packages.
- CPU Instruction Sets: Available for download from the Cortex GitHub Releases page.
Ensure that your system meets the following requirements to run Cortex:
-
OS:
- MacOSX 13.6 or higher.
- Windows 10 or higher.
- Ubuntu 12.04 and later.
-
RAM (CPU Mode):
- 8GB for running up to 3B models.
- 16GB for running up to 7B models.
- 32GB for running up to 13B models.
-
VRAM (GPU Mode):
- 6GB can load the 3B model (int4) with
ngl
at 120 ~ full speed on CPU/ GPU. - 8GB can load the 7B model (int4) with
ngl
at 120 ~ full speed on CPU/ GPU. - 12GB can load the 13B model (int4) with
ngl
at 120 ~ full speed on CPU/ GPU.
- 6GB can load the 3B model (int4) with
-
Disk: At least 10GB for app and model download.
To install Cortex, follow the steps below:
Run the following command to install Cortex globally on your machine:
# Install using NPM globally
npm i -g @janhq/cortex
After installation, you can verify that Cortex is installed correctly by getting help information.
# Get the help information
cortex -h
Once verified, you need to initialize the Cortex engine.
- Initialize the Cortex engine:
cortex init
- Select between
CPU
andGPU
modes.
? Select run mode (Use arrow keys)
> CPU
GPU
- Select between GPU types.
? Select GPU types (Use arrow keys)
> Nvidia
Others (Vulkan)
- Select CPU instructions (will be deprecated soon).
? Select CPU instructions (Use arrow keys)
> AVX2
AVX
AVX-512
- Cortex will download the required CPU instruction sets if you choose
CPU
mode. If you chooseGPU
mode, Cortex will download the necessary dependencies to use your GPU. - Once downloaded, Cortex is ready to use!
From HuggingFace
cortex pull janhq/phi-3-medium-128k-instruct-GGUF
From Jan Hub (TBD)
cortex pull llama3
cortex run janhq/phi-3-medium-128k-instruct-GGUF
cortex serve
To install Cortex from the source, follow the steps below:
- Clone the Cortex repository here.
- Navigate to the
cortex-js
folder. - Open the terminal and run the following command to build the Cortex project:
npx nest build
- Make the
command.js
executable:
chmod +x '[path-to]/cortex/cortex-js/dist/src/command.js'
- Link the package globally:
npm link
Run the following command to uninstall Cortex globally on your machine:
# Uninstall globally using NPM
npm uninstall -g @janhq/cortex