OpenAI-compatible gateway and admin UI for running vLLM and llama.cpp inference engines on your own infrastructure. Built and maintained by Aulendur Labs.
- OpenAI-compatible endpoints:
/v1/chat/completions,/v1/completions,/v1/embeddings - Health-aware routing, circuit breaking, retries
- Usage metering, admin APIs/UI for users, orgs, keys, models
- Chat Playground: Interactive web UI for testing models with real-time metrics
- Prometheus metrics; optional Redis and OpenTelemetry
Cortex automatically:
- β Detects your host IP address (even without Makefile!)
- β Configures CORS for network access
- β Creates default admin user (admin/admin) on first startup
- β Enables monitoring on Linux systems (host + GPU metrics)
- β Sets up the database and services
- β Works from any device on your network
Just run make quick-start and you're done!
Cortex fully supports offline operation for air-gapped, classified, or restricted networks!
On internet-connected machine:
make prepare-offline # Download all Docker images (~15-20 GB)Transfer to offline machine, then:
make load-offline # Load images from package
make verify-offline # Verify readiness
make quick-start # Deploy completely offlineβ
No internet required after initial package preparation
β
Fully compliant with air-gap requirements (DoD, ITAR, etc.)
β
Fast deployment (no download wait times)
See: OFFLINE_DEPLOYMENT_QUICKSTART.md for step-by-step guide or docs/operations/offline-deployment.md for full documentation.
Cortex provides comprehensive GGUF support with smart detection and guidance:
- Smart Engine Guidance: Automatic recommendations based on file analysis
- GGUF Validation: Header validation, corruption detection
- Metadata Extraction: Architecture, context length, layers from GGUF headers
- Multi-part GGUF: Native llama.cpp support (no merge required)
- Quantization Indicators: Quality/speed ratings (Q4_K_M, Q8_0, etc.)
- Architecture Compatibility: vLLM vs llama.cpp support badges
- Speculative Decoding: Draft model support for llama.cpp
GGUF with llama.cpp (Recommended):
- β Full GGUF support including multi-part files
- β Native format, optimal performance
- β Works with any architecture (including GPT-OSS/Harmony)
GGUF with vLLM (Experimental):
β οΈ Single-file GGUF onlyβ οΈ Requires external tokenizerβ οΈ Performance lower than SafeTensors
See: docs/models/gguf-format.md for complete GGUF guide.
π Quick Start:
START_HERE.md- START HERE - 5-minute quick start guideREADME.md- This file (overview and quick reference)Makefile- Runmake helpto see all commands
π Full Documentation (guides, architecture, API reference, operations):
- Docs site: https://aulendurforge.github.io/Cortex/
- Local docs: Browse the
docs/directory for comprehensive guides- Getting Started: Setup, configuration, admin guides
- Architecture: System design, IP detection, configuration flow
- Models: HuggingFace download guide, vLLM, llama.cpp, engine comparison
- Operations: Makefile guide, deployment, scaling
- API: OpenAI-compatible and admin endpoints
- Security: Security posture and threat model
For administrators - simplified one-command setup:
# 1. Install prerequisites (if not already installed)
# Ubuntu/Debian:
sudo apt-get update && sudo apt-get install -y make docker.io docker-compose-plugin
# CentOS/RHEL:
sudo yum install -y make docker docker-compose-plugin
# Verify prerequisites:
make --version # Should show GNU Make
docker --version # Should show Docker
# 2. Start everything with one command
make quick-start
# That's it! Cortex will automatically detect your host IP and display the URLs.
# Access the Admin UI using the IP address shown (NOT localhost)
# Example output:
# β Cortex is ready!
# Login at: http://192.168.1.181:3001/login (admin/admin)
β οΈ IMPORTANT: Whiledocker composewill now work standalone (with automatic IP detection), usingmakecommands is strongly recommended for the best experience. The Makefile provides additional features like automatic monitoring enablement, better error messages, and helpful output.
π Important: Always use the host machine's IP address shown in the output, not
localhost. The IP is automatically detected when you runmakecommands. Users on your network will access Cortex using this IP address.
Check your host IP:
make ip # Prominently displays your host IP and URLs
make info # Shows full configuration including IPVerify everything is working:
make validate # Complete configuration validation (IP, CORS, services, network)
make ip # Show host IP and access URLs
make health # Check service healthCommon operations:
make help # See all available commands
make status # Check if services are running
make logs # View logs from all services
make stop # Stop services
make restart # Restart services
make clean # Remove everything and start freshMonitoring (automatic on Linux):
make up # Auto-enables linux,gpu profiles on Linux with NVIDIA
make monitoring-status # Check monitoring stack health
make info # See what's auto-detectedOn Linux systems with NVIDIA GPUs, Cortex automatically enables:
- node-exporter: Host CPU, memory, disk, and network metrics
- dcgm-exporter: GPU utilization, memory, and temperature
- cadvisor: Container resource usage
All metrics visible in the System Monitor page of the Admin UI.
π How IP Detection Works: Cortex automatically detects your host machine's LAN IP address (e.g.,
192.168.1.181or10.1.10.241) and configures CORS to accept requests from that IP. This allows users on your network to access the Admin UI. The detection excludes Docker bridge networks and loopback addresses.
π All Available Commands (click to expand)
make up- Start all services in background (β Cortex-only: starts containers defined indocker.compose.dev.yaml)make down- Stop and remove all containers (β Cortex-only: only affects Cortex containers managed by compose)make restart- Restart all services (β Cortex-only: restarts Cortex containers only)make stop- Stop containers (without removing) (β Cortex-only: stops Cortex containers only)make start- Start existing stopped containers (β Cortex-only: starts Cortex containers only)
make status- Show running containersmake health- Check health of all servicesmake logs- Follow logs from all servicesmake logs SERVICE=gateway- View specific service logsmake logs-gateway- Gateway logs shortcutmake logs-postgres- Database logs shortcut
make bootstrap- Create admin user (interactive)make bootstrap-default- Create default admin (admin/admin)make login- Login and save sessionmake create-key- Generate new API key
make db-backup- Backup database tobackups/folder (β Cortex-only: backs up Cortex PostgreSQL database)make db-restore BACKUP_FILE=backups/cortex_backup_*.sql- Restore from backup (β Cortex-only: restores Cortex database)make db-shell- Open PostgreSQL shell (β Cortex-only: connects to Cortex PostgreSQL container)make db-reset- Reset database (β οΈ Cortex-only: deletes Cortex database data; removes volumes prefixed withcortex_)
make clean- Stop services and remove volumes (β οΈ Cortex-only: removes Cortex containers and volumes prefixed withcortex_)make clean-all- Also remove model containers (β οΈ Cortex-only: removes containers matchingvllm-model-*andllamacpp-model-*patterns)make prune- Remove unused Docker resources (β οΈ Cortex-only: removes only Cortex-related containers, volumes, networks, and locally-built images; does NOT affect other Docker resources on your system)
make test- Run smoke testsmake test-api- Test API endpoints
ENV=dev(default) orENV=prod- Choose environmentPROFILES=linux,gpu- Enable monitoring profiles
Examples:
# Production deployment
make up ENV=prod
# Development with GPU monitoring
make up PROFILES=linux,gpu
# View gateway logs only
make logs SERVICE=gateway
# Backup before making changes
make db-backupCan't access the UI from another computer?
- Get your host IP:
make info - Use that IP (e.g.,
http://192.168.1.181:3001), NOTlocalhost - Ensure the other computer is on the same network
- Check firewall allows ports 3001 and 8084 (see below)
π₯ Firewall blocking network access? (Most common issue)
If you have UFW firewall enabled on Linux, you need to allow Cortex ports:
# Allow Cortex ports from your local network
sudo ufw allow 3001/tcp comment 'Cortex Admin UI'
sudo ufw allow 8084/tcp comment 'Cortex API Gateway'
sudo ufw reload
# Or allow your entire local network (recommended)
sudo ufw allow from 192.168.0.0/16 comment 'Local network access'
sudo ufw reload
# Verify rules
sudo ufw statusHow to tell if firewall is the issue:
# Check if UFW is blocking connections
sudo tail -20 /var/log/ufw.log | grep BLOCK
# If you see "DPT=3001" or "DPT=8084", firewall is blockingServices won't start?
make clean # Clean up everything
make install-deps # Verify Docker is installed
make up # Try starting again
make status # Check container statusCan't access the UI even from the host machine?
- Check services are running:
make status - Check health:
make health - View logs:
make logs-gateway - Verify your IP:
make info(use the shown IP, not localhost)
CORS errors in browser?
- The detected IP is automatically added to CORS whitelist
- Check
make infoto see your current IP - If your IP changed, restart:
make restart
Need to reset everything?
make clean-all # Remove everything (Cortex-only)
make quick-start # Start freshAll Makefile commands are scoped to Cortex resources only - they will NOT affect other Docker containers, images, volumes, or networks on your system.
β Safe - Cortex-only operations:
- Containers: Only containers with label
com.docker.compose.project=cortexor matching patternsvllm-model-*/llamacpp-model-* - Volumes: Only volumes prefixed with
cortex_(e.g.,cortex_postgres_data,cortex_redis_data) - Networks: Only networks prefixed with
cortex_(e.g.,cortex_default) - Images: Only images built locally by compose (
--rmi local) - pulled images are never removed
β Never affected:
- Other Docker containers running on your system
- Other Docker images (pulled or built for other projects)
- Other Docker volumes or networks
- System Docker resources
| Command | What It Affects | Safety Level |
|---|---|---|
make up / make down |
Cortex containers from compose file | β Safe - scoped to compose file |
make clean |
Cortex containers + volumes (cortex_*) |
β Safe - only Cortex volumes |
make clean-models |
Containers matching vllm-model-* / llamacpp-model-* |
β Safe - name pattern filter |
make prune |
Cortex containers, volumes, networks, locally-built images | β Safe - multiple filters ensure Cortex-only |
make db-reset |
Cortex database volumes (cortex_postgres_data) |
Example: If you have other Docker containers running (e.g., nginx, mysql, redis for other projects), running make clean or make prune will NOT affect them. Only Cortex-related resources are managed.
# From repo root
docker compose -f docker.compose.dev.yaml up --build
# Health
curl http://localhost:8084/health
# Bootstrap admin (one-time)
curl -X POST http://localhost:8084/admin/bootstrap-owner \
-H 'Content-Type: application/json' \
-d '{"username":"admin","password":"admin","org_name":"Default"}'
# Sign in at the UI (dev cookie session)
# http://localhost:3001/login (admin / admin)
# Create API key
curl -X POST http://localhost:8084/admin/keys -H 'Content-Type: application/json' -d '{"scopes":"chat,completions,embeddings"}'
# Call API (replace YOUR_TOKEN)
curl -H "Authorization: Bearer YOUR_TOKEN" -H "Content-Type: application/json" \
http://localhost:8084/v1/chat/completions \
-d '{"model":"meta-llama/Llama-3-8B-Instruct","messages":[{"role":"user","content":"Hello!"}]}'- Install NVIDIA driver and NVIDIA Container Toolkit on the host.
- Start exporters with compose profiles and Prometheus:
export COMPOSE_PROFILES=linux,gpu
docker compose -f docker.compose.dev.yaml up -d prometheus node-exporter dcgm-exporter- Verify
http://localhost:9090/targetsshows the exporters as UP. - Gateway system endpoints:
curl http://localhost:8084/admin/system/summary
curl http://localhost:8084/admin/system/gpusIf the UI reports a CORS error when calling the gateway, ensure the gateway is allowing your UI origin. In docker.compose.dev.yaml we set:
CORS_ALLOW_ORIGINS: http://10.1.10.241:3001,http://localhost:3001,http://127.0.0.1:3001
Recreate the gateway after edits:
docker compose -f docker.compose.dev.yaml up -d --build gatewayFor local dev and advanced deployment, see the Docs β Getting Started.
π Need to download HuggingFace models? See docs/models/huggingface-model-download.md for complete instructions.
Please see the docs (Contributing) for local setup, coding standards, and PR guidelines.
See CHANGELOG.md for a detailed list of changes and version history.
Copyright Β© 2026 Aulendur Labs. See LICENSE.txt and NOTICE.txt.

