[Frontend] Expand tools even if tool_choice="none" (#17177)

Signed-off-by: okada shintarou <okada@preferred.jp>
This commit is contained in:
Shintarou Okada
2025-07-02 01:47:38 +09:00
committed by GitHub
parent 8acb4badee
commit 3d19d47d91
5 changed files with 43 additions and 6 deletions

View File

@@ -99,6 +99,14 @@ vLLM supports the `tool_choice='required'` option in the chat completion API. Si
When tool_choice='required' is set, the model is guaranteed to generate one or more tool calls based on the specified tool list in the `tools` parameter. The number of tool calls depends on the user's query. The output format strictly follows the schema defined in the `tools` parameter.
## None Function Calling
vLLM supports the `tool_choice='none'` option in the chat completion API. When this option is set, the model will not generate any tool calls and will respond with regular text content only, even if tools are defined in the request.
By default, when `tool_choice='none'` is specified, vLLM excludes tool definitions from the prompt to optimize context usage. To include tool definitions even with `tool_choice='none'`, use the `--expand-tools-even-if-tool-choice-none` option.
Note: This behavior will change in v0.10.0, where tool definitions will be included by default even with `tool_choice='none'`.
## Automatic Function Calling
To enable this feature, you should set the following flags: