vllm.benchmarks.lib.endpoint_request_func
¶
The request function for API endpoints.
Classes:
-
RequestFuncInput–The input for the request function.
-
RequestFuncOutput–The output of the request function including metrics.
-
StreamedResponseHandler–Handles streaming HTTP responses by accumulating chunks until complete
Functions:
-
async_request_openai_completions–The async request function for the OpenAI Completions API.
RequestFuncInput
dataclass
¶
The input for the request function.
RequestFuncOutput
dataclass
¶
The output of the request function including metrics.
StreamedResponseHandler
¶
_extract_sse_data(message)
¶
Extract the data payload of a single SSE message.
The Responses API stream labels every message with an event: line
before its data: line, so the payload cannot be recovered by
stripping a leading data: the way the Completions and Chat
Completions streams allow.
Parameters:
Returns:
async_request_openai_completions(request_func_input, session, pbar=None)
async
¶
The async request function for the OpenAI Completions API.
Parameters:
-
(request_func_input¶RequestFuncInput) –The input for the request function.
-
(session¶ClientSession) –The aiohttp session used to issue the request.
-
(pbar¶tqdm | None, default:None) –The progress bar to display the progress.
Returns:
-
RequestFuncOutput–The output of the request function.