Pass usage_signature through to RolloutOutput#1030
Open
shayonj wants to merge 2 commits intoPrimeIntellect-ai:mainfrom
Open
Pass usage_signature through to RolloutOutput#1030shayonj wants to merge 2 commits intoPrimeIntellect-ai:mainfrom
shayonj wants to merge 2 commits intoPrimeIntellect-ai:mainfrom
Conversation
1 task
- TokenUsage: add optional usage_signature field - Response: add optional usage_signature field - OpenAIChatCompletionsClient: extract usage_signature from model_extra on ChatCompletion response (set by vLLM ASGI middleware) - save_utils: forward last trajectory response's usage_signature into RolloutOutput.token_usage for orchestrator HMAC verification
1914755 to
3f8913b
Compare
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.
Summary
Small change to pass the HMAC usage signature from vLLM responses through to the orchestrator for tamper detection.
When the vLLM ASGI middleware signs token usage data (added in the prime-rl companion PR), the signature is injected as
usage_signaturein the chat completion response JSON. This PR ensures that field survives the verifiers pipeline:types.py— add optionalusage_signaturefield toResponseandTokenUsageopenai_chat_completions_client.py— extractusage_signaturefrom the OpenAI SDK response'smodel_extrasave_utils.py— forward the last trajectory response's signature intoRolloutOutput.token_usage3 files, 20 lines. No behavior change when the middleware isn't active (field is simply absent).
Companion PRs: platform#913 · prime-rl#2042 · hosted-rl#862
Note
Low Risk
Low risk: adds an optional metadata field and pass-through logic without changing token counting or request/response behavior when the field is absent.
Overview
Propagates an optional
usage_signaturevalue from model chat completion responses into serialized rollout outputs for downstream tamper detection.This extends
Response/TokenUsagewithusage_signature, extracts it from the OpenAI SDK response (includingmodel_extra), and injects the most recent trajectory signature intoRolloutOutput.token_usagewhen present.Written by Cursor Bugbot for commit 34e861c. This will update automatically on new commits. Configure here.