Skip to content

Commit 214fd2b

Browse files
Inline base64+zstd decompress into prompt_token_ids; drop _decompress module
The shared helper had a single caller (prompt_token_ids); logprobs/router_replay already inline the same base64+zstd step. Inline it there too for consistency and remove the dedicated _decompress.py file. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d824318 commit 214fd2b

2 files changed

Lines changed: 5 additions & 19 deletions

File tree

eval_protocol/tracing/_decompress.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

eval_protocol/tracing/prompt_token_ids.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77

88
from __future__ import annotations
99

10+
import base64
1011
import json
1112
from typing import Any, Dict, List, Tuple
1213

13-
from ._decompress import decompress_b64
14+
import zstandard as zstd
15+
1416
from .types import DecodedPayload, PayloadType
1517

1618

@@ -23,7 +25,8 @@ def parse_prompt_token_ids(raw: bytes) -> Tuple[List[int], Dict[str, Any]]:
2325

2426
def decode_prompt_token_ids(data_b64: str) -> DecodedPayload:
2527
"""Decode a gateway ``payloads.prompt_token_ids.data`` blob."""
26-
token_ids, metadata = parse_prompt_token_ids(decompress_b64(data_b64))
28+
raw = zstd.ZstdDecompressor().decompress(base64.b64decode(data_b64))
29+
token_ids, metadata = parse_prompt_token_ids(raw)
2730
return DecodedPayload(
2831
payload_type=PayloadType.PROMPT_TOKEN_IDS,
2932
value=token_ids,

0 commit comments

Comments
 (0)