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
]
ResponseInputOutputItem module-attribute
¶
ResponseInputOutputItem: TypeAlias = Union[
ResponseInputItemParam,
ResponseReasoningItem,
ResponseFunctionToolCall,
]
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
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 739 740 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 |
|
_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.",
)
reasoning_effort class-attribute
instance-attribute
¶
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_token_ids class-attribute
instance-attribute
¶
return_token_ids: Optional[bool] = Field(
default=None,
description="If specified, the result will include token IDs alongside the generated text. In streaming mode, prompt_token_ids is included only in the first chunk, and token_ids contains the delta tokens for each chunk. This is useful for debugging or when you need to map generated text back to input tokens.",
)
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
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 |
|
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
¶
service_tier class-attribute
instance-attribute
¶
ChatCompletionResponseChoice ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
ChatCompletionResponseStreamChoice ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
ChatCompletionStreamResponse ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
ChatCompletionToolsParam ¶
ChatMessage ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
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
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 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 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 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 |
|
_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
¶
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.",
)
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
¶
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] = 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_token_ids class-attribute
instance-attribute
¶
return_token_ids: Optional[bool] = Field(
default=None,
description="If specified, the result will include token IDs alongside the generated text. In streaming mode, prompt_token_ids is included only in the first chunk, and token_ids contains the delta tokens for each chunk. This is useful for debugging or when you need to map generated text back to input tokens.",
)
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_cache_salt_support 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
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
1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 |
|
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()}"
)
kv_transfer_params class-attribute
instance-attribute
¶
kv_transfer_params: Optional[dict[str, Any]] = Field(
default=None, description="KVTransfer parameters."
)
service_tier class-attribute
instance-attribute
¶
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
1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 |
|
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.",
)
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.",
)
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.",
)
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.",
)
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
ErrorInfo ¶
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
InputTokensDetails ¶
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
OutputTokensDetails ¶
Bases: OpenAIBaseModel
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 ¶
Bases: BaseModel
Source code in vllm/entrypoints/openai/protocol.py
RerankRequest ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
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
¶
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
ResponseUsage ¶
ResponsesRequest ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
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 |
|
_DEFAULT_SAMPLING_PARAMS 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.",
)
include class-attribute
instance-attribute
¶
include: Optional[
list[
Literal[
"code_interpreter_call.outputs",
"computer_call_output.output.image_url",
"file_search_call.results",
"message.input_image.image_url",
"message.output_text.logprobs",
"reasoning.encrypted_content",
],
]
] = None
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.",
)
previous_response_id 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"resp_{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.",
)
service_tier class-attribute
instance-attribute
¶
service_tier: Literal[
"auto", "default", "flex", "scale", "priority"
] = "auto"
truncation class-attribute
instance-attribute
¶
check_cache_salt_support ¶
Source code in vllm/entrypoints/openai/protocol.py
is_include_output_logprobs ¶
is_include_output_logprobs() -> bool
Check if the request includes output logprobs.
Source code in vllm/entrypoints/openai/protocol.py
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_background ¶
Source code in vllm/entrypoints/openai/protocol.py
ResponsesResponse ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
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 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 |
|
created_at class-attribute
instance-attribute
¶
id class-attribute
instance-attribute
¶
id: str = Field(
default_factory=lambda: f"resp_{random_uuid()}"
)
previous_response_id class-attribute
instance-attribute
¶
service_tier instance-attribute
¶
service_tier: Literal[
"auto", "default", "flex", "scale", "priority"
]
from_request classmethod
¶
from_request(
request: ResponsesRequest,
sampling_params: SamplingParams,
model_name: str,
created_time: int,
output: list[ResponseOutputItem],
status: ResponseStatus,
usage: Optional[ResponseUsage] = None,
) -> ResponsesResponse
Source code in vllm/entrypoints/openai/protocol.py
ScoreRequest ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
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
¶
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
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 |
|
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
TokenizerInfoResponse ¶
Bases: OpenAIBaseModel
Response containing tokenizer configuration equivalent to tokenizer_config.json
Source code in vllm/entrypoints/openai/protocol.py
ToolCall ¶
TranscriptionRequest ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/protocol.py
2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 |
|
_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
TranscriptionUsageAudio ¶
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
2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 |
|
_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]]