Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
434984e6
Unverified
Commit
434984e6
authored
Oct 23, 2024
by
Yuhong Guo
Committed by
GitHub
Oct 22, 2024
Browse files
[Frontend] Support custom request_id from request (#9550)
Co-authored-by:
Yuhong Guo
<
yuhong.gyh@antgroup.com
>
parent
32a1ee74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
vllm/entrypoints/openai/protocol.py
vllm/entrypoints/openai/protocol.py
+6
-0
vllm/entrypoints/openai/serving_chat.py
vllm/entrypoints/openai/serving_chat.py
+2
-2
No files found.
vllm/entrypoints/openai/protocol.py
View file @
434984e6
...
...
@@ -284,6 +284,12 @@ class ChatCompletionRequest(OpenAIBaseModel):
"The priority of the request (lower means earlier handling; "
"default: 0). Any priority other than 0 will raise an error "
"if the served model does not use priority scheduling."
))
request_id
:
str
=
Field
(
default_factory
=
lambda
:
f
"
{
random_uuid
()
}
"
,
description
=
(
"The request_id related to this request. If the caller does "
"not set it, a random_uuid will be generated. This id is used "
"through out the inference process and return in response."
))
# doc: end-chat-completion-extra-params
...
...
vllm/entrypoints/openai/serving_chat.py
View file @
434984e6
...
...
@@ -38,7 +38,7 @@ from vllm.sequence import Logprob
from
vllm.tracing
import
(
contains_trace_headers
,
extract_trace_headers
,
log_tracing_disabled_warning
)
from
vllm.transformers_utils.tokenizer
import
AnyTokenizer
,
MistralTokenizer
from
vllm.utils
import
iterate_with_cancellation
,
random_uuid
from
vllm.utils
import
iterate_with_cancellation
logger
=
init_logger
(
__name__
)
...
...
@@ -176,7 +176,7 @@ class OpenAIServingChat(OpenAIServing):
"
\"
auto
\"
tool choice requires "
"--enable-auto-tool-choice and --tool-call-parser to be set"
)
request_id
=
f
"chat-
{
r
andom_uuid
()
}
"
request_id
=
f
"chat-
{
r
equest
.
request_id
}
"
request_metadata
=
RequestResponseMetadata
(
request_id
=
request_id
)
if
raw_request
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment