-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
[Feature]: Allow setting tool_choice="none" in LLM calls if the OpenAI comaptible vllm server is started with --enable-auto-tool-choice #9426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There's since been another related issue, #10526. IMO the current issue and #10526 are not really feature requests but more bugs: trying to use vLLM served models for downstream applications is essentially incompatible when the same functionality works seamlessly on other serving frameworks like I'm not sure what would get this issue triaged - looking at #8568 it doesn't seem like it would take a lot. Would the maintainers be open to a PR for this? |
Actually, I think I've made a mistake: #10000 seems to actually address the issue @deheim outlined, and the exception message being returned by vLLM as of 'Value error, `tool_choice` must either be a named tool, "auto", or "none". So nominally |
My initial post refered to Version v0.6.3. Maybe already some changes have been made such that tool_choice "none" is now already supported. I can try it out later. Having the option to set it to "required" would be, however, also nice, I agree. But yes maybe the classification as a bug is more appropriate since the error message for other values for tool choice explicitly says that tool_choice none is a valid value. I will update it after my tests with the most recent vllm version |
This can be closed as it's fixed via #10000 |
I just tested it with the most recent version and setting tool_choice to "none" works now |
Uh oh!
There was an error while loading. Please reload this page.
🚀 The feature, motivation and pitch
Apparently, when starting the (OpenAI compatible) vllm server with the option
--enable-auto-tool-choice
to handle function calls, it is not possible to prevent tool calls when calling the model.According to the OpenAI API, this should be possible by setting
tool_choice='none'
. However, setting tool_choice to "none" seems to be not yet supported by vllm.Currently, an ValueError is thrown:
Call:
Error Message:
openai.BadRequestError: Error code: 400 - {'object': 'error', 'message': "[{'type': 'value_error', 'loc': ('body',), 'msg': 'Value error, When using `tool_choice`, `tools` must be set.', 'input': {'messages': [{'role': 'user', 'content': 'Write a poem'}], 'model': 'meta-llama-3.1', 'tool_choice': 'none'}, 'ctx': {'error': ValueError('When using `tool_choice`, `tools` must be set.')}}]", 'type': 'BadRequestError', 'param': None, 'code': 400}
Alternatives
The only alternative would be hosting two models in parallel. One for function calls and one for getting outputs without function calls which is not really practicable.
Additional context
No response
Before submitting a new issue...
The text was updated successfully, but these errors were encountered: