TerslerThe little junk rig that could

Source files / scripts · raw

strata-server.sh

#!/usr/bin/env bash
# Start Strata's OpenAI-compatible server for Flash-Next on LLAMA_HOST:LLAMA_PORT (the tersler-strata service).
#   tersler-strata-server [extra serve.server args...]
# Set up first with scripts/strata-test.sh prep. /health shows "loaded": true once the experts are in.
set -euo pipefail
# shellcheck source=lib.sh
source "$(dirname "$(readlink -f "$0")")/lib.sh"
jr_load_config

cfg=$STRATA_WORK/flash-next-p100.json
py=$STRATA_SRC/.venv/bin/python
[[ -x $STRATA_SRC/strata/build-p100/strata && -f $cfg && -x $py ]] ||
    jr_die "Strata not set up in $STRATA_SRC / $STRATA_WORK (run: scripts/strata-test.sh prep)"

cd "$STRATA_SRC/strata"
# a cold start reads the experts from the SSD; the default 900 s READY limit can be too short
export STRATA_ENGINE_READY_S=3600
exec "$py" -m serve.server --engine strata --config "$cfg" \
    --host "$LLAMA_HOST" --port "$LLAMA_PORT" --no-api-key "$@"