Skip to content

Pass usage_signature through to RolloutOutput#1030

Open
shayonj wants to merge 2 commits intoPrimeIntellect-ai:mainfrom
shayonj:feature/rft-billing-v1
Open

Pass usage_signature through to RolloutOutput#1030
shayonj wants to merge 2 commits intoPrimeIntellect-ai:mainfrom
shayonj:feature/rft-billing-v1

Conversation

@shayonj
Copy link
Contributor

@shayonj shayonj commented Mar 18, 2026

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_signature in the chat completion response JSON. This PR ensures that field survives the verifiers pipeline:

  • types.py — add optional usage_signature field to Response and TokenUsage
  • openai_chat_completions_client.py — extract usage_signature from the OpenAI SDK response's model_extra
  • save_utils.py — forward the last trajectory response's signature into RolloutOutput.token_usage

3 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_signature value from model chat completion responses into serialized rollout outputs for downstream tamper detection.

This extends Response/TokenUsage with usage_signature, extracts it from the OpenAI SDK response (including model_extra), and injects the most recent trajectory signature into RolloutOutput.token_usage when present.

Written by Cursor Bugbot for commit 34e861c. This will update automatically on new commits. Configure here.

- 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
@shayonj shayonj force-pushed the feature/rft-billing-v1 branch from 1914755 to 3f8913b Compare March 18, 2026 11:06
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.

1 participant