48 lines
1.5 KiB
Bash
Executable File
48 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Serve the Qwen3.8-27B pipeline-parallel RPC worker on Dankserver.
|
|
#
|
|
# Runs ggml-rpc-server from the b10433 CUDA+RPC build and exposes the RTX
|
|
# 3090 as a remote device for the head on Dankclaw.
|
|
#
|
|
# Tunables come from frank-pp-worker.env in this directory unless the
|
|
# FRANK_PP_WORKER_ENV_FILE environment variable overrides that path.
|
|
#
|
|
# Security note (upstream): the RPC server is "fragile and insecure". No
|
|
# authentication, no encryption. Keep it on the trusted LAN only.
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
ENV_FILE="${FRANK_PP_WORKER_ENV_FILE:-$SCRIPT_DIR/frank-pp-worker.env}"
|
|
if [[ -f "$ENV_FILE" ]]; then
|
|
set -a
|
|
# shellcheck disable=SC1090
|
|
source "$ENV_FILE"
|
|
set +a
|
|
fi
|
|
|
|
# --- defaults (used when the env file does not set them) -------------------
|
|
: "${RPC_BIND:=192.168.0.235}"
|
|
: "${RPC_PORT:=50052}"
|
|
: "${DEVICE:=CUDA0}"
|
|
: "${THREADS:=7}"
|
|
: "${CACHE:=1}"
|
|
: "${WORKER_BIN:=/home/dank/llama-cpp-rpc/build/bin/ggml-rpc-server}"
|
|
|
|
if [[ ! -x "$WORKER_BIN" ]]; then
|
|
echo "missing worker binary: $WORKER_BIN" >&2
|
|
echo "Build it: cd /home/dank/llama-cpp-rpc && cmake -B build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON -DGGML_CUDA_FA_ALL_QUANTS=ON -DGGML_RPC=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release -- -j 8" >&2
|
|
exit 1
|
|
fi
|
|
|
|
ARGS=()
|
|
if [[ "${CACHE}" == "1" ]]; then
|
|
ARGS+=(--cache)
|
|
fi
|
|
|
|
exec "$WORKER_BIN" \
|
|
--host "$RPC_BIND" \
|
|
--port "$RPC_PORT" \
|
|
--device "$DEVICE" \
|
|
--threads "$THREADS" \
|
|
"${ARGS[@]}"
|