Enable tool calling and reasoning parsing in vLLM
serve an api
// what it does
--enable-auto-tool-choice lets Gemma 4 emit tool calls, while --tool-call-parser gemma4 and --reasoning-parser gemma4 teach vLLM to split the model's tool-call and thinking segments out of the raw text into structured fields. --chat-template points at the Gemma 4 tool template shipped in vLLM's examples/. Together they surface reasoning_content and tool_calls in the API response.
// shell
$ vllm serve google/gemma-4-31B-it --enable-auto-tool-choice --tool-call-parser gemma4 --reasoning-parser gemma4 --chat-template examples/tool_chat_template_gemma4.jinja// gotcha
Forgetting --reasoning-parser gemma4 leaves the raw <|channel>thought ... <channel|> block inside the assistant message content instead of a separate reasoning_content field, so your app shows the model's private thinking to users.