Files
serverAppConfigs/old/scripts/serve-ling-flash.sh
T
Frank d9af7f1d19 fleet redo 2026-08-17: retire PP+NPU, new topology
- Move all previous scripts to old/scripts/ (retired PP/NPU-era)
- frank-default-large: llama.cpp FastMTP on dankserver (HauhauCS
  Qwen3.8-27B IQ4_XS + FastMTP 32K draft + ngram-mod, K q8_0/V f16,
  128K ctx, batch 2048/ubatch 1024, port 7770)
- frank-default-small: vLLM ROCm on dankclaw (Avesed Qwen3.6-35B-A3B
  INT8 W8A8, full 262144 ctx, no KV quant, 4 seqs, batch 16384,
  ngram spec, port 52625)
- retarget deploy.sh (dankserver/dankclaw, inline sudo, no helpers)
- docs: deployment + index + AGENTS.md + README for new topology,
  superseded banners on retired docs, add frank-redo-2026-08-17 runbook
2026-08-17 15:23:46 -07:00

91 lines
3.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# Serve inclusionAI Ling-3.0-flash (Q6_K) on dankclaw as a TRIAL, replacing
# frank-default-large temporarily.
#
# Runtime: llama.cpp FORK (aetherbird bailingmoe3-support) - stock llama.cpp
# cannot load the bailingmoe3 architecture. Backend: Vulkan (RADV) on the
# Strix Halo APU; memory is the shared 128 GB pool (96 GiB UMA + GTT that
# Vulkan exposes as an ~111 GiB heap). MTP drafter is bundled in the same
# GGUF (block 42) - no separate --spec-draft-model needed.
#
# Tie-back: to restore the Qwen3.6-27B service, stop frank-large-ling and
# start frank-default-large (its env/unit are committed and unchanged).
#
# Tunables come from frank-default-large.ling.env in this directory unless
# FRANK_LING_ENV_FILE overrides that path.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ENV_FILE="${FRANK_LING_ENV_FILE:-$SCRIPT_DIR/frank-default-large.ling.env}"
if [[ -f "$ENV_FILE" ]]; then
set -a
# shellcheck disable=SC1090
source "$ENV_FILE"
set +a
fi
# --- defaults -------------------------------------------------------------
: "${MODEL_DIR:=/home/dank/models}"
: "${MODEL_FILE:=Ling-3.0-flash-Q6_K.gguf}"
: "${ALIAS:=frank-default-large}" # keep the same API alias for clients
: "${HOST:=0.0.0.0}"
: "${PORT:=7770}"
: "${CTX_SIZE:=32768}"
: "${PARALLEL:=2}"
: "${SPEC_TYPE:=draft-mtp}" # MTP block is bundled in the model GGUF
: "${SPEC_DRAFT_N_MAX:=3}"
: "${SPEC_NGRAM_MOD_N_MIN:=48}"
: "${SPEC_NGRAM_MOD_N_MAX:=64}"
: "${SPEC_NGRAM_MOD_N_MATCH:=24}"
: "${DEVICE:=Vulkan0}"
: "${N_GPU_LAYERS:=all}"
: "${BATCH_SIZE:=512}"
: "${UBATCH_SIZE:=512}"
: "${TEMPERATURE:=1.0}"
: "${TOP_K:=20}"
: "${TOP_P:=0.95}"
: "${MIN_P:=0.0}"
: "${THREADS:=12}"
: "${THREADS_HTTP:=1}"
: "${VERBOSITY:=0}" # ggml log verbosity 0-5; 4 = verbose, 5 = debug
: "${LOG_FILE:=}" # optional; if set, --log-file path
# Fork binary; stock llama.cpp cannot load bailingmoe3.
LLAMA_SERVER="${LLAMA_SERVER:-/home/dank/llama.cpp-ling/build/bin/llama-server}"
MODEL="$MODEL_DIR/$MODEL_FILE"
if [[ ! -x "$LLAMA_SERVER" ]]; then
echo "missing fork binary: $LLAMA_SERVER (build required)" >&2
exit 1
fi
if [[ ! -f "$MODEL" ]]; then
echo "missing model: $MODEL" >&2
exit 1
fi
exec "$LLAMA_SERVER" \
$(if [[ -n "$LOG_FILE" ]]; then echo "--log-file $LOG_FILE"; fi) \
--model "$MODEL" \
--spec-type "$SPEC_TYPE" \
--spec-draft-n-max "$SPEC_DRAFT_N_MAX" \
--spec-ngram-mod-n-min "$SPEC_NGRAM_MOD_N_MIN" \
--spec-ngram-mod-n-max "$SPEC_NGRAM_MOD_N_MAX" \
--spec-ngram-mod-n-match "$SPEC_NGRAM_MOD_N_MATCH" \
--device "$DEVICE" \
--gpu-layers "$N_GPU_LAYERS" \
--flash-attn auto \
--ctx-size "$CTX_SIZE" \
--parallel "$PARALLEL" \
--batch-size "$BATCH_SIZE" \
--ubatch-size "$UBATCH_SIZE" \
--temp "$TEMPERATURE" \
--top-k "$TOP_K" \
--top-p "$TOP_P" \
--min-p "$MIN_P" \
--threads "$THREADS" \
--threads-http "$THREADS_HTTP" \
-lv "$VERBOSITY" \
--alias "$ALIAS" \
--host "$HOST" \
--port "$PORT"