vllm - ✅(Solved) Fix [Bug]: prompt is logged as None in RequestLogItem for gpt-oss-20b (Chat Completion API) [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vllm-project/vllm#37253Fetched 2026-04-08 00:48:33
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1

prompt is logged as None in RequestLogItem for gpt-oss-20b (Chat Completion API)

Root Cause

prompt is logged as None in RequestLogItem for gpt-oss-20b (Chat Completion API)

Fix Action

Fixed

PR fix notes

PR #37254: fix: include prompt text in RequestLogItem for gpt-oss-20b

Description (problem / solution / changelog)

When using gpt-oss-20b with the Chat Completion API, the prompt was logged as None in RequestLogItem because the Harmony parser only produced token IDs without the text representation.

This fix decodes the token IDs back to text using the tokenizer and includes it in the TokensPrompt/TokenInputs, so the prompt text is properly logged for debugging purposes.

Changes:

  • vllm/entrypoints/serve/render/serving.py: Decode tokens and include prompt text in TokensPrompt
  • vllm/entrypoints/openai/responses/serving.py: Same fix for Responses API

Fixes #37253

Changed files

  • vllm/entrypoints/openai/responses/serving.py (modified, +9/-1)
  • vllm/entrypoints/serve/render/serving.py (modified, +9/-1)
RAW_BUFFERClick to expand / collapse

Description

prompt is logged as None in RequestLogItem for gpt-oss-20b (Chat Completion API)

Describe the bug

When using the v1/chat/completions endpoint with the gpt-oss-20b model, the debug logs show prompt: None in the RequestLogItem details. While the prompt_token_ids are correctly populated and the model generates responses successfully, the missing text-based prompt in the logs makes it difficult to verify the applied chat template.

This behavior is inconsistent with other models. For instance, in Gemma-3, the full templated prompt string is clearly visible in the logs.

To Reproduce

  1. Launch the vLLM API server with the gpt-oss-20b model.
  2. Send a request to the /v1/chat/completions endpoint.
  3. Observe the output in the debug logs (set VLLM_LOGGING_LEVEL=DEBUG).

Observed Logs

Case 1: gpt-oss-20b (Issue)

(APIServer pid=7) DEBUG 03-17 10:54:08 [entrypoints/logger.py:53] Request chatcmpl-847d721608ebc2b7 details: prompt: None, prompt_token_ids: [200006, 17360, 200008, ...], prompt_embeds shape: None.

extent analysis

Fix Plan

To resolve the issue of prompt being logged as None in RequestLogItem for gpt-oss-20b, we need to modify the logging mechanism to correctly capture and log the text-based prompt.

Step-by-Step Solution:

  1. Identify the logging function: Locate the function responsible for logging RequestLogItem details in entrypoints/logger.py.
  2. Modify the logging function: Update the function to include the text-based prompt in the log message.
  3. Retrieve the prompt text: Before logging, retrieve the prompt text from the request data or the model's input.

Example code snippet:

# entrypoints/logger.py
def log_request_details(request_log_item):
    # Retrieve the prompt text from the request data
    prompt_text = request_log_item.request.get('prompt')

    # Log the request details with the prompt text
    logger.debug(
        f"Request {request_log_item.request_id} details: "
        f"prompt: {prompt_text}, "
        f"prompt_token_ids: {request_log_item.prompt_token_ids}, "
        f"prompt_embeds shape: {request_log_item.prompt_embeds.shape}"
    )

Additional Step:

  1. Verify the fix: Set VLLM_LOGGING_LEVEL=DEBUG and send a request to the /v1/chat/completions endpoint to observe the updated logs.

Verification

After applying the fix, the debug logs should display the correct text-based prompt in the RequestLogItem details for the gpt-oss-20b model.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING