From ecfeef7ff114011c8ff46c55790646d58d76ce04 Mon Sep 17 00:00:00 2001 From: faresobeid <111092724+faresobeid@users.noreply.github.com> Date: Tue, 6 Oct 2026 11:57:20 +0000 Subject: [PATCH 1/2] feat(client): pass through sampling-mask logprobs --- renderers/client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/renderers/client.py b/renderers/client.py index d663f82cf..2b4b3dc40 100644 --- a/renderers/client.py +++ b/renderers/client.py @@ -396,8 +396,11 @@ def _prepare(): routed_experts = choice.get("routed_experts") # vLLM's native kept-set sampling masks (``--return-sampling-mask``): # one list of surviving vocab ids per completion token, or (prime-rl's - # server) packed CSR ``{"ids", "counts"}`` base64 int32 arrays. + # server) packed CSR ``{"ids", "counts"}`` base64 int32 arrays. With score + # centering on, prime-rl's server also returns the sampler's renormalized + # logprob of each of those ids (packed float32, parallel to the ids). sampling_mask = choice.get("sampling_mask") + sampling_mask_logprobs = choice.get("sampling_mask_logprobs") # /inference/v1/generate returns finish_reason in {"stop","length",...} — # never "tool_calls" (a chat-completions concept). Promote stop→tool_calls @@ -429,6 +432,7 @@ def _prepare(): "reasoning_complete": parsed.reasoning_complete, "routed_experts": routed_experts, "sampling_mask": sampling_mask, + "sampling_mask_logprobs": sampling_mask_logprobs, # The mm sidecar consumed on the request side, surfaced back so # callers can persist it on the trajectory step for downstream # multi-turn bridging and training-sample construction. From d3a1af006ad4cbdab615febc5aed0d9f1175607f Mon Sep 17 00:00:00 2001 From: faresobeid <111092724+faresobeid@users.noreply.github.com> Date: Sat, 3 Oct 2026 21:39:23 +0000 Subject: [PATCH 2/2] feat(client): pass through by-handle payload segments --- renderers/client.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/renderers/client.py b/renderers/client.py index 2b4b3dc40..7fc5906fb 100644 --- a/renderers/client.py +++ b/renderers/client.py @@ -261,9 +261,9 @@ async def generate( Returns a dict with: request_id, prompt_ids, renderer_prompt_ids, mm_placeholders, completion_ids, completion_logprobs, content, reasoning_content, tool_calls, finish_reason, routed_experts, - multi_modal_data, prompt_attribution. ``renderer_prompt_ids`` is the - unexpanded logical prompt when ``process_multimodal=False`` and ``None`` - otherwise. + sampling_mask, sampling_mask_logprobs, payload, multi_modal_data, + prompt_attribution. ``renderer_prompt_ids`` is the unexpanded logical + prompt when ``process_multimodal=False`` and ``None`` otherwise. ``prompt_attribution`` is the renderer's :class:`RenderedTokens` for the prompt — either the one this call computed via @@ -433,6 +433,9 @@ def _prepare(): "routed_experts": routed_experts, "sampling_mask": sampling_mask, "sampling_mask_logprobs": sampling_mask_logprobs, + # By-handle side arrays: segments of a shared payload file the inference + # server wrote instead of returning routed_experts / sampling_mask inline. + "payload": choice.get("payload"), # The mm sidecar consumed on the request side, surfaced back so # callers can persist it on the trajectory step for downstream # multi-turn bridging and training-sample construction.