Expand description
Mooncake JSONL primitives.
This module is producer- and consumer-agnostic: it defines the row schema, the block-hash-to-id mapping, the token-block hashing helper, and the JSONL writer. Workload-specific orchestration such as scheduling, tokenization, and parsing lives elsewhere.
The MooncakeRow schema deliberately matches the externally-authored
Mooncake trace format: timestamp and delay are f64 milliseconds, and
input_length/output_length/timestamp/delay accept the upstream
aliases (input_tokens, output_tokens, created_time, delay_ms) on
deserialization. Serialization emits the canonical names.
Structs§
- Agentic
Mooncake Row - One row of an agentic Mooncake replay trace.
- Agentic
Tool Event - Harness tool span attributed to the LLM request that consumed it.
- Mooncake
Jsonl Writer - JSONL writer for Mooncake rows plus an optional sidecar stream.
- Mooncake
Row - One row of a Mooncake replay trace.
- Rolling
Hash IdMapper - Maps sequence-aware block hashes to compact, stable
u64ids. - Writer
Stats - Counters for what a
MooncakeJsonlWriterhas emitted.
Functions§
- hash_
token_ blocks - Token-block hashing helper for the Mooncake replay schema.
- ids_
for_ sequence_ hashes - Map stable sequence hashes to compact Mooncake IDs with a shared mapper.
- require_
positive - Sentinel used by callers that want to bail when neither block_size nor worker count is allowed to be zero. Producers may also enforce this on their own configuration types.
- sequence_
hashes_ for_ tokens - Derive the sequence-aware block hashes recorded by Dynamo request traces.
- try_
hash_ token_ blocks - Fallible token-block hashing helper for callers that want to surface invalid block-size or request-shape errors.
- write_
empty_ files - Create both files empty (touch-equivalent), preserving directory creation semantics for callers that want a “no rows produced” outcome to still emit well-formed (empty) JSONL files.