Repository navigation
[Bugfix][Frontend] Honor --enable-log-outputs on /v1/completions - #62205
Merged
DarkLight1337 merged 4 commits intoOct 19, 2026
Merged
Conversation
--enable-log-outputs is server-wide, but /v1/completions never logged generated text: OpenAIServingCompletion did not accept the flag, and init_generate_state did not pass it. Chat, Responses, Anthropic, Cohere and /inference/v1/generate all log outputs. Log completion outputs the way chat does: one line per output for non-streaming requests; for streaming requests, one line per delta (unless --enable-log-deltas is off) and the full text once the stream ends. Lines use the same per-prompt request id as the input log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: surajm20061998 <surajm20061998@gmail.com>
surajm20061998
requested review from
DarkLight1337 and
chaunceyjiang
as code owners
October 17, 2026 16:47
Signed-off-by: surajm20061998 <surajm20061998@gmail.com>
Signed-off-by: surajm20061998 <surajm20061998@gmail.com>
Member
|
@claude review |
DarkLight1337
enabled auto-merge (squash)
October 19, 2026 01:11
Member
|
/ci run |
|
✅ Triggered Buildkite CI #95761 for commit |
Contributor
Author
|
/ci retry |
|
✅ Queued 1 failed job(s) for retry in Buildkite CI #95761. |
Contributor
Author
|
The I don't think it's related to this PR:
Happy to retry again or rebase if you'd prefer. @DarkLight1337, let me know what works best for merging. |
Member
|
Retrying |
6 tasks done
bantianyue
pushed a commit
to bantianyue/vllm
that referenced
this pull request
Oct 28, 2026
…m-project#62205) Signed-off-by: surajm20061998 <surajm20061998@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
--enable-log-outputsis silently ignored by/v1/completions. The handler never accepted the flag or logged generated text, while chat, Responses, Anthropic (#60982), Cohere (#61089) and/inference/v1/generateall do. This adds output logging to completions, mirroring chat.Claims
--enable-log-requests --enable-log-outputs,/v1/completionslogs generated text: one line per output when not streaming; when streaming, one line per delta (respects--enable-log-deltas) plus the full text when the stream ends.cmpl-<id>-<i>), so the two can be correlated.Validation
End-to-end,
vllm serve Qwen/Qwen2.5-0.5B-Instruct --enable-log-requests --enable-log-outputs(CPU backend). For each request, the counts ofReceived request/Generated responselog lines:main/v1/completions, non-streaming/v1/completions, streaming, 8 tokens/v1/chat/completions(control)Log lines with this PR
Tests:
test_completion_logs_outputs_when_enabled[stream=False|True]drivescreate_completionwith a mock engine and checks the logged text, token ids, finish reason, delta/complete lines, and that every line uses the input log's request id.Regression:
pytest tests/entrypoints/openai/completion/{test_completion_error,test_completion_text_offset,test_lora_resolvers}.py tests/entrypoints/openai/chat_completion/test_serving_chat.py tests/entrypoints/serve/utils:main279 passed, this PR 281 passed. Both have the same 19 environment-only failures (GPT-OSS/Harmony tokenizers unavailable offline).pre-commitruff and mypy are clean.Validated on macOS (Apple Silicon, CPU backend), Python 3.12, torch 2.14.0, rebased on
main@e744eacf6. No model evaluation: logging only.Details
The original
--enable-log-outputsPR (#20707) implemented logging for chat and Responses only. Later endpoints that inherit from the chat handler only needed the flag forwarded (#60982, #61089). Completions has its own handler, so it needs the logging itself:OpenAIServingCompletiontakesenable_log_outputs/enable_log_deltas, andinit_generate_statepasses them, as for chat.finish_reason="streaming_complete"as chat does.echo=true);log_inputsalready logs the prompt.The batch chat endpoint and speech-to-text have the same gap. I'll follow up separately to keep this one small.
Duplicate check: searched issues/PRs for
enable-log-outputs,enable_log_outputs, and log outputs + completions, and inspected every open PR touchingvllm/entrypoints/openai/completion/serving.pyandvllm/entrypoints/generate/api_router.py. #45634 adds request arrival/completion lifecycle logs, a different feature. #40155 is about prompt log levels. None add output logging to completions.AI assistance: Claude (Anthropic) helped find, reproduce and write this change. I reviewed every changed line and ran the tests and the end-to-end check above myself.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.