Skip to content
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

stream should only accept type Boolean when using OpenAI API Server spec #1273

Closed
xvnyv opened this issue Oct 6, 2023 · 1 comment
Closed

Comments

@xvnyv
Copy link

xvnyv commented Oct 6, 2023

The current behaviour of vLLM does not match the behaviour of OpenAI and Azure OpenAI when it comes to the stream parameter in the request body.

Current behaviour of OpenAI and Azure OpenAI:

  • Only "stream": true or "stream": false are accepted. Setting "stream": "true" or "stream": "false" (or any other non-Boolean values) will raise the following error:
{
  "error": {
    "message": "'false' is not of type 'boolean' - 'stream'",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}

Current behaviour of vLLM:

  • The following values for the stream request body parameter are accepted by vLLM: true, "true", false, "false"
  • Any other values will raise the following error:
{
    "object": "error",
    "message": "[{'loc': ('body', 'stream'), 'msg': 'value could not be parsed to a boolean', 'type': 'type_error.bool'}]",
    "type": "invalid_request_error",
    "param": null,
    "code": null
}
  • It seems like this is caused by the use of Pydantic with stream variable set to type bool instead of StrictBool (source code)

May I know if there is an agreement that vLLM should also reject the request when stream is set to the string values of "true" and "false"? I can prepare a PR to make the change if that is the desired behaviour.

@hmellor
Copy link
Collaborator

hmellor commented Mar 13, 2024

This was fixed in #116

@hmellor hmellor closed this as completed Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants