#!/usr/bin/env bash set -e # 1) Frontend up first so the page + description render immediately. uvicorn app:app --host 0.0.0.0 --port "${PORT}" & # 2) POCKET backend (:8080) — powers Tab 1 chat AND the POCKET side of the A/B. echo "[start] downloading POCKET ${MODEL_FILE} …" PK=$(python -c "import os;from huggingface_hub import hf_hub_download;print(hf_hub_download(os.environ['MODEL_REPO'],os.environ['MODEL_FILE']))") echo "[start] POCKET at ${PK}" llama-server -m "${PK}" --host 127.0.0.1 --port 8080 -c "${N_CTX}" -t "$(nproc)" --jinja --no-webui & # 3) Bonsai backend (:8081) — the Bonsai side of the A/B race. Same stock binary. echo "[start] downloading Bonsai ${BONSAI_FILE} …" BN=$(python -c "import os;from huggingface_hub import hf_hub_download;print(hf_hub_download(os.environ['BONSAI_REPO'],os.environ['BONSAI_FILE']))") echo "[start] Bonsai at ${BN}" # exec = keep container alive on this process; sequential A/B means no CPU contention. exec llama-server -m "${BN}" --host 127.0.0.1 --port 8081 -c "${N_CTX}" -t "$(nproc)" --jinja --no-webui