Skip to content

[AIESW-41278] server : make chat logprobs response OpenAI-compatible - #101

Closed
Json288 wants to merge 1 commit into
gfx11from
jamesong.aiesw-41278-tools-stream-logprobs
Closed

Json288 wants to merge 1 commit into
gfx11from
jamesong.aiesw-41278-tools-stream-logprobs

Conversation

@Json288

@Json288 Json288 commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

This pr targets llama-server's chat functionality: removes the throw when stream + tool + logprobs is requested and add a unit test. Also replaces the stale OAI-incompatible comment.

The chat logprobs response is already OAI compatible, so no change is made to the response format.

The streaming path now mirrors the existing non-streaming behavior — it emits per-token logprobs for all tokens, including tool-call tokens.

Additional information

RVTech (RVT) SoC Vendor AI Requirements / AI Chat Completion Test Server Specification v1.3. Compliance audit of upstream llama-server (ROCm/llama.cpp) found this gap. Full audit: https://amd.atlassian.net/wiki/spaces/MLSE/pages/1839910115

In RVT's spec, they asks for: "choices[].message.logprobs (returned when logprobs: true)"
However, this contradicts with the OpenAI chat completion schema. Per the documentation from OpenAI Python SDK, the expected schema is choices[].logprobs (logprobs is at the same level as message).
As RVT's spec specifies that "the endpoint shall be callable, without modification, by the official OpenAI Python SDK" (Section 6), suspecting that choices[].message.logprobs is a typo in the spec and needs to confirm with RVT.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: Yes. AI was used when planning and drafting the pr.

Jira:

…est; remove the OAI incompatible comment

Signed-off-by: jamesong <jamesong@amd.com>
@Json288
Json288 marked this pull request as ready for review September 11, 2026 19:04
@Json288
Json288 requested a review from jimw567 September 14, 2026 19:19
def test_logprobs_with_tools_stream():
# Regression: tools + stream + logprobs used to be rejected with a 400. It is now allowed and,
# matching the non-streaming path, emits per-token logprobs (including tool-call tokens) in the
# OpenAI-modern shape, retaining the integer token id required by RVT scoring.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove reference to RVT.

@Json288 Json288 closed this Sep 22, 2026
@Json288
Json288 deleted the jamesong.aiesw-41278-tools-stream-logprobs branch September 22, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants