Installation Guide đ
Quick Install
Download and install Cortex for your platform:
Platform | Download Link | Installation Steps |
---|---|---|
macOS | Download | 1. Open the .pkg file 2. Follow the installer wizard |
Linux | Download | Run: curl -s https://raw.githubusercontent.com/menloresearch/cortex/main/engine/templates/linux/install.sh | sudo bash -s |
Windows | Download | 1. Run the installer 2. Follow the setup wizard |
Verify Your Installation
After installing, verify Cortex is working:
cortex -v
cortex.exe -v
System Requirements
Before installing, ensure your system meets these minimum requirements:
Essential Requirements
- CPU: Intel Haswell (2013+) or AMD Excavator (2015+) with AVX2 support
- RAM: 8GB minimum (16GB recommended)
- Storage: 10GB free space
- OS: macOS 12+, Windows 10+, or Ubuntu 20.04+/Debian 11+
GPU Support (Optional)
For accelerated performance:
- VRAM: 6GB minimum (8GB+ recommended)
- NVIDIA: Driver 470.63.01+ and CUDA 12.0+
- AMD: Driver 22.7.1+
Platform-Specific Instructions
macOS Installation
- Download the installer package from the links above
- Open the downloaded .pkg file by double-clicking it
- Follow the installation wizard to complete setup
- Verify installation by opening Terminal and running:
Terminal window cortex -v
Installation Locations
- Binary:
/usr/local/bin/cortex
,/usr/local/bin/cortex-server
- Data:
/Users/<username>/cortexcpp
- Config:
/Users/<username>/.cortexrc
- Uninstaller:
/usr/local/bin/cortex-uninstall.sh
Uninstall
Run the uninstaller script:
sudo sh /usr/local/bin/cortex-uninstall.sh
Linux Installation
Quick Install (Network Installer)
curl -s https://raw.githubusercontent.com/menloresearch/cortex/main/engine/templates/linux/install.sh | sudo bash -s
Local Installer (Debian-based distros)
curl -s https://raw.githubusercontent.com/menloresearch/cortex/main/engine/templates/linux/install.sh | sudo bash -s -- --deb_local
Additional Options
--channel <channel_name>
: Install fromstable
,beta
ornightly
channel--version <version>
: Install specific version (e.g.,1.0.2
)--is_update
: Flag for updating existing installation
Verify Installation
cortex -v
Installation Locations
- Binary:
/usr/bin/cortex
,/usr/bin/cortex-server
- Data:
/home/<username>/cortexcpp
- Config:
/home/<username>/.cortexrc
Uninstall
sudo /usr/bin/cortex-uninstall.sh
Windows Installation
- Download the installer from the links above
- Run the installer by double-clicking the downloaded file
- Follow the installation wizard to complete setup
- Verify installation by opening a command prompt and running:
Terminal window cortex -v
Installation Locations
- Binary:
C:\Users\<username>\AppData\Local\cortexcpp\
- Data:
C:\Users\<username>\cortexcpp
- Config:
C:\Users\<username>\.cortexrc
Uninstall
- Open Control Panel
- Navigate to âAdd or Remove Programsâ/âPrograms and Featuresâ
- Find âcortexcppâ and select âUninstallâ
Windows Subsystem for Linux (WSL)
If you prefer running Cortex in WSL, follow the Linux installation instructions after setting up WSL.
Docker Installation
Prerequisites
- Docker v20.10.0+ or Docker Desktop
- For GPU support:
nvidia-container-toolkit
(see setup instructions below)
GPU Support Setup (Ubuntu example)
# Install NVIDIA Container Toolkitcurl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
# Add repositorycurl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
# Installsudo apt-get update && sudo apt-get install -y nvidia-container-toolkitsudo nvidia-ctk runtime configure --runtime=dockersudo systemctl restart docker
Option 1: Using Pre-built Image
# Pull the latest stable releasedocker pull menloltd/cortex:latest
# Or a specific version (recommended for production)docker pull menloltd/cortex:nightly-1.0.1-224
Option 2: Building from Source
git clone https://github.com/menloresearch/cortex.cpp.gitcd cortex.cppgit submodule update --init
# Build with latestdocker build -t menloltd/cortex:local \ --build-arg CORTEX_CPP_VERSION=$(git rev-parse HEAD) \ -f docker/Dockerfile .
# Or with specific versiondocker build \ --build-arg CORTEX_LLAMACPP_VERSION=0.1.34 \ --build-arg CORTEX_CPP_VERSION=$(git rev-parse HEAD) \ -t menloltd/cortex:local \ -f docker/Dockerfile .
Running Cortex in Docker
- Create data volume
docker volume create cortex_data
- Launch container
For GPU mode:
docker run --gpus all -d \ --name cortex \ --memory=4g \ --memory-swap=4g \ --security-opt=no-new-privileges \ -v cortex_data:/root/cortexcpp:rw \ -v /opt/cortex/data:/data:rw \ -p 127.0.0.1:39281:39281 \ menloltd/cortex:latest
For CPU mode:
docker run -d \ --name cortex \ --memory=4g \ --memory-swap=4g \ --security-opt=no-new-privileges \ -v cortex_data:/root/cortexcpp:rw \ -v /opt/cortex/data:/data:rw \ -p 127.0.0.1:39281:39281 \ menloltd/cortex:latest
- Verify container
docker ps | grep cortexdocker logs cortexcurl http://127.0.0.1:39281/healthz
Download Links
Platform | Stable Release | Beta Release | Nightly Build |
---|---|---|---|
macOS | Download | Download | Download |
Linux | Download | Download | Download |
Windows | Download | Download | Download |
Minimum Requirements
Before installing Cortex, ensure your system meets these requirements:
Operating Systems
- macOS: macOS 12 (Monterey) or later
- Linux: Ubuntu 20.04+, Debian 11+, or latest Arch Linux
- Other distributions may work with Docker or binary files
- Windows: Windows 10 or later
Hardware Requirements
CPU
- Intel: Haswell (Q2 2013) or newer; Tiger Lake (Q3 2020)+ for Celeron/Pentium
- AMD: Excavator (Q2 2015) or newer
RAM
- 8GB: Up to 3B parameter models (int4 quantization)
- 16GB: Up to 7B parameter models (int4 quantization)
- 32GB: Up to 13B parameter models (int4 quantization)
GPU (Optional)
- 6GB VRAM: 3B parameter models (int4) with full-speed inference
- 8GB VRAM: 7B parameter models (int4) with full-speed inference
- 12GB VRAM: 13B parameter models (int4) with full-speed inference
NVIDIA Requirements:
- NVIDIA driver 470.63.01+
- CUDA Toolkit 12.0+ (Cortex will automatically install required CUDA runtime)
Storage
- At least 10GB free space for models
Installation Options
Cortex offers four installation methods:
- Network Installers: Minimal downloaders that fetch packages during installation (requires internet)
- Local Installers: Complete packages for offline installation
- Docker Images: Pre-built containers or build-it-yourself options
- Binary Files: Direct executable files without package management
Updating Cortex
sudo cortex update
sudo cortex update
cortex.exe update
# Pull latest imagedocker pull menloltd/cortex:latest
# Stop and remove existing containerdocker stop cortexdocker rm cortex
# Start a new container (use the same run command as for installation)
Building from Source
macOS Build
Prerequisites
- CMake 3.10+
- gcc/g++ 9+
- ninja-build
- make-gnu
Build Steps
git clone https://github.com/menloresearch/cortex.cpp.gitcd cortex.cppgit submodule update --init
cd enginemake configure-vcpkg
# For Mac Silicon (M1/M2)make build CMAKE_EXTRA_FLAGS="-DCORTEX_CPP_VERSION=latest -DCMAKE_BUILD_TEST=OFF -DMAC_ARM64=ON -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
# For Mac Intelmake build CMAKE_EXTRA_FLAGS="-DCORTEX_CPP_VERSION=latest -DCMAKE_BUILD_TEST=OFF -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
# Test the build./build/cortex -h
Linux Build
Prerequisites
- OpenMPI
- CMake 3.10+
- gcc/g++ 9+
- ninja-build
- make-gnu
Build Steps
git clone https://github.com/menloresearch/cortex.cpp.gitcd cortex.cppgit submodule update --init
cd enginemake configure-vcpkgmake build CMAKE_EXTRA_FLAGS="-DCORTEX_CPP_VERSION=$(git rev-parse HEAD) -DCMAKE_BUILD_TEST=OFF -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
# Test the build./build/cortex -h
Windows Build
Prerequisites
- CMake 3.10+
- Visual Studio 2019/2022 with MSVC
- ninja-build
- make-gnu
Build Steps
git clone https://github.com/menloresearch/cortex.cpp.gitcd cortex.cppgit submodule update --init
cd enginemake configure-vcpkgmake build CMAKE_EXTRA_FLAGS="-DCORTEX_CPP_VERSION=latest -DCMAKE_BUILD_TEST=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=vcpkg\\scripts\\buildsystems\\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=RELEASE -GNinja"
# Test the build.\build\cortex.exe -h
Working with Cortex
After installing Cortex, you can start using it immediately. Hereâs how to perform common tasks:
Using Cortex in Docker
1. Check Available Engines
curl --request GET --url http://localhost:39281/v1/engines \ --header "Content-Type: application/json"
2. Download Models
First, monitor events:
websocat ws://localhost:39281/events
Then download a model:
curl --request POST --url http://localhost:39281/v1/models/pull \ --header 'Content-Type: application/json' \ --data '{"model": "tinyllama:gguf"}'
3. Start and Use a Model
# Start modelcurl --request POST --url http://localhost:39281/v1/models/start \ --header 'Content-Type: application/json' \ --data '{"model": "tinyllama:gguf"}'
# Query the modelcurl --request POST --url http://localhost:39281/v1/chat/completions \ --header 'Content-Type: application/json' \ --data '{ "frequency_penalty": 0.2, "max_tokens": 4096, "messages": [{"content": "Tell me a joke", "role": "user"}], "model": "tinyllama:gguf", "presence_penalty": 0.6, "stop": ["End"], "stream": true, "temperature": 0.8, "top_p": 0.95 }'
Troubleshooting
Common Issues
Permission Errors on Linux/macOS
# Fix permissions for data directorysudo chown -R $(whoami):$(whoami) ~/cortexcpp
Docker Container Wonât Start
docker logs cortexdocker system info # Check available resources
GPU Not Detected
- Ensure NVIDIA drivers are properly installed
- Verify CUDA Toolkit installation
- For Docker: check that nvidia-container-toolkit is configured correctly
Release Channels
Cortex offers three release channels:
- Stable: Latest released version, recommended for most users
- Beta: Release candidates for upcoming stable versions (tagged as
vx.y.z-rc1
on GitHub) - Nightly: Latest development builds from the dev branch (available on Discord)
Different channels use different naming conventions and file locations:
Channel | App Name | Binary Name (Linux/Mac) | Binary Name (Windows) |
---|---|---|---|
Stable | cortexcpp | cortex , cortex-server | cortex.exe , cortex-server.exe |
Beta | cortexcpp-beta | cortex-beta , cortex-server-beta | cortex-beta.exe , cortex-server-beta.exe |
Nightly | cortexcpp-nightly | cortex-nightly , cortex-server-nightly | cortex-nightly.exe , cortex-server-nightly.exe |