vllm.entrypoints.openai.protocol
AnyResponseFormat
module-attribute
¶
AnyResponseFormat = Union[
ResponseFormat, StructuralTagResponseFormat
]
AudioResponseFormat
module-attribute
¶
BatchRequestInputBody
module-attribute
¶
BatchRequestInputBody = Union[
ChatCompletionRequest,
EmbeddingRequest,
ScoreRequest,
RerankRequest,
]
EmbeddingRequest
module-attribute
¶
EmbeddingRequest = Union[
EmbeddingCompletionRequest, EmbeddingChatRequest
]
LogitsProcessors
module-attribute
¶
LogitsProcessors = list[
Union[str, LogitsProcessorConstructor]
]
PoolingRequest
module-attribute
¶
PoolingRequest = Union[
PoolingCompletionRequest, PoolingChatRequest
]
TokenizeRequest
module-attribute
¶
TokenizeRequest = Union[
TokenizeCompletionRequest, TokenizeChatRequest
]
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/protocol.py
check_type_for_url
classmethod
¶
check_type_for_url(value: Any, info: ValidationInfo)
Source code in vllm/entrypoints/openai/protocol.py
BatchRequestOutput
¶
Bases: OpenAIBaseModel
The per-line object of the batch output and error files
Source code in vllm/entrypoints/openai/protocol.py
BatchResponseData
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
body
class-attribute
instance-attribute
¶
body: Optional[
Union[
ChatCompletionResponse,
EmbeddingResponse,
ScoreResponse,
RerankResponse,
]
] = None
ChatCompletionLogProb
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
ChatCompletionLogProbs
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
content
class-attribute
instance-attribute
¶
content: Optional[list[ChatCompletionLogProbsContent]] = (
None
)
ChatCompletionLogProbsContent
¶
Bases: ChatCompletionLogProb
Source code in vllm/entrypoints/openai/protocol.py
ChatCompletionNamedFunction
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
ChatCompletionNamedToolChoiceParam
¶
ChatCompletionRequest
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 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 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 |
|
_DEFAULT_SAMPLING_PARAMS
class-attribute
instance-attribute
¶
_DEFAULT_SAMPLING_PARAMS: dict = {
"repetition_penalty": 1.0,
"temperature": 1.0,
"top_p": 1.0,
"top_k": 0,
"min_p": 0.0,
}
add_generation_prompt
class-attribute
instance-attribute
¶
add_generation_prompt: bool = Field(
default=True,
description="If true, the generation prompt will be added to the chat template. This is a parameter used by chat template in tokenizer config of the model.",
)
add_special_tokens
class-attribute
instance-attribute
¶
add_special_tokens: bool = Field(
default=False,
description="If true, special tokens (e.g. BOS) will be added to the prompt on top of what is added by the chat template. For most models, the chat template takes care of adding the special tokens so this should be set to false (as is the default).",
)
allowed_token_ids
class-attribute
instance-attribute
¶
cache_salt
class-attribute
instance-attribute
¶
cache_salt: Optional[str] = Field(
default=None,
description="If specified, the prefix cache will be salted with the provided string to prevent an attacker to guess prompts in multi-user environments. The salt should be random, protected from access by 3rd parties, and long enough to be unpredictable (e.g., 43 characters base64-encoded, corresponding to 256 bit). Not supported by vLLM engine V0.",
)
chat_template
class-attribute
instance-attribute
¶
chat_template: Optional[str] = Field(
default=None,
description="A Jinja template to use for this conversion. As of transformers v4.44, default chat template is no longer allowed, so you must provide a chat template if the tokenizer does not define one.",
)
chat_template_kwargs
class-attribute
instance-attribute
¶
chat_template_kwargs: Optional[dict[str, Any]] = Field(
default=None,
description="Additional keyword args to pass to the template renderer. Will be accessible by the chat template.",
)
continue_final_message
class-attribute
instance-attribute
¶
continue_final_message: bool = Field(
default=False,
description='If this is set, the chat will be formatted so that the final message in the chat is open-ended, without any EOS tokens. The model will continue this message rather than starting a new one. This allows you to "prefill" part of the model\'s response for it. Cannot be used at the same time as `add_generation_prompt`.',
)
documents
class-attribute
instance-attribute
¶
documents: Optional[list[dict[str, str]]] = Field(
default=None,
description='A list of dicts representing documents that will be accessible to the model if it is performing RAG (retrieval-augmented generation). If the template does not support RAG, this argument will have no effect. We recommend that each document should be a dict containing "title" and "text" keys.',
)
echo
class-attribute
instance-attribute
¶
echo: bool = Field(
default=False,
description="If true, the new message will be prepended with the last message if they belong to the same role.",
)
guided_choice
class-attribute
instance-attribute
¶
guided_choice: Optional[list[str]] = Field(
default=None,
description="If specified, the output will be exactly one of the choices.",
)
guided_decoding_backend
class-attribute
instance-attribute
¶
guided_decoding_backend: Optional[str] = Field(
default=None,
description="If specified, will override the default guided decoding backend of the server for this specific request. If set, must be either 'outlines' / 'lm-format-enforcer'",
)
guided_grammar
class-attribute
instance-attribute
¶
guided_grammar: Optional[str] = Field(
default=None,
description="If specified, the output will follow the context free grammar.",
)
guided_json
class-attribute
instance-attribute
¶
guided_json: Optional[Union[str, dict, BaseModel]] = Field(
default=None,
description="If specified, the output will follow the JSON schema.",
)
guided_regex
class-attribute
instance-attribute
¶
guided_regex: Optional[str] = Field(
default=None,
description="If specified, the output will follow the regex pattern.",
)
guided_whitespace_pattern
class-attribute
instance-attribute
¶
guided_whitespace_pattern: Optional[str] = Field(
default=None,
description="If specified, will override the default whitespace pattern for guided json decoding.",
)
include_stop_str_in_output
class-attribute
instance-attribute
¶
include_stop_str_in_output: bool = False
kv_transfer_params
class-attribute
instance-attribute
¶
kv_transfer_params: Optional[dict[str, Any]] = Field(
default=None,
description="KVTransfer parameters used for disaggregated serving.",
)
logits_processors
class-attribute
instance-attribute
¶
logits_processors: Optional[LogitsProcessors] = Field(
default=None,
description="A list of either qualified names of logits processors, or constructor objects, to apply when sampling. A constructor is a JSON object with a required 'qualname' field specifying the qualified name of the processor class/factory, and optional 'args' and 'kwargs' fields containing positional and keyword arguments. For example: {'qualname': 'my_module.MyLogitsProcessor', 'args': [1, 2], 'kwargs': {'param': 'value'}}.",
)
max_completion_tokens
class-attribute
instance-attribute
¶
max_tokens
class-attribute
instance-attribute
¶
max_tokens: Optional[int] = Field(
default=None,
deprecated="max_tokens is deprecated in favor of the max_completion_tokens field",
)
mm_processor_kwargs
class-attribute
instance-attribute
¶
mm_processor_kwargs: Optional[dict[str, Any]] = Field(
default=None,
description="Additional kwargs to pass to the HF processor.",
)
parallel_tool_calls
class-attribute
instance-attribute
¶
priority
class-attribute
instance-attribute
¶
priority: int = Field(
default=0,
description="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
class-attribute
instance-attribute
¶
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.",
)
response_format
class-attribute
instance-attribute
¶
response_format: Optional[AnyResponseFormat] = None
return_tokens_as_token_ids
class-attribute
instance-attribute
¶
return_tokens_as_token_ids: Optional[bool] = Field(
default=None,
description="If specified with 'logprobs', tokens are represented as strings of the form 'token_id:{token_id}' so that tokens that are not JSON-encodable can be identified.",
)
spaces_between_special_tokens
class-attribute
instance-attribute
¶
spaces_between_special_tokens: bool = True
structural_tag
class-attribute
instance-attribute
¶
structural_tag: Optional[str] = Field(
default=None,
description="If specified, the output will follow the structural tag schema.",
)
tool_choice
class-attribute
instance-attribute
¶
tool_choice: Optional[
Union[
Literal["none"],
Literal["auto"],
Literal["required"],
ChatCompletionNamedToolChoiceParam,
]
] = "none"
truncate_prompt_tokens
class-attribute
instance-attribute
¶
vllm_xargs
class-attribute
instance-attribute
¶
vllm_xargs: Optional[dict[str, Union[str, int, float]]] = (
Field(
default=None,
description="Additional request parameters with string or numeric values, used by custom extensions.",
)
)
_get_guided_json_from_tool
¶
Source code in vllm/entrypoints/openai/protocol.py
check_cache_salt_support
classmethod
¶
Source code in vllm/entrypoints/openai/protocol.py
check_generation_prompt
classmethod
¶
Source code in vllm/entrypoints/openai/protocol.py
check_guided_decoding_count
classmethod
¶
Source code in vllm/entrypoints/openai/protocol.py
check_logprobs
classmethod
¶
Source code in vllm/entrypoints/openai/protocol.py
check_tool_usage
classmethod
¶
Source code in vllm/entrypoints/openai/protocol.py
to_beam_search_params
¶
to_beam_search_params(
max_tokens: int, default_sampling_params: dict
) -> BeamSearchParams
Source code in vllm/entrypoints/openai/protocol.py
to_sampling_params
¶
to_sampling_params(
max_tokens: int,
logits_processor_pattern: Optional[str],
default_sampling_params: dict,
) -> SamplingParams
Source code in vllm/entrypoints/openai/protocol.py
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 |
|
validate_stream_options
classmethod
¶
Source code in vllm/entrypoints/openai/protocol.py
ChatCompletionResponse
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
created
class-attribute
instance-attribute
¶
id
class-attribute
instance-attribute
¶
id: str = Field(
default_factory=lambda: f"chatcmpl-{random_uuid()}"
)
kv_transfer_params
class-attribute
instance-attribute
¶
kv_transfer_params: Optional[dict[str, Any]] = Field(
default=None, description="KVTransfer parameters."
)
prompt_logprobs
class-attribute
instance-attribute
¶
ChatCompletionResponseChoice
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
ChatCompletionResponseStreamChoice
¶
ChatCompletionStreamResponse
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
ChatCompletionToolsParam
¶
ChatMessage
¶
ClassificationData
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
ClassificationRequest
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
priority
class-attribute
instance-attribute
¶
priority: int = Field(
default=0,
description="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.",
)
truncate_prompt_tokens
class-attribute
instance-attribute
¶
ClassificationResponse
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
created
class-attribute
instance-attribute
¶
id
class-attribute
instance-attribute
¶
id: str = Field(
default_factory=lambda: f"classify-{random_uuid()}"
)
CompletionLogProbs
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
CompletionRequest
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 |
|
_DEFAULT_SAMPLING_PARAMS
class-attribute
instance-attribute
¶
_DEFAULT_SAMPLING_PARAMS: dict = {
"repetition_penalty": 1.0,
"temperature": 1.0,
"top_p": 1.0,
"top_k": 0,
"min_p": 0.0,
}
add_special_tokens
class-attribute
instance-attribute
¶
add_special_tokens: bool = Field(
default=True,
description="If true (the default), special tokens (e.g. BOS) will be added to the prompt.",
)
allowed_token_ids
class-attribute
instance-attribute
¶
guided_choice
class-attribute
instance-attribute
¶
guided_choice: Optional[list[str]] = Field(
default=None,
description="If specified, the output will be exactly one of the choices.",
)
guided_decoding_backend
class-attribute
instance-attribute
¶
guided_decoding_backend: Optional[str] = Field(
default=None,
description="If specified, will override the default guided decoding backend of the server for this specific request. If set, must be one of 'outlines' / 'lm-format-enforcer'",
)
guided_grammar
class-attribute
instance-attribute
¶
guided_grammar: Optional[str] = Field(
default=None,
description="If specified, the output will follow the context free grammar.",
)
guided_json
class-attribute
instance-attribute
¶
guided_json: Optional[Union[str, dict, BaseModel]] = Field(
default=None,
description="If specified, the output will follow the JSON schema.",
)
guided_regex
class-attribute
instance-attribute
¶
guided_regex: Optional[str] = Field(
default=None,
description="If specified, the output will follow the regex pattern.",
)
guided_whitespace_pattern
class-attribute
instance-attribute
¶
guided_whitespace_pattern: Optional[str] = Field(
default=None,
description="If specified, will override the default whitespace pattern for guided json decoding.",
)
include_stop_str_in_output
class-attribute
instance-attribute
¶
include_stop_str_in_output: bool = False
kv_transfer_params
class-attribute
instance-attribute
¶
kv_transfer_params: Optional[dict[str, Any]] = Field(
default=None,
description="KVTransfer parameters used for disaggregated serving.",
)
logits_processors
class-attribute
instance-attribute
¶
logits_processors: Optional[LogitsProcessors] = Field(
default=None,
description="A list of either qualified names of logits processors, or constructor objects, to apply when sampling. A constructor is a JSON object with a required 'qualname' field specifying the qualified name of the processor class/factory, and optional 'args' and 'kwargs' fields containing positional and keyword arguments. For example: {'qualname': 'my_module.MyLogitsProcessor', 'args': [1, 2], 'kwargs': {'param': 'value'}}.",
)
priority
class-attribute
instance-attribute
¶
priority: int = Field(
default=0,
description="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.",
)
prompt
class-attribute
instance-attribute
¶
prompt_embeds
class-attribute
instance-attribute
¶
response_format
class-attribute
instance-attribute
¶
response_format: Optional[AnyResponseFormat] = Field(
default=None,
description="Similar to chat completion, this parameter specifies the format of output. Only {'type': 'json_object'}, {'type': 'json_schema'}, {'type': 'structural_tag'}, or {'type': 'text' } is supported.",
)
return_tokens_as_token_ids
class-attribute
instance-attribute
¶
return_tokens_as_token_ids: Optional[bool] = Field(
default=None,
description="If specified with 'logprobs', tokens are represented as strings of the form 'token_id:{token_id}' so that tokens that are not JSON-encodable can be identified.",
)
spaces_between_special_tokens
class-attribute
instance-attribute
¶
spaces_between_special_tokens: bool = True
truncate_prompt_tokens
class-attribute
instance-attribute
¶
vllm_xargs
class-attribute
instance-attribute
¶
vllm_xargs: Optional[dict[str, Union[str, int, float]]] = (
Field(
default=None,
description="Additional request parameters with string or numeric values, used by custom extensions.",
)
)
check_guided_decoding_count
classmethod
¶
Source code in vllm/entrypoints/openai/protocol.py
check_logprobs
classmethod
¶
Source code in vllm/entrypoints/openai/protocol.py
to_beam_search_params
¶
to_beam_search_params(
max_tokens: int,
default_sampling_params: Optional[dict] = None,
) -> BeamSearchParams
Source code in vllm/entrypoints/openai/protocol.py
to_sampling_params
¶
to_sampling_params(
max_tokens: int,
logits_processor_pattern: Optional[str],
default_sampling_params: Optional[dict] = None,
) -> SamplingParams
Source code in vllm/entrypoints/openai/protocol.py
897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 |
|
validate_prompt_and_prompt_embeds
classmethod
¶
Source code in vllm/entrypoints/openai/protocol.py
validate_stream_options
classmethod
¶
Source code in vllm/entrypoints/openai/protocol.py
CompletionResponse
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
created
class-attribute
instance-attribute
¶
id
class-attribute
instance-attribute
¶
id: str = Field(
default_factory=lambda: f"cmpl-{random_uuid()}"
)
CompletionResponseChoice
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
prompt_logprobs
class-attribute
instance-attribute
¶
CompletionResponseStreamChoice
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
CompletionStreamResponse
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
created
class-attribute
instance-attribute
¶
id
class-attribute
instance-attribute
¶
id: str = Field(
default_factory=lambda: f"cmpl-{random_uuid()}"
)
DeltaFunctionCall
¶
Bases: BaseModel
Source code in vllm/entrypoints/openai/protocol.py
DeltaMessage
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
tool_calls
class-attribute
instance-attribute
¶
tool_calls: list[DeltaToolCall] = Field(
default_factory=list
)
DeltaToolCall
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
DetokenizeRequest
¶
DetokenizeResponse
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
EmbeddingChatRequest
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 |
|
add_special_tokens
class-attribute
instance-attribute
¶
add_special_tokens: bool = Field(
default=False,
description="If true, special tokens (e.g. BOS) will be added to the prompt on top of what is added by the chat template. For most models, the chat template takes care of adding the special tokens so this should be set to false (as is the default).",
)
chat_template
class-attribute
instance-attribute
¶
chat_template: Optional[str] = Field(
default=None,
description="A Jinja template to use for this conversion. As of transformers v4.44, default chat template is no longer allowed, so you must provide a chat template if the tokenizer does not define one.",
)
chat_template_kwargs
class-attribute
instance-attribute
¶
chat_template_kwargs: Optional[dict[str, Any]] = Field(
default=None,
description="Additional keyword args to pass to the template renderer. Will be accessible by the chat template.",
)
encoding_format
class-attribute
instance-attribute
¶
encoding_format: Literal['float', 'base64'] = 'float'
mm_processor_kwargs
class-attribute
instance-attribute
¶
mm_processor_kwargs: Optional[dict[str, Any]] = Field(
default=None,
description="Additional kwargs to pass to the HF processor.",
)
priority
class-attribute
instance-attribute
¶
priority: int = Field(
default=0,
description="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.",
)
truncate_prompt_tokens
class-attribute
instance-attribute
¶
check_generation_prompt
classmethod
¶
Source code in vllm/entrypoints/openai/protocol.py
EmbeddingCompletionRequest
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
add_special_tokens
class-attribute
instance-attribute
¶
add_special_tokens: bool = Field(
default=True,
description="If true (the default), special tokens (e.g. BOS) will be added to the prompt.",
)
encoding_format
class-attribute
instance-attribute
¶
encoding_format: Literal['float', 'base64'] = 'float'
priority
class-attribute
instance-attribute
¶
priority: int = Field(
default=0,
description="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.",
)
truncate_prompt_tokens
class-attribute
instance-attribute
¶
EmbeddingResponse
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
created
class-attribute
instance-attribute
¶
id
class-attribute
instance-attribute
¶
id: str = Field(
default_factory=lambda: f"embd-{random_uuid()}"
)
EmbeddingResponseData
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
ErrorResponse
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
ExtractedToolCallInformation
¶
Bases: BaseModel
Source code in vllm/entrypoints/openai/protocol.py
FunctionCall
¶
FunctionDefinition
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
JsonSchemaResponseFormat
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
json_schema
class-attribute
instance-attribute
¶
LoadLoRAAdapterRequest
¶
LogitsProcessorConstructor
¶
Bases: BaseModel
Source code in vllm/entrypoints/openai/protocol.py
ModelCard
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
created
class-attribute
instance-attribute
¶
permission
class-attribute
instance-attribute
¶
permission: list[ModelPermission] = Field(
default_factory=list
)
ModelList
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
ModelPermission
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
created
class-attribute
instance-attribute
¶
id
class-attribute
instance-attribute
¶
id: str = Field(
default_factory=lambda: f"modelperm-{random_uuid()}"
)
OpenAIBaseModel
¶
Bases: BaseModel
Source code in vllm/entrypoints/openai/protocol.py
__log_extra_fields__
classmethod
¶
Source code in vllm/entrypoints/openai/protocol.py
PoolingResponse
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
created
class-attribute
instance-attribute
¶
id
class-attribute
instance-attribute
¶
id: str = Field(
default_factory=lambda: f"pool-{random_uuid()}"
)
PoolingResponseData
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
PromptTokenUsageInfo
¶
RequestResponseMetadata
¶
Bases: BaseModel
Source code in vllm/entrypoints/openai/protocol.py
RerankDocument
¶
RerankRequest
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
priority
class-attribute
instance-attribute
¶
priority: int = Field(
default=0,
description="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.",
)
truncate_prompt_tokens
class-attribute
instance-attribute
¶
RerankResponse
¶
RerankResult
¶
Bases: BaseModel
Source code in vllm/entrypoints/openai/protocol.py
RerankUsage
¶
ResponseFormat
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
json_schema
class-attribute
instance-attribute
¶
json_schema: Optional[JsonSchemaResponseFormat] = None
ScoreRequest
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
priority
class-attribute
instance-attribute
¶
priority: int = Field(
default=0,
description="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.",
)
truncate_prompt_tokens
class-attribute
instance-attribute
¶
ScoreResponse
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
created
class-attribute
instance-attribute
¶
id
class-attribute
instance-attribute
¶
id: str = Field(
default_factory=lambda: f"embd-{random_uuid()}"
)
ScoreResponseData
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
StreamOptions
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
StructuralTag
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
StructuralTagResponseFormat
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
TokenizeChatRequest
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 |
|
add_generation_prompt
class-attribute
instance-attribute
¶
add_generation_prompt: bool = Field(
default=True,
description="If true, the generation prompt will be added to the chat template. This is a parameter used by chat template in tokenizer config of the model.",
)
add_special_tokens
class-attribute
instance-attribute
¶
add_special_tokens: bool = Field(
default=False,
description="If true, special tokens (e.g. BOS) will be added to the prompt on top of what is added by the chat template. For most models, the chat template takes care of adding the special tokens so this should be set to false (as is the default).",
)
chat_template
class-attribute
instance-attribute
¶
chat_template: Optional[str] = Field(
default=None,
description="A Jinja template to use for this conversion. As of transformers v4.44, default chat template is no longer allowed, so you must provide a chat template if the tokenizer does not define one.",
)
chat_template_kwargs
class-attribute
instance-attribute
¶
chat_template_kwargs: Optional[dict[str, Any]] = Field(
default=None,
description="Additional keyword args to pass to the template renderer. Will be accessible by the chat template.",
)
continue_final_message
class-attribute
instance-attribute
¶
continue_final_message: bool = Field(
default=False,
description='If this is set, the chat will be formatted so that the final message in the chat is open-ended, without any EOS tokens. The model will continue this message rather than starting a new one. This allows you to "prefill" part of the model\'s response for it. Cannot be used at the same time as `add_generation_prompt`.',
)
mm_processor_kwargs
class-attribute
instance-attribute
¶
mm_processor_kwargs: Optional[dict[str, Any]] = Field(
default=None,
description="Additional kwargs to pass to the HF processor.",
)
return_token_strs
class-attribute
instance-attribute
¶
return_token_strs: Optional[bool] = Field(
default=False,
description="If true, also return the token strings corresponding to the token ids.",
)
tools
class-attribute
instance-attribute
¶
tools: Optional[list[ChatCompletionToolsParam]] = Field(
default=None,
description="A list of tools the model may call.",
)
check_generation_prompt
classmethod
¶
Source code in vllm/entrypoints/openai/protocol.py
TokenizeCompletionRequest
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
TokenizeResponse
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
ToolCall
¶
TranscriptionRequest
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 |
|
_DEFAULT_SAMPLING_PARAMS
class-attribute
instance-attribute
¶
_DEFAULT_SAMPLING_PARAMS: dict = {
"repetition_penalty": 1.0,
"temperature": 1.0,
"top_p": 1.0,
"top_k": 0,
"min_p": 0.0,
}
file
instance-attribute
¶
The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
frequency_penalty
class-attribute
instance-attribute
¶
The frequency penalty to use for sampling.
language
class-attribute
instance-attribute
¶
The language of the input audio.
Supplying the input language in ISO-639-1 format will improve accuracy and latency.
min_p
class-attribute
instance-attribute
¶
Filters out tokens with a probability lower than min_p
, ensuring a
minimum likelihood threshold during sampling.
presence_penalty
class-attribute
instance-attribute
¶
The presence penalty to use for sampling.
prompt
class-attribute
instance-attribute
¶
prompt: str = Field(default='')
An optional text to guide the model's style or continue a previous audio segment.
The prompt should match the audio language.
repetition_penalty
class-attribute
instance-attribute
¶
The repetition penalty to use for sampling.
response_format
class-attribute
instance-attribute
¶
response_format: AudioResponseFormat = Field(default="json")
The format of the output, in one of these options: json
, text
, srt
,
verbose_json
, or vtt
.
seed
class-attribute
instance-attribute
¶
The seed to use for sampling.
stream
class-attribute
instance-attribute
¶
When set, it will enable output to be streamed in a similar fashion as the Chat Completion endpoint.
stream_continuous_usage_stats
class-attribute
instance-attribute
¶
stream_include_usage
class-attribute
instance-attribute
¶
temperature
class-attribute
instance-attribute
¶
temperature: float = Field(default=0.0)
The sampling temperature, between 0 and 1.
Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused / deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
timestamp_granularities
class-attribute
instance-attribute
¶
timestamp_granularities: list[
Literal["word", "segment"]
] = Field(alias="timestamp_granularities[]", default=[])
The timestamp granularities to populate for this transcription.
response_format
must be set verbose_json
to use timestamp granularities.
Either or both of these options are supported: word
, or segment
. Note:
There is no additional latency for segment timestamps, but generating word
timestamps incurs additional latency.
top_k
class-attribute
instance-attribute
¶
Limits sampling to the k
most probable tokens at each step.
top_p
class-attribute
instance-attribute
¶
Enables nucleus (top-p) sampling, where tokens are selected from the
smallest possible set whose cumulative probability exceeds p
.
vllm_xargs
class-attribute
instance-attribute
¶
vllm_xargs: Optional[dict[str, Union[str, int, float]]] = (
Field(
default=None,
description="Additional request parameters with string or numeric values, used by custom extensions.",
)
)
to_sampling_params
¶
to_sampling_params(
default_max_tokens: int,
default_sampling_params: Optional[dict] = None,
) -> SamplingParams
Source code in vllm/entrypoints/openai/protocol.py
validate_transcription_request
classmethod
¶
Source code in vllm/entrypoints/openai/protocol.py
TranscriptionResponse
¶
TranscriptionResponseStreamChoice
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
TranscriptionResponseVerbose
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
segments
class-attribute
instance-attribute
¶
segments: Optional[list[TranscriptionSegment]] = None
Segments of the transcribed text and their corresponding details.
words
class-attribute
instance-attribute
¶
words: Optional[list[TranscriptionWord]] = None
Extracted words and their corresponding timestamps.
TranscriptionSegment
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
avg_logprob
instance-attribute
¶
avg_logprob: float
Average logprob of the segment.
If the value is lower than -1, consider the logprobs failed.
compression_ratio
instance-attribute
¶
compression_ratio: float
Compression ratio of the segment.
If the value is greater than 2.4, consider the compression failed.
no_speech_prob
instance-attribute
¶
no_speech_prob: float
Probability of no speech in the segment.
If the value is higher than 1.0 and the avg_logprob
is below -1, consider
this segment silent.
TranscriptionStreamResponse
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
TranscriptionWord
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
TranslationRequest
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 |
|
_DEFAULT_SAMPLING_PARAMS
class-attribute
instance-attribute
¶
_DEFAULT_SAMPLING_PARAMS: dict = {'temperature': 0}
file
instance-attribute
¶
The audio file object (not file name) to translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
language
class-attribute
instance-attribute
¶
The language of the input audio we translate from.
Supplying the input language in ISO-639-1 format will improve accuracy.
prompt
class-attribute
instance-attribute
¶
prompt: str = Field(default='')
An optional text to guide the model's style or continue a previous audio segment.
The prompt should match the audio language.
response_format
class-attribute
instance-attribute
¶
response_format: AudioResponseFormat = Field(default="json")
The format of the output, in one of these options: json
, text
, srt
,
verbose_json
, or vtt
.
stream
class-attribute
instance-attribute
¶
Custom field not present in the original OpenAI definition. When set, it will enable output to be streamed in a similar fashion as the Chat Completion endpoint.
stream_continuous_usage_stats
class-attribute
instance-attribute
¶
stream_include_usage
class-attribute
instance-attribute
¶
temperature
class-attribute
instance-attribute
¶
temperature: float = Field(default=0.0)
The sampling temperature, between 0 and 1.
Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused / deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
to_sampling_params
¶
to_sampling_params(
default_max_tokens: int,
default_sampling_params: Optional[dict] = None,
) -> SamplingParams
Source code in vllm/entrypoints/openai/protocol.py
validate_stream_options
classmethod
¶
Source code in vllm/entrypoints/openai/protocol.py
TranslationResponse
¶
TranslationResponseStreamChoice
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
TranslationResponseVerbose
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
segments
class-attribute
instance-attribute
¶
segments: Optional[list[TranslationSegment]] = None
Segments of the translated text and their corresponding details.
words
class-attribute
instance-attribute
¶
words: Optional[list[TranslationWord]] = None
Extracted words and their corresponding timestamps.
TranslationSegment
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
avg_logprob
instance-attribute
¶
avg_logprob: float
Average logprob of the segment.
If the value is lower than -1, consider the logprobs failed.
compression_ratio
instance-attribute
¶
compression_ratio: float
Compression ratio of the segment.
If the value is greater than 2.4, consider the compression failed.
no_speech_prob
instance-attribute
¶
no_speech_prob: float
Probability of no speech in the segment.
If the value is higher than 1.0 and the avg_logprob
is below -1, consider
this segment silent.
TranslationStreamResponse
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
TranslationWord
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
UnloadLoRAAdapterRequest
¶
Bases: BaseModel
Source code in vllm/entrypoints/openai/protocol.py
UsageInfo
¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
prompt_tokens_details
class-attribute
instance-attribute
¶
prompt_tokens_details: Optional[PromptTokenUsageInfo] = None
get_logits_processors
¶
get_logits_processors(
processors: Optional[LogitsProcessors],
pattern: Optional[str],
) -> Optional[list[Any]]