her / narrator /run_server.sh
geekwrestler's picture
Squash history (purge pre-scrub demo session blobs)
5f43c7d
Raw
History Blame Contribute Delete
886 Bytes
#!/usr/bin/env bash
# Start the LOCAL narrator model server (llama.cpp llama-server).
# Localhost only — bound to 127.0.0.1 so no trace content can leave the machine.
# This server is used ONLY by the narrator, ONLY for prose.
set -euo pipefail
# Repo-relative default so it works on any machine (the ./her runner also passes
# NARRATOR_MODEL explicitly). Override with NARRATOR_MODEL / NARRATOR_PORT.
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MODEL="${NARRATOR_MODEL:-$HERE/../models/Qwen3.5-9B-UD-Q4_K_XL.gguf}"
HOST="127.0.0.1"
PORT="${NARRATOR_PORT:-12781}"
if ! command -v llama-server >/dev/null 2>&1; then
echo "llama-server not found on PATH (install llama.cpp)." >&2
exit 127
fi
if [ ! -f "$MODEL" ]; then
echo "Model file not found: $MODEL" >&2
exit 1
fi
exec llama-server \
-m "$MODEL" \
--host "$HOST" \
--port "$PORT" \
-c 8192 \
--jinja