From 5108af11aa45316ebb11a9f552fa443cae1ff4f4 Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 17 Aug 2026 16:50:23 -0700 Subject: [PATCH] frank-default-small: enable tool calling (--enable-auto-tool-choice --tool-call-parser qwen3_xml) 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. --- scripts/frank-default-small.env | 7 +++++++ scripts/serve-frank-small.sh | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/scripts/frank-default-small.env b/scripts/frank-default-small.env index e5efc30..5ad2769 100644 --- a/scripts/frank-default-small.env +++ b/scripts/frank-default-small.env @@ -39,6 +39,13 @@ NGRAM_LOOKUP_MAX=5 NGRAM_LOOKUP_MIN=1 NUM_SPEC_TOKENS=5 +# Tool calling. Clients (pi, OpenWebUI) send tool_choice=auto; without +# --enable-auto-tool-choice vLLM rejects it with HTTP 400. The Avesed +# chat template renders tools in the Qwen3 XML format, so the qwen3_xml +# parser is the matching one. +ENABLE_AUTO_TOOL_CHOICE=1 +TOOL_CALL_PARSER=qwen3_xml + # RDNA flash-attention for the vision encoder (and general FA paths). # Without this, the mm encoder falls back to torch SDPA and the warmup # OOMs (256 GiB score matrix at max_model_len; measured 2026-08-17). diff --git a/scripts/serve-frank-small.sh b/scripts/serve-frank-small.sh index 48472a7..150e72f 100755 --- a/scripts/serve-frank-small.sh +++ b/scripts/serve-frank-small.sh @@ -33,12 +33,20 @@ fi : "${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" \ @@ -50,4 +58,5 @@ exec "$VLLM_BIN" serve "$MODEL" \ --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 + --trust-remote-code \ + "${TOOL_ARGS[@]}"