Upgrade Notes¶
Database migrations (Alembic)¶
The schema is managed by Alembic (backend/alembic/versions/: 0001_baseline,
0002_engine_spec, ...). The gateway runs alembic upgrade head itself at startup; a
database created before Alembic (tables present, no alembic_version) is stamped at the
baseline first and then upgraded. Nothing to run by hand.
- Re-run on demand:
make migrate. - Migration failure is logged (
database migration failed) and the API keeps starting so you can inspect it; fix and restart. - Developers:
cd backend && alembic revision --autogenerate -m "msg"(usesbackend/alembic.ini,script_location = %(here)s/alembic; setDATABASE_URL).
Upgrading Cortex¶
make db-backup
git pull
# review versions.env (engine/infra pins) and CHANGELOG.md
make build # or: make build ENV=prod
make up # or: make prod-check && make up ENV=prod
make health
Model containers are not touched by a gateway upgrade: the supervisor re-adopts running containers by label. Restart a model (Apply) only when its engine image or configuration changed.
0.1 → 0.2¶
- Settings removed:
LLAMACPP_DEFAULT_*,LLAMACPP_MAX_PARALLEL,LLAMACPP_CONT_BATCHING,LLAMACPP_CACHE_TYPE_K/V,LLAMACPP_LOG_VERBOSE,LLAMACPP_LOG_COLORS,LLAMACPP_CHECK_TENSORS,LLAMACPP_SKIP_WARMUP,LLAMACPP_JINJA_ENABLED,LLAMACPP_DEFRAG_THOLD,VLLM_USE_V1. Configure per model. - Defaults changed:
GATEWAY_DEV_ALLOW_ALL_KEYSisfalse(dev compose setstrue); engine images pinned (vllm/vllm-openai:v0.28.0,llama.cpp:server-cuda-b10731); model ports published on127.0.0.1only;--api-keyon both engines; model containers survive gateway restarts (STOP_MODELS_ON_SHUTDOWN=false). - New settings:
SESSION_SECRET,SESSION_TTL_HOURS,SESSION_COOKIE_SECURE,STOP_MODELS_ON_SHUTDOWN,MODEL_RECONCILE_SEC. - Routes:
POST /admin/bootstrap-owner→POST /auth/bootstrap-owner; every/adminroute requires an admin session;POST /admin/models/dry-runaccepts a body. - Sessions: cookies are now signed; all users must log in again after the upgrade.
- Files:
backend/.env.dev/.env.prodare no longer tracked (compose files carry the settings; root.envoverrides);scripts/versions.envmoved toversions.env;NEMOTRON_3_SUPER_DEPLOYMENT.mdmoved todocs/models/nemotron-3-super.md. - Gateway runs as non-root (uid 1000):
chown -R 1000 /var/cortex/exports(and/var/cortex/modelsif you rely on multipart-GGUF handling). - Frontend image has a
prodtarget (next build);node:22-alpinebase. - Offline package now includes the built
cortex-gateway/cortex-frontendimages and a copy ofversions.env; regenerate it withmake prepare-offline. - llama.cpp flags renamed (
--flash-attn on|off|auto,--load-mode,--spec-draft-n-max;--defrag-thold,--system-prompt-file,--mlockgone) and vLLM flags (--cudagraph-capture-sizes,--enable-log-requests;--swap-spacegone). Stored model configurations are migrated by0002_engine_spec; review models that used custom args.
Compatibility¶
- The frontend derives the gateway URL from the browser origin;
NEXT_PUBLIC_GATEWAY_URLis only for runningnext devoutside compose. - API changes are listed in
CHANGELOG.md.