-
Notifications
You must be signed in to change notification settings - Fork 37
feat: Log probabilities support #221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ruivieira I added some in-place comments
In addition, please add logprobs support for requests with streaming=true (sendStreamingResponse), please take into consideration comments in PR #215 relevant to streaming (don't pass/use request in streaming.go).
Please add tests for the simulator with logprobs:
completions and chat completions requests with logprobs with and without streaming, and check the response
4f49952 to
52204d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ruivieira , I added some comments.
Please pay attention that there are changes in tests utility functions.
029ab1a to
1332201
Compare
|
/lgtm @ruivieira - approved the PR, you just need to fix merge conflicts |
5762aa3
0ccf03d to
d201bd2
Compare
Add support for log probabilities in both chat completions and text completions APIs: - Add logprobs parameter to chat completions with top_logprobs support - Add logprobs parameter to text completions with configurable count - Implement streaming and non-streaming logprobs functionality - Add comprehensive test coverage for all logprobs scenarios - Add utility functions for logprobs calculation and validation - Support both echo and random modes for logprobs generation - Include proper token-level probability information in responses - Fix undefined variables in tests after upstream merge Signed-off-by: Rui Vieira <ruidevieira@googlemail.com>
d201bd2 to
8b80d67
Compare
|
@mayabar thank for you for the comments. The conflict has been solved. |
|
Fixes #213 |
This PR implements log probabilities support in llm-d-inference-sim enabling compatibility with evaluation frameworks and other API clients that require token-level probability.
API Coverage
/v1/completions: logprobs parameter withTextLogprobsresponse structure/v1/chat/completions: logprobs boolean + top_logprobs integer withChatLogprobsresponse structureRefer to #213
Replaces #215