Skip to content

vllm.entrypoints.scale_out.derender.serving

Classes:

ServingDerender

Bases: BaseServing

Methods:

_validate_derender_bounds(generate_responses)

Reject derender payloads that exceed resource bounds.

Runs before any tokenizer.decode() or parser invocation to prevent CPU/memory exhaustion from oversized caller-supplied token structures.

_validate_prompt_token_ids(prompt_token_ids)

Reject caller-supplied prompt_token_ids longer than max_model_len.

derender_chat_response(request) async

Postprocess a GenerateResponse into a ChatCompletionResponse.

Non-streaming only: expects the complete GenerateResponse with all token IDs present. Uses parser.parse() for one-shot extraction.

When request.chat_request is provided, the parser splits the output into (reasoning, content, tool_calls). Otherwise falls back to plain detokenization.

derender_chat_stream_response(request) async

Streaming counterpart to derender_chat_response.

Processes one GenerateStreamResponse chunk and returns the derendered chunk together with the updated client carried state.

derender_completion_response(request) async

Postprocess a list of GenerateResponses into a CompletionResponse.

Non-streaming only. Mirrors the multi-prompt completions case: one GenerateResponse per prompt, parallel to the list[GenerateRequest] from /v1/completions/render.

derender_completion_stream_response(request) async

Streaming counterpart to derender_completion_response.

Processes one GenerateStreamResponse chunk (one output sequence's delta) and returns the derendered chunk and updated state.