Repository navigation
Conversation
…est; remove the OAI incompatible comment Signed-off-by: jamesong <jamesong@amd.com>
Json288
marked this pull request as ready for review
September 11, 2026 19:04
jimw567
reviewed
Sep 22, 2026
| 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. |
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
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 whenlogprobs: true)"However, this contradicts with the OpenAI chat completion schema. Per the documentation from OpenAI Python SDK, the expected schema is
choices[].logprobs(logprobsis at the same level asmessage).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.logprobsis a typo in the spec and needs to confirm with RVT.Requirements
Jira: