- 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
111 lines
3.7 KiB
Bash
Executable File
111 lines
3.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Serve unsloth Qwen3.8-27B UD-Q8_K_XL on dankclaw with llama.cpp's
|
|
# --spec-default preset (ngram-mod). ROCm backend.
|
|
# Runtime: llama.cpp llama-server (>= b10411).
|
|
#
|
|
# Tunables come from frank-default-large.env in this directory unless the
|
|
# FRANK_LARGE_ENV_FILE environment variable overrides that path.
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
ENV_FILE="${FRANK_LARGE_ENV_FILE:-$SCRIPT_DIR/frank-default-large.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) -----------------
|
|
: "${MODEL_DIR:=/home/dank/models}"
|
|
: "${MODEL_FILE:=Qwen3.8-27B-UD-Q8_K_XL.gguf}"
|
|
: "${DRAFT_FILE:=}" # set: DSpark/DFlash/MTP/... sidecar GGUF in MODEL_DIR
|
|
: "${ALIAS:=frank-default-large}"
|
|
: "${HOST:=0.0.0.0}"
|
|
: "${PORT:=7770}"
|
|
: "${CTX_SIZE:=262144}" # Qwen3.8 native context (env may raise for parallel≥2)
|
|
: "${PARALLEL:=2}"
|
|
: "${SPEC_DEFAULT:=0}" # 1: use --spec-default (ngram-mod preset) instead of --spec-type
|
|
: "${MTP:=0}" # 1: prepend --spec-type draft-mtp before --spec-default (MTP drafts, ngram fallback)
|
|
: "${SPEC_DRAFT_N_MAX:=10}"
|
|
: "${SPEC_NGRAM_MOD_N_MIN:=48}"
|
|
: "${SPEC_NGRAM_MOD_N_MAX:=64}"
|
|
: "${SPEC_NGRAM_MOD_N_MATCH:=24}"
|
|
: "${DEVICE:=ROCm0}"
|
|
: "${N_GPU_LAYERS:=all}"
|
|
: "${CACHE_TYPE_K:=q8_0}"
|
|
: "${CACHE_TYPE_V:=q8_0}"
|
|
: "${BATCH_SIZE:=8192}"
|
|
: "${UBATCH_SIZE:=2048}"
|
|
: "${TEMPERATURE:=1.0}"
|
|
: "${TOP_K:=20}"
|
|
: "${TOP_P:=0.95}"
|
|
: "${MIN_P:=0.0}"
|
|
: "${THREADS:=12}"
|
|
: "${THREADS_HTTP:=1}"
|
|
|
|
LLAMA_SERVER="${LLAMA_SERVER:-/home/dank/llama.cpp/build/bin/llama-server}"
|
|
MODEL="$MODEL_DIR/$MODEL_FILE"
|
|
DRAFT="$MODEL_DIR/$DRAFT_FILE"
|
|
|
|
if [[ ! -f "$MODEL" ]]; then
|
|
echo "missing required file: $MODEL" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Spec flags. --spec-default is a preset that enables ngram-mod
|
|
# (n_match=24, n_min=48, n_max=64) and takes no draft model. The explicit
|
|
# --spec-type / draft-model path is used when SPEC_DEFAULT is 0.
|
|
SPEC_ARGS=()
|
|
if [[ "${SPEC_DEFAULT}" == "1" ]]; then
|
|
if [[ "${MTP}" == "1" ]]; then
|
|
# MTP first (bundled in-model head), then the --spec-default ngram-mod
|
|
# fallback. Order matters: the chain drafts through impls in types
|
|
# vector order. --spec-type appends, so it must precede --spec-default.
|
|
SPEC_ARGS+=(--spec-type draft-mtp)
|
|
fi
|
|
SPEC_ARGS+=(--spec-default)
|
|
else
|
|
if [[ -z "${SPEC_TYPE:-}" ]]; then
|
|
echo "SPEC_TYPE must be set when SPEC_DEFAULT=0" >&2
|
|
exit 1
|
|
fi
|
|
SPEC_ARGS+=(--spec-type "$SPEC_TYPE")
|
|
if [[ -n "$DRAFT_FILE" ]]; then
|
|
if [[ ! -f "$DRAFT" ]]; then
|
|
echo "missing required file: $DRAFT" >&2
|
|
exit 1
|
|
fi
|
|
SPEC_ARGS+=(--spec-draft-model "$DRAFT")
|
|
fi
|
|
if [[ -n "${SPEC_DRAFT_P_MIN:-}" ]]; then
|
|
SPEC_ARGS+=(--spec-draft-p-min "$SPEC_DRAFT_P_MIN")
|
|
fi
|
|
SPEC_ARGS+=(--spec-draft-n-max "$SPEC_DRAFT_N_MAX")
|
|
SPEC_ARGS+=(--spec-ngram-mod-n-min "$SPEC_NGRAM_MOD_N_MIN")
|
|
SPEC_ARGS+=(--spec-ngram-mod-n-max "$SPEC_NGRAM_MOD_N_MAX")
|
|
SPEC_ARGS+=(--spec-ngram-mod-n-match "$SPEC_NGRAM_MOD_N_MATCH")
|
|
fi
|
|
|
|
exec "$LLAMA_SERVER" \
|
|
--model "$MODEL" \
|
|
"${SPEC_ARGS[@]}" \
|
|
--device "$DEVICE" \
|
|
--gpu-layers "$N_GPU_LAYERS" \
|
|
--fit off \
|
|
--cache-type-k "$CACHE_TYPE_K" \
|
|
--cache-type-v "$CACHE_TYPE_V" \
|
|
--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" \
|
|
--alias "$ALIAS" \
|
|
--host "$HOST" \
|
|
--port "$PORT"
|