vllm.entrypoints.serve.tokenize.protocol ¶
TokenizeRequest module-attribute ¶
TokenizeRequest: TypeAlias = (
TokenizeCompletionRequest | TokenizeChatRequest
)
DetokenizeRequest ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/serve/tokenize/protocol.py
build_tok_params ¶
build_tok_params(
model_config: ModelConfig,
) -> TokenizeParams
DetokenizeResponse ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/serve/tokenize/protocol.py
TokenizeChatRequest ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/serve/tokenize/protocol.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
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: 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`.',
)
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.",
)
return_token_strs class-attribute instance-attribute ¶
return_token_strs: bool | None = Field(
default=False,
description="If true, also return the token strings corresponding to the token ids.",
)
tools class-attribute instance-attribute ¶
tools: list[ChatCompletionToolsParam] | None = Field(
default=None,
description="A list of tools the model may call.",
)
build_chat_params ¶
build_chat_params(
default_template: str | None,
default_template_content_format: ChatTemplateContentFormatOption,
) -> ChatParams
Source code in vllm/entrypoints/serve/tokenize/protocol.py
build_tok_params ¶
build_tok_params(
model_config: ModelConfig,
) -> TokenizeParams
check_generation_prompt classmethod ¶
Source code in vllm/entrypoints/serve/tokenize/protocol.py
TokenizeCompletionRequest ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/serve/tokenize/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.",
)
return_token_strs class-attribute instance-attribute ¶
return_token_strs: bool | None = Field(
default=False,
description="If true, also return the token strings corresponding to the token ids.",
)
build_tok_params ¶
build_tok_params(
model_config: ModelConfig,
) -> TokenizeParams
TokenizeResponse ¶
Bases: OpenAIBaseModel
Source code in vllm/entrypoints/serve/tokenize/protocol.py
TokenizerInfoResponse ¶
Bases: OpenAIBaseModel
Response containing tokenizer configuration equivalent to tokenizer_config.json