File size: 737 Bytes
2083edb 7f28039 2083edb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #!/bin/sh
set -eu
MODEL_PATH="${MODEL_PATH:-/models/NVIDIA-Nemotron-3-Nano-4B-BF16.Q4_K_M.gguf}"
PORT="${PORT:-7860}"
CTX_SIZE="${CTX_SIZE:-2048}"
N_GPU_LAYERS="${N_GPU_LAYERS:-0}"
SERVER_BIN="/app/llama-server"
if [ ! -x "$SERVER_BIN" ]; then
SERVER_BIN="$(command -v llama-server || true)"
fi
if [ -z "$SERVER_BIN" ]; then
echo "Could not find llama-server" >&2
find / -name llama-server -type f 2>/dev/null | head >&2 || true
exit 1
fi
if [ ! -f "$MODEL_PATH" ]; then
echo "Model not found at $MODEL_PATH" >&2
ls -lah /models || true
exit 1
fi
echo "Starting llama.cpp server with $MODEL_PATH"
exec "$SERVER_BIN" \
-m "$MODEL_PATH" \
--host 0.0.0.0 \
--port "$PORT" \
-c "$CTX_SIZE" \
-ngl "$N_GPU_LAYERS"
|