The v6 restore commits dropped --chat-template-file and --chat-template-kwargs while the artifact check still validated the template file, so the Sharp template was checked but never applied. Re-add both flags (with --jinja) so reasoning is emitted in DeepSeek format and preserve_thinking/preserve_reasoning are honoured. Reformat the script one-flag-per-line with long flag aliases (--gpu-layers, --ctx-size, --ubatch-size, --cache-type-k/v) like serve-frank-small, and update the 2 frank_large_config assertions that grep the old short-flag forms (-ctk/-ctv, -ub). - scripts/serve-frank-large.sh - tests/frank_large_config.bats
124 lines
4.1 KiB
Bash
Executable File
124 lines
4.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Serve the kingjones Qwen3.8 Uncensored Q6 AGENT model as frank-default-large.
|
|
# The deployment uses a standalone MTP draft head and f16 KV cache.
|
|
#
|
|
# The Qwen-Sharp chat template (scripts/chat-template.jinja) is applied at
|
|
# runtime so the model emits reasoning in DeepSeek format; the reasoning
|
|
# trail is preserved across turns via CHAT_TEMPLATE_KWARGS.
|
|
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) -------------------
|
|
: "${LLAMA_BIN:=/home/dank/ciru-qwen38/ROCmFPX/build-promptforge/bin/llama-server}"
|
|
: "${MODEL_DIR:=/home/dank/models/kingjones-Qwen3.8-27B-STRIX-MTP}"
|
|
: "${MODEL_FILE:=Qwen3.8-27B-Uncensored-Q6_0_ROCMFPX_AGENT.gguf}"
|
|
: "${MTP_DRAFT_FILE:=$MODEL_DIR/mtp-Qwen3.8-27B-Q4_0.gguf}"
|
|
: "${MMPROJ_FILE:=mmproj-Qwen3.8-27B-Q8_0.gguf}"
|
|
: "${CHAT_TEMPLATE_FILE:=$SCRIPT_DIR/chat-template.jinja}"
|
|
: "${CHAT_TEMPLATE_KWARGS:={}}"
|
|
: "${ALIAS:=frank-default-large}"
|
|
: "${BIND_ADDR:=0.0.0.0}"
|
|
: "${LISTEN_PORT:=7770}"
|
|
: "${CTX_SIZE:=262144}"
|
|
: "${PARALLEL:=1}"
|
|
: "${BATCH_SIZE:=4096}"
|
|
: "${UBATCH_SIZE:=4096}"
|
|
: "${NUM_THREADS:=16}"
|
|
: "${THREAD_BATCH:=32}"
|
|
: "${CACHE_TYPE_K:=f16}"
|
|
: "${CACHE_TYPE_V:=f16}"
|
|
: "${CTX_CHECKPOINTS:=16}"
|
|
: "${CACHE_RAM:=8192}"
|
|
: "${MTP_N_MAX:=4}"
|
|
: "${MTP_N_MIN:=0}"
|
|
: "${MTP_P_MIN:=0.0}"
|
|
: "${MTP_P_SPLIT:=0.10}"
|
|
: "${TEMPERATURE:=0.7}"
|
|
: "${TOP_K:=20}"
|
|
: "${TOP_P:=0.8}"
|
|
: "${MIN_P:=0.0}"
|
|
: "${PRESENCE_PENALTY:=1.5}"
|
|
: "${REASONING:=off}"
|
|
: "${REASONING_FORMAT:=none}"
|
|
: "${HSA_OVERRIDE_GFX_VERSION:=11.5.1}"
|
|
|
|
MODEL="$MODEL_DIR/$MODEL_FILE"
|
|
for f in "$LLAMA_BIN" "$MODEL" "$MTP_DRAFT_FILE" "$MODEL_DIR/$MMPROJ_FILE" "$CHAT_TEMPLATE_FILE"; do
|
|
if [[ ! -r "$f" ]]; then
|
|
echo "missing or unreadable required artifact: $f" >&2
|
|
exit 1
|
|
fi
|
|
done
|
|
if [[ ! -x "$LLAMA_BIN" ]]; then
|
|
echo "missing executable runtime: $LLAMA_BIN" >&2
|
|
exit 1
|
|
fi
|
|
SERVER_DIR="$(cd -- "$(dirname -- "$LLAMA_BIN")" && pwd)"
|
|
ROCM_PATH="${ROCM_DEVEL:-${ROCM_PATH:-/opt/rocm}}"
|
|
if [[ -n "${ROCM_LIB:-}" && -n "${ROCM_CORE:-}" ]]; then
|
|
LIBRARY_PATH="$ROCM_LIB/lib:$ROCM_CORE/lib:$ROCM_DEVEL/lib/llvm/lib:$SERVER_DIR:${LD_LIBRARY_PATH:-}"
|
|
else
|
|
LIBRARY_PATH="$SERVER_DIR:$ROCM_PATH/lib:$ROCM_PATH/lib/rocm_sysdeps/lib:$ROCM_PATH/lib/llvm/lib:$ROCM_PATH/llvm/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
|
fi
|
|
|
|
exec /usr/bin/env \
|
|
ROCM_PATH="$ROCM_PATH" \
|
|
HIP_VISIBLE_DEVICES=0 \
|
|
LD_LIBRARY_PATH="$LIBRARY_PATH" \
|
|
HSA_OVERRIDE_GFX_VERSION="$HSA_OVERRIDE_GFX_VERSION" \
|
|
GGML_CUDA_GRAPH_OPT=0 \
|
|
LLAMA_TARGET_GREEDY_ARGMAX_FASTPATH=0 \
|
|
LLAMA_MTP_CPU_ARGMAX_FASTPATH=1 \
|
|
"$LLAMA_BIN" \
|
|
--model "$MODEL" \
|
|
--alias "$ALIAS" \
|
|
--chat-template-file "$CHAT_TEMPLATE_FILE" \
|
|
--chat-template-kwargs "$CHAT_TEMPLATE_KWARGS" \
|
|
--host "$BIND_ADDR" \
|
|
--port "$LISTEN_PORT" \
|
|
--jinja \
|
|
--device ROCm0 \
|
|
--gpu-layers 999 \
|
|
--parallel "$PARALLEL" \
|
|
--ctx-size "$CTX_SIZE" \
|
|
--batch-size "$BATCH_SIZE" \
|
|
--ubatch-size "$UBATCH_SIZE" \
|
|
--flash-attn on \
|
|
--cache-type-k "$CACHE_TYPE_K" \
|
|
--cache-type-v "$CACHE_TYPE_V" \
|
|
--threads "$NUM_THREADS" \
|
|
--threads-batch "$THREAD_BATCH" \
|
|
--ctx-checkpoints "$CTX_CHECKPOINTS" \
|
|
--cache-ram "$CACHE_RAM" \
|
|
--cache-prompt \
|
|
--cache-idle-slots \
|
|
--metrics \
|
|
--spec-type draft-mtp \
|
|
--model-draft "$MTP_DRAFT_FILE" \
|
|
--mmproj "$MODEL_DIR/$MMPROJ_FILE" \
|
|
--spec-draft-device ROCm0 \
|
|
--spec-draft-ngl 999 \
|
|
--spec-draft-type-k "$CACHE_TYPE_K" \
|
|
--spec-draft-type-v "$CACHE_TYPE_V" \
|
|
--spec-draft-n-max "$MTP_N_MAX" \
|
|
--spec-draft-n-min "$MTP_N_MIN" \
|
|
--spec-draft-p-min "$MTP_P_MIN" \
|
|
--spec-draft-p-split "$MTP_P_SPLIT" \
|
|
--spec-draft-backend-sampling \
|
|
--temp "$TEMPERATURE" \
|
|
--top-p "$TOP_P" \
|
|
--top-k "$TOP_K" \
|
|
--min-p "$MIN_P" \
|
|
--presence-penalty "$PRESENCE_PENALTY" \
|
|
--reasoning "$REASONING" \
|
|
--reasoning-format "$REASONING_FORMAT" \
|
|
--reasoning-budget -1
|