Clients send tool_choice=auto; without these flags vLLM rejects with HTTP 400. The Avesed chat template renders the Qwen3 XML tool format, so qwen3_xml is the matching parser.
63 lines
2.1 KiB
Bash
Executable File
63 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Serve Avesed/Qwen3.6-35B-A3B-INT8-W8A8 via vLLM on Dankclaw (Strix Halo).
|
|
#
|
|
# Runs the ROCm vLLM build in /home/dank/vllm-venv. The model is a
|
|
# compressed-tensors INT8 W8A8 quant (MoE, 35B total / 3B active). Full
|
|
# 262144 context, unquantized KV cache, 4 concurrent sequences, ngram
|
|
# speculative decoding.
|
|
#
|
|
# Tunables come from frank-default-small.env in this directory unless
|
|
# FRANK_SMALL_ENV_FILE overrides that path.
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
ENV_FILE="${FRANK_SMALL_ENV_FILE:-$SCRIPT_DIR/frank-default-small.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) -------------------
|
|
: "${VLLM_BIN:=/home/dank/vllm-venv/bin/vllm}"
|
|
: "${MODEL:=Avesed/Qwen3.6-35B-A3B-INT8-W8A8}"
|
|
: "${ALIAS:=frank-default-small}"
|
|
: "${BIND_ADDR:=0.0.0.0}"
|
|
: "${LISTEN_PORT:=52625}"
|
|
: "${MAX_MODEL_LEN:=262144}"
|
|
: "${KV_CACHE_DTYPE:=auto}"
|
|
: "${MAX_NUM_SEQS:=4}"
|
|
: "${MAX_NUM_BATCHED_TOKENS:=16384}"
|
|
: "${GPU_MEMORY_UTILIZATION:=0.92}"
|
|
: "${NGRAM_LOOKUP_MAX:=5}"
|
|
: "${NGRAM_LOOKUP_MIN:=1}"
|
|
: "${NUM_SPEC_TOKENS:=5}"
|
|
: "${ENABLE_AUTO_TOOL_CHOICE:=1}"
|
|
: "${TOOL_CALL_PARSER:=qwen3_xml}"
|
|
|
|
if [[ ! -x "$VLLM_BIN" ]]; then
|
|
echo "missing vllm binary: $VLLM_BIN" >&2
|
|
exit 1
|
|
fi
|
|
|
|
TOOL_ARGS=()
|
|
if [[ "${ENABLE_AUTO_TOOL_CHOICE}" == "1" ]]; then
|
|
TOOL_ARGS+=(--enable-auto-tool-choice)
|
|
TOOL_ARGS+=(--tool-call-parser "${TOOL_CALL_PARSER}")
|
|
fi
|
|
|
|
exec "$VLLM_BIN" serve "$MODEL" \
|
|
--host "$BIND_ADDR" \
|
|
--port "$LISTEN_PORT" \
|
|
--served-model-name "$ALIAS" \
|
|
--max-model-len "$MAX_MODEL_LEN" \
|
|
--kv-cache-dtype "$KV_CACHE_DTYPE" \
|
|
--max-num-seqs "$MAX_NUM_SEQS" \
|
|
--max-num-batched-tokens "$MAX_NUM_BATCHED_TOKENS" \
|
|
--gpu-memory-utilization "$GPU_MEMORY_UTILIZATION" \
|
|
--speculative-config "{\"method\":\"ngram\",\"prompt_lookup_max\":$NGRAM_LOOKUP_MAX,\"prompt_lookup_min\":$NGRAM_LOOKUP_MIN,\"num_speculative_tokens\":$NUM_SPEC_TOKENS}" \
|
|
--reasoning-parser qwen3 \
|
|
--trust-remote-code \
|
|
"${TOOL_ARGS[@]}"
|