Skip to content

vllm.entrypoints.common.offline

Classes:

OfflineInferenceMixin

Offline inference utils.

_adjust_params_for_parsing(params)

Set skip_special_tokens=False when the model encodes structured output syntax as special tokens.

Models like Gemma4 register thinking delimiters (<|channel>/<channel|>) and tool call tokens (<|tool_call>/<tool_call|>/<|"|>) as special tokens. The default skip_special_tokens=True strips them from output.text, breaking parsing of both reasoning blocks and tool calls.

This is a no-op for models whose structured tokens are regular text tokens (e.g. DeepSeek's <think>/</think>).

_preprocess_chat(conversations, chat_template=None, chat_template_content_format='auto', chat_template_kwargs=None, add_generation_prompt=True, continue_final_message=False, tools=None, tokenization_kwargs=None, mm_processor_kwargs=None)

Convert a list of conversations into prompts so that they can then be used as input for other LLM APIs.

Refer to LLM.chat for a complete description of the arguments.

Returns:

_preprocess_cmpl(prompts, tokenization_kwargs=None, mm_processor_kwargs=None)

Convert prompt inputs from LLM APIs (other than LLM.chat) into a format that can be passed to _add_request.

Refer to LLM.generate for a complete description of the arguments.

Returns: