serve-frank-large: restore Qwen-Sharp chat template + reformat for readability

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
This commit is contained in:
Frank
2026-08-26 00:38:39 -07:00
parent 8d8a5f7842
commit 0150333a6a
2 changed files with 51 additions and 15 deletions
+48 -13
View File
@@ -1,6 +1,10 @@
#!/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)"
@@ -12,11 +16,14 @@ if [[ -f "$ENV_FILE" ]]; then
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}"
@@ -70,19 +77,47 @@ exec /usr/bin/env \
GGML_CUDA_GRAPH_OPT=0 \
LLAMA_TARGET_GREEDY_ARGMAX_FASTPATH=0 \
LLAMA_MTP_CPU_ARGMAX_FASTPATH=1 \
"$LLAMA_BIN" -m "$MODEL" --alias "$ALIAS" \
--host "$BIND_ADDR" --port "$LISTEN_PORT" --jinja \
-dev ROCm0 -ngl 999 -np "$PARALLEL" -c "$CTX_SIZE" \
-b "$BATCH_SIZE" -ub "$UBATCH_SIZE" -fa on \
-ctk "$CACHE_TYPE_K" -ctv "$CACHE_TYPE_V" -t "$NUM_THREADS" -tb "$THREAD_BATCH" \
-ctxcp "$CTX_CHECKPOINTS" --cache-ram "$CACHE_RAM" --cache-prompt --cache-idle-slots --metrics \
--spec-type draft-mtp --model-draft "$MTP_DRAFT_FILE" \
"$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-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" \
--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
--reasoning "$REASONING" \
--reasoning-format "$REASONING_FORMAT" \
--reasoning-budget -1