Repository navigation
[Frontend] Add stateless /v1/responses/render endpoint - #4
anurag6569201 wants to merge 1 commit into
Conversation
Source PR: vllm-project#50195 Source head: a1c3cbc
|
| - Render completion requests | ||
| - [Chat Completions Render API](renderer.md) (`/v1/chat/completions/render`) | ||
| - Render chat completions | ||
| - [Responses Render API](renderer.md) (`/v1/responses/render`) |
There was a problem hiding this comment.
Shipwright · HIGH
The render endpoint is stateless and rejects previous_response_id, but render_responses accepts previous_messages and previous_response_outputs as separate optional arguments.
Impact: The render endpoint is stateless and rejects previous_response_id, but render_responses accepts previous_messages and previous_response_outputs as separate optional arguments. The public endpoint always passes None for both, so the inline-history support described in docs is not actually reachable through /v1/responses/render. A caller reading the docs will expect inline history to work, but the endpoint only suppor…
Suggested fix: Review the cited evidence, fix the risk if confirmed, and rerun Shipwright.
| - `/v1/messages/render` - Render Anthropic-compatible messages (available on `vllm serve` only when `VLLM_ENABLE_SCALE_OUT_ENDPOINTS=1`, or on `vllm launch render` unless explicitly disabled) | ||
| - `/v1/messages/count_tokens` - Count tokens for Anthropic messages | ||
| - `/v1/responses` - Create a response | ||
| - `/v1/responses/render` - Render a self-contained response request (available on `vllm serve` only when `VLLM_ENABLE_SCALE_OUT_ENDPOINTS=1`, or on `vllm launch render` unless explicitly disabled) |
There was a problem hiding this comment.
Shipwright · HIGH
The new /v1/responses/render endpoint is documented as requiring Bearer token auth when --api-key is configured, but the diff only updates docs/usage/security.md.
Impact: The new /v1/responses/render endpoint is documented as requiring Bearer token auth when --api-key is configured, but the diff only updates docs/usage/security.md. No code change in vllm/entrypoints/scale_out/render/api_router.py adds an explicit auth dependency. If the scale-out render router is mounted without the same auth middleware as the main /v1 router, this endpoint could be reachable without authentication.…
Suggested fix: Review the cited evidence, fix the risk if confirmed, and rerun Shipwright.
Purpose
Add a stateless
POST /v1/responses/renderendpoint using the same prompt rendering as/v1/responses.A scale-out renderer is vLLM's GPU-less preprocessing service. It applies model-specific formatting, tokenization, multimodal processing, tool metadata, and sampling configuration, then returns a
GenerateRequestfor a separate token-in generation service. This endpoint is useful for llm-d, Dynamo, and custom disaggregated frontends.Ordinary
/v1/responsesserving does not require or call this endpoint. It continues to render in-process and proceed directly to inference.This endpoint follows the scale-out gate merged in vllm-project#54579. On a standard
vllm serve,/v1/responses/renderis registered only whenVLLM_ENABLE_SCALE_OUT_ENDPOINTS=1; the explicitvllm launch renderservice continues to expose it unless scale-out endpoints are explicitly disabled. This PR adds no separately exposed route outside that shared gate.This PR:
OnlineRenderer.render_responses;/v1/responses/renderto the scale-out render service;OpenAIServingResponses;previous_response_idat the stateless boundary;For integrations such as vllm-agentic-api, the gateway authorizes and rehydrates stored response state first. It can then call
/v1/responsesdirectly or use/v1/responses/renderas part of an llm-d-style disaggregated deployment.For multimodal requests, the rendered
GenerateRequestcontains model-processed payloads that can be substantially larger than the source media. Callers must forward that payload unchanged and provision transport/message limits and memory accordingly.Relationship to vllm-project#38084
This implements the same endpoint intent as vllm-project#38084 against the current serving architecture. Unlike the older implementation, it uses the
OnlineRenderer/ServingRendersplit, keeps state out of the renderer, validates request-template trust, and supports Harmony tool metadata in render-only processes.This PR does not claim to supersede vllm-project#38084; it provides a current-main implementation for review.
Testing
pre-commit run mypy-3.12 --all-files --hook-stage manual: passedgit diff --check: passedI also manually smoke-tested request pass-through with llm-d on a Kubernetes deployment running on NVIDIA DGX Spark, using
gpt-oss-20bandQwen/Qwen3-0.6B. This validated request handoff only; it was not a performance, quality, or model evaluation.Broader device-backed coverage will run in CI. Model evaluations were not run because this changes frontend rendering boundaries rather than model execution, weights, kernels, or sampling behavior.
AI assistance
This change was developed with assistance from OpenAI Codex and Claude Code/Fable. The change has undergone automated and adversarial review. The human submitter reviewed every changed line, reran the relevant checks, and confirmed end-to-end understanding.
Source merge-base:
52358e6e192aeae73dd3764046c98fc4b156ea83Source head:
a1c3cbc2a4f0f243cc49453d9c1a4e2adbea71ff