[BUG]: Chat prompt_logprobs only returned on nvext, not on the OpenAI choice
Describe the Bug
Top-level prompt_logprobs on /v1/chat/completions is accepted (CommonExt) and forwarded to the vLLM worker. The worker computes the payload and stashes it on engine_data.prompt_logprobs. The Rust postprocessor only copies it onto nvext.prompt_logprobs, and only when the client also sends nvext.extra_fields: ["prompt_logprobs"].
Native vLLM returns the same data at the response root (prompt_logprobs) from the top-level request field alone. A vLLM-compatible client that only sets "prompt_logprobs": N gets HTTP 200 with no prompt logprobs in the OpenAI-shaped body.
choices[0].logprobs is generation-token logprobs (content / refusal) and is a different field.
Steps to Reproduce
Serve a chat model with Dynamo's vLLM backend and the Rust OpenAI frontend (
python -m dynamo.frontend/--dyn-chat-processor dynamo).POST
/v1/chat/completionswith top-levelprompt_logprobsand nonvext:
curl -sS http://localhost:8000/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{
"model": "<served-model>",
"messages": [{"role": "user", "content": "1 + 1 = ?"}],
"max_tokens": 1,
"temperature": 0,
"prompt_logprobs": 2
}'- Inspect the JSON:
python3 -c 'import json,sys; d=json.load(sys.stdin); c=d["choices"][0]; print({
"top_level_prompt_logprobs": d.get("prompt_logprobs"),
"choice_prompt_logprobs": c.get("prompt_logprobs"),
"choice_logprobs": c.get("logprobs"),
"nvext_prompt_logprobs": (d.get("nvext") or {}).get("prompt_logprobs"),
})'- Repeat the same request with the nvext opt-in:
{
"model": "<served-model>",
"messages": [{"role": "user", "content": "1 + 1 = ?"}],
"max_tokens": 1,
"temperature": 0,
"prompt_logprobs": 2,
"nvext": { "extra_fields": ["prompt_logprobs"] }
}- Send the step-2 payload to native vLLM
/v1/chat/completionsand compare the response-rootprompt_logprobsfield.
Expected Behavior
When the request includes top-level prompt_logprobs, the computed array should appear on the OpenAI response root without requiring nvext.extra_fields. That matches native vLLM.
Native vLLM shape: prompt_logprobs is an array next to choices (first prompt position is often null because there is no preceding-token probability). Length matches usage.prompt_tokens. Entries are token-id maps with logprob (native also includes rank and decoded_token).
nvext.prompt_logprobs can remain as an optional extra when extra_fields asks for it; it should not be the only way to read the data.
Actual Behavior
Step 2: HTTP 200, response-root prompt_logprobs is absent, choices[0].prompt_logprobs is absent, nvext is absent. Looks like a no-op.
Step 4: nvext.prompt_logprobs is populated. That shows the engine already computed the values; the frontend is gating them behind nvext.
Environment
- Dynamo frontend: Rust
/v1/chat/completions - Backend: dynamo-vLLM (worker serializes
RequestOutput.prompt_logprobsontoengine_data) - Native vLLM chat completions on the same payload returns top-level
prompt_logprobs(confirmed onQwen/Qwen3-30B-A3B-Instruct-2507)
Additional Context
Gating is NvExtResponseFieldSelection::from_nvext, which only sets prompt_logprobs: true when "prompt_logprobs" is in nvext.extra_fields. chat_completions/delta.rs then passes the engine payload into build_response_nvext.
The /v1/generate path already returns prompt_logprobs when requested on that API. Chat completions should emit the equivalent on the OpenAI response root.
A fix can stay in lib/llm:
- When
CommonExt.prompt_logprobsisSome, emit the payload even ifnvext.extra_fieldsis omitted. - Copy it onto the OpenAI response root as
prompt_logprobs(native vLLM).dynamo-protocolsCreateChatCompletionResponsecurrently has no such field, so this may need a field onNvCreateChatCompletionResponse(or a protocols bump). - Keep
nvext.prompt_logprobsworking for existing RL clients that opt in viaextra_fields.
Related: #13842 (another OpenAI chat field the Rust frontend drops). Not a duplicate of #8548 (SGLang generation logprobs.content).
Source: ai-dynamo/dynamo