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[@]}"