vllm.entrypoints.openai.run_batch ¶
BatchRequestInputBody module-attribute ¶
BatchRequestInputBody: TypeAlias = (
ChatCompletionRequest
| EmbeddingRequest
| ScoreRequest
| RerankRequest
)
_BAR_FORMAT module-attribute ¶
_BAR_FORMAT = "{desc}: {percentage:3.0f}% Completed | {n_fmt}/{total_fmt} [{elapsed}<{remaining}, {rate_fmt}]\n"
BatchProgressTracker ¶
Source code in vllm/entrypoints/openai/run_batch.py
BatchRequestInput ¶
Bases: OpenAIBaseModel
The per-line object of the batch input file.
NOTE: Currently only the /v1/chat/completions endpoint is supported.
Source code in vllm/entrypoints/openai/run_batch.py
check_type_for_url classmethod ¶
check_type_for_url(value: Any, info: ValidationInfo)
Source code in vllm/entrypoints/openai/run_batch.py
BatchRequestOutput ¶
Bases: OpenAIBaseModel
The per-line object of the batch output and error files
Source code in vllm/entrypoints/openai/run_batch.py
BatchResponseData ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/run_batch.py
body class-attribute instance-attribute ¶
body: (
ChatCompletionResponse
| EmbeddingResponse
| ScoreResponse
| RerankResponse
| None
) = None
main async ¶
main(args: Namespace)
Source code in vllm/entrypoints/openai/run_batch.py
make_arg_parser ¶
make_arg_parser(parser: FlexibleArgumentParser)
Source code in vllm/entrypoints/openai/run_batch.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
make_async_error_request_output async ¶
make_async_error_request_output(
request: BatchRequestInput, error_msg: str
) -> BatchRequestOutput
make_error_request_output ¶
make_error_request_output(
request: BatchRequestInput, error_msg: str
) -> BatchRequestOutput
Source code in vllm/entrypoints/openai/run_batch.py
parse_args ¶
read_file async ¶
Source code in vllm/entrypoints/openai/run_batch.py
run_batch async ¶
run_batch(
engine_client: EngineClient, args: Namespace
) -> None
Source code in vllm/entrypoints/openai/run_batch.py
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 | |
run_request async ¶
run_request(
serving_engine_func: Callable,
request: BatchRequestInput,
tracker: BatchProgressTracker,
) -> BatchRequestOutput
Source code in vllm/entrypoints/openai/run_batch.py
upload_data async ¶
Upload a local file to a URL. output_url: The URL to upload the file to. data_or_file: Either the data to upload or the path to the file to upload. from_file: If True, data_or_file is the path to the file to upload.
Source code in vllm/entrypoints/openai/run_batch.py
validate_run_batch_args ¶
Source code in vllm/entrypoints/openai/run_batch.py
write_file async ¶
write_file(
path_or_url: str,
batch_outputs: list[BatchRequestOutput],
output_tmp_dir: str,
) -> None
Write batch_outputs to a file or upload to a URL. path_or_url: The path or URL to write batch_outputs to. batch_outputs: The list of batch outputs to write. output_tmp_dir: The directory to store the output file before uploading it to the output URL.
Source code in vllm/entrypoints/openai/run_batch.py
write_local_file async ¶
write_local_file(
output_path: str,
batch_outputs: list[BatchRequestOutput],
) -> None
Write the responses to a local file. output_path: The path to write the responses to. batch_outputs: The list of batch outputs to write.