Edge0-145B-NVFP4 / start.sh
bupalinyu's picture 0xericy's picture
start.sh: find the engine under edge0-strata/ in a clone of Edge0-AI/Edge0 (#16)
8109172
Raw History Blame Contribute Delete
1.32 kB
#!/bin/bash
# edge0 model folder - relative-path launcher (no absolute paths)
# EDGE0 path to a clone of github.com/Edge0-AI/Edge0 (the engine is its edge0-strata/)
# PORT HTTP port (default 8094)
# STRATA_BIN optional explicit engine binary
set -e
P="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$P"
: "${EDGE0:?set EDGE0 to your clone of github.com/Edge0-AI/Edge0}"
# the engine directory: edge0-strata/ in a clone; strata/ or EDGE0 itself in older layouts
S=""
for d in "$EDGE0/edge0-strata" "$EDGE0/strata" "$EDGE0"; do
[ -f "$d/serve/server.py" ] && { S="$d"; break; }
done
[ -n "$S" ] || { echo "no edge0-strata/serve/server.py under $EDGE0" >&2; exit 1; }
if [ -z "${STRATA_BIN:-}" ]; then
for c in "$S/build/strata" "$S/build-c13b/strata"; do
[ -x "$c" ] && { STRATA_BIN="$c"; break; }
done
fi
[ -x "${STRATA_BIN:-}" ] || { echo "no strata binary under $S/build (build the engine first)" >&2; exit 1; }
export PATH="$(dirname "$STRATA_BIN"):$PATH"
# CUDA 13 runtime libs shipped inside the venv, if present
for d in "$S"/.venv/lib/python*/site-packages/nvidia/cu13/lib; do
[ -d "$d" ] && export LD_LIBRARY_PATH="$d${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
done
exec "$S/.venv/bin/python" "$S/serve/server.py" \
--engine strata --config ./model.json --port "${PORT:-8094}"