-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
[Bug]: Invalid inputs do not result in error #4339
Comments
Thanks for raising this issue. It does puzzle me why it happen since we have the pydantic model defined here vllm/vllm/entrypoints/openai/protocol.py Line 63 in aae0824
and fastapi reference here
We also did not enable extra fields allowed. |
Any help appreciated! |
The default setting in Pydantic (as documented here) silently drops extra fields. In order to disallow extra fields, we have to explicitly disable it in the model class ( |
I have tested this and found that there is another reason why invalid keys in Edit: Opened PR #4355. |
Wow, that was lightning fast, @DarkLight1337 and @simon-mo. Thanks for working on this so quickly! |
Your current environment
Start vLLM:
docker run --gpus all -v ~/.cache/huggingface:/root/.cache/huggingface -p 8000:8000 --ipc=host vllm/vllm-openai:latest --model gpt2 --dtype float16 --max-model-len 1024
🐛 Describe the bug
When running inference with vLLM, errors are not returned when an invalid input is supplied.
After starting vLLM as specified above, run a curl command that supplies invalid inputs:
curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{ "model": "gpt2", "messages": [ { "role": "system", "content": "You are a helpful assistant.", "fake_input": "2" }, { "role": "user", "content": "Hello!", "fake_input": "3" } ] }'
You get a successful response. Fake_input is dropped instead of returning an error. This silent failure can be dangerous with typos or invalid inputs. Can this be fixed?
The text was updated successfully, but these errors were encountered: