vllm.entrypoints.openai.chat_completion.protocol ¶
ChatCompletionLogProb ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/chat_completion/protocol.py
ChatCompletionLogProbs ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/chat_completion/protocol.py
content class-attribute instance-attribute ¶
content: list[ChatCompletionLogProbsContent] | None = None
ChatCompletionLogProbsContent ¶
Bases: ChatCompletionLogProb
Source code in vllm/entrypoints/openai/chat_completion/protocol.py
ChatCompletionNamedFunction ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/chat_completion/protocol.py
ChatCompletionNamedToolChoiceParam ¶
ChatCompletionRequest ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/chat_completion/protocol.py
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 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 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 | |
_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).",
)
cache_salt class-attribute instance-attribute ¶
cache_salt: str | None = 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).",
)
chat_template class-attribute instance-attribute ¶
chat_template: str | None = 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: dict[str, Any] | None = 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: list[dict[str, str]] | None = 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.",
)
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: dict[str, Any] | None = Field(
default=None,
description="KVTransfer parameters used for disaggregated serving.",
)
logits_processors class-attribute instance-attribute ¶
logits_processors: LogitsProcessors | None = 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_tokens class-attribute instance-attribute ¶
max_tokens: int | None = 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: dict[str, Any] | None = 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.",
)
reasoning_effort class-attribute instance-attribute ¶
reasoning_effort: (
Literal["low", "medium", "high"] | None
) = None
request_id class-attribute instance-attribute ¶
request_id: str = Field(
default_factory=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: AnyResponseFormat | None = None
return_token_ids class-attribute instance-attribute ¶
return_token_ids: bool | None = 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: bool | None = 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
structured_outputs class-attribute instance-attribute ¶
structured_outputs: StructuredOutputsParams | None = Field(
default=None,
description="Additional kwargs for structured outputs",
)
tool_choice class-attribute instance-attribute ¶
tool_choice: (
Literal["none"]
| Literal["auto"]
| Literal["required"]
| ChatCompletionNamedToolChoiceParam
| None
) = "none"
truncate_prompt_tokens class-attribute instance-attribute ¶
vllm_xargs class-attribute instance-attribute ¶
vllm_xargs: (
dict[str, str | int | float | list[str | int | float]]
| None
) = Field(
default=None,
description="Additional request parameters with (list of) string or numeric values, used by custom extensions.",
)
check_cache_salt_support classmethod ¶
Source code in vllm/entrypoints/openai/chat_completion/protocol.py
check_generation_prompt classmethod ¶
Source code in vllm/entrypoints/openai/chat_completion/protocol.py
check_logprobs classmethod ¶
Source code in vllm/entrypoints/openai/chat_completion/protocol.py
check_structured_outputs_count classmethod ¶
Source code in vllm/entrypoints/openai/chat_completion/protocol.py
check_tool_usage classmethod ¶
Source code in vllm/entrypoints/openai/chat_completion/protocol.py
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 | |
to_beam_search_params ¶
to_beam_search_params(
max_tokens: int, default_sampling_params: dict
) -> BeamSearchParams
Source code in vllm/entrypoints/openai/chat_completion/protocol.py
to_sampling_params ¶
to_sampling_params(
max_tokens: int,
logits_processor_pattern: str | None,
default_sampling_params: dict,
) -> SamplingParams
Source code in vllm/entrypoints/openai/chat_completion/protocol.py
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 | |
validate_stream_options classmethod ¶
Source code in vllm/entrypoints/openai/chat_completion/protocol.py
ChatCompletionResponse ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/chat_completion/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: dict[str, Any] | None = Field(
default=None, description="KVTransfer parameters."
)
prompt_logprobs class-attribute instance-attribute ¶
ChatCompletionResponseChoice ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/chat_completion/protocol.py
ChatCompletionResponseStreamChoice ¶
ChatCompletionStreamResponse ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/openai/chat_completion/protocol.py
ChatCompletionToolsParam ¶
ChatMessage ¶
Bases: OpenAIBaseModel