zeelHz sammshen commited on
Commit
565e565
·
0 Parent(s):

Duplicate from sammshen/lmcache-agentic-traces

Browse files

Co-authored-by: Samuel Shen <sammshen@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.avro filter=lfs diff=lfs merge=lfs -text
4
+ *.bin filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
7
+ *.ftz filter=lfs diff=lfs merge=lfs -text
8
+ *.gz filter=lfs diff=lfs merge=lfs -text
9
+ *.h5 filter=lfs diff=lfs merge=lfs -text
10
+ *.joblib filter=lfs diff=lfs merge=lfs -text
11
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
12
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
13
+ *.mds filter=lfs diff=lfs merge=lfs -text
14
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
15
+ *.model filter=lfs diff=lfs merge=lfs -text
16
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
17
+ *.npy filter=lfs diff=lfs merge=lfs -text
18
+ *.npz filter=lfs diff=lfs merge=lfs -text
19
+ *.onnx filter=lfs diff=lfs merge=lfs -text
20
+ *.ot filter=lfs diff=lfs merge=lfs -text
21
+ *.parquet filter=lfs diff=lfs merge=lfs -text
22
+ *.pb filter=lfs diff=lfs merge=lfs -text
23
+ *.pickle filter=lfs diff=lfs merge=lfs -text
24
+ *.pkl filter=lfs diff=lfs merge=lfs -text
25
+ *.pt filter=lfs diff=lfs merge=lfs -text
26
+ *.pth filter=lfs diff=lfs merge=lfs -text
27
+ *.rar filter=lfs diff=lfs merge=lfs -text
28
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
29
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
30
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
31
+ *.tar filter=lfs diff=lfs merge=lfs -text
32
+ *.tflite filter=lfs diff=lfs merge=lfs -text
33
+ *.tgz filter=lfs diff=lfs merge=lfs -text
34
+ *.wasm filter=lfs diff=lfs merge=lfs -text
35
+ *.xz filter=lfs diff=lfs merge=lfs -text
36
+ *.zip filter=lfs diff=lfs merge=lfs -text
37
+ *.zst filter=lfs diff=lfs merge=lfs -text
38
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
39
+ # Audio files - uncompressed
40
+ *.pcm filter=lfs diff=lfs merge=lfs -text
41
+ *.sam filter=lfs diff=lfs merge=lfs -text
42
+ *.raw filter=lfs diff=lfs merge=lfs -text
43
+ # Audio files - compressed
44
+ *.aac filter=lfs diff=lfs merge=lfs -text
45
+ *.flac filter=lfs diff=lfs merge=lfs -text
46
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
47
+ *.ogg filter=lfs diff=lfs merge=lfs -text
48
+ *.wav filter=lfs diff=lfs merge=lfs -text
49
+ # Image files - uncompressed
50
+ *.bmp filter=lfs diff=lfs merge=lfs -text
51
+ *.gif filter=lfs diff=lfs merge=lfs -text
52
+ *.png filter=lfs diff=lfs merge=lfs -text
53
+ *.tiff filter=lfs diff=lfs merge=lfs -text
54
+ # Image files - compressed
55
+ *.jpg filter=lfs diff=lfs merge=lfs -text
56
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
57
+ *.webp filter=lfs diff=lfs merge=lfs -text
58
+ # Video files - compressed
59
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
60
+ *.webm filter=lfs diff=lfs merge=lfs -text
61
+ data.jsonl filter=lfs diff=lfs merge=lfs -text
62
+ data/train.jsonl filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ task_categories:
4
+ - text-generation
5
+ tags:
6
+ - kv-cache
7
+ - llm-serving
8
+ - agentic
9
+ - multi-turn
10
+ - traces
11
+ - benchmark
12
+ pretty_name: LMCache Agentic Dataset Collection
13
+ size_categories:
14
+ - 10K<n<100K
15
+ ---
16
+
17
+ # LMCache Agentic Dataset Collection
18
+
19
+ A curated dataset collection of **787 multi-turn agentic LLM sessions** (24,881 total LLM iterations) designed for benchmarking stateful LLM serving systems. Every session exhibits at least 5 turns with prefix growth and builds to at least 10K tokens of context — making it ideal for evaluating tiered KV Cache solutions like [LMCache](https://github.com/LMCache/LMCache).
20
+
21
+ ## Motivation
22
+
23
+ Modern LLM agents (coding assistants, research agents, tool-calling systems) make dozens of sequential API calls per task. Each call appends tool results and assistant responses to a growing conversation history, creating a natural prefix-sharing pattern: iteration N's input is iteration N-1's input plus new messages at the end.
24
+
25
+ This means **>90% of tokens in a typical request have already been processed in the previous request**. An efficient KV cache can skip recomputation of the shared prefix, dramatically increasing system throughput (tok/s) and reducing GPU cost.
26
+
27
+ The challenge with inference benchmarking of agentic workloads is that the trace format should permit directly running against an inference API such as the OpenAI or Anthropic API instead of requiring an agent harness to be nested in between. Thus, the user can directly benchmark their inference deployment with a reproducable agentic workload without actually deploying an agent.
28
+
29
+ This dataset provides these real agent trajectories from the tasks provided in the following open source agentic datasets:
30
+
31
+ - **[SWE-bench Verified](https://swebench.com/)**: Real GitHub issues from popular Python repos. The agent (OpenHands CodeAct) reads code, writes patches, runs tests, and iterates on failures. Sessions range from 5-50 turns of edit-test-debug cycles.
32
+ - **[GAIA](https://huggingface.co/datasets/gaia-benchmark/GAIA)**: Level 2-3 multi-step reasoning tasks requiring web search, file analysis, and chain-of-thought reasoning. Evaluated with Inspect AI.
33
+ - **[WildClaw](https://github.com/WildClaw)**: Mixed agent tasks spanning creative synthesis, search, and code generation.
34
+
35
+ ## Dataset Overview
36
+
37
+ | Source | Sessions | Turns (med/mean/max) | Models | Workload |
38
+ |--------|----------|----------------------|--------|----------|
39
+ | **SWE-bench** | 669 | 38 / 35 / 50 | MiniMax-M2.5, Claude Sonnet 4.6, DeepSeek V3.1 | Code debugging: read code, write patches, run tests, debug failures |
40
+ | **GAIA** | 85 | 14 / 13 / 26 | Claude Sonnet 4.6 | Multi-step research and reasoning with web search |
41
+ | **WildClaw** | 10 | 22 / 24 / 41 | Claude Opus 4.6 | Mixed agent tasks (creative, search, code) |
42
+ | **Total** | **787** | **35 / 33 / 50** | **4 models** | **3 workload types** |
43
+
44
+ ## Data Format
45
+
46
+ Each row represents one LLM iteration within a session. All rows for a session share the same `session_id`. A "session" corresponds to a single task — one initial query that the agent works on across multiple turns. All sessions are single-task: the agent receives one problem and iterates on it (reading code, running commands, calling tools) until done or the turn budget is exhausted.
47
+
48
+ Messages use four roles: `system` (always the first message), `user` (the initial query plus framework-injected feedback like error messages and runtime info), `assistant` (LLM responses and tool-call requests), and `tool` (tool execution results). The `tool` role appears in GAIA, WildClaw, and SWE-bench Sonnet sessions which use OpenAI-style function calling. SWE-bench MiniMax/DeepSeek sessions embed tool outputs directly in `user` messages instead.
49
+
50
+ ```jsonl
51
+ {"session_id": "swebench__django__django-16527__claude", "model": "claude-sonnet-4-6", "input": [{"role": "system", "content": "..."}, {"role": "user", "content": "Fix the bug..."}], "pre_gap": 0.0, "output_length": 342}
52
+ {"session_id": "swebench__django__django-16527__claude", "model": "claude-sonnet-4-6", "input": [{"role": "system", "content": "..."}, {"role": "user", "content": "Fix the bug..."}, {"role": "assistant", "content": "Let me read...", "tool_calls": [...]}, {"role": "tool", "content": "class QuerySet:..."}], "pre_gap": 1.2345, "output_length": 567}
53
+ ```
54
+
55
+ ### Fields
56
+
57
+ | Field | Type | Description |
58
+ |-------|------|-------------|
59
+ | `session_id` | string | Unique session identifier (e.g. `swebench__django__django-16527__claude`, `gaia__L2_abc123__claude`, `wildclaw__01_Productivity_Flow_task_1_arxiv_digest__claude`). Describes source, task, and model. Same for all rows in a session. |
60
+ | `model` | string | Model used (e.g. `claude-sonnet-4-6`, `minimax-m2.5`, `deepseek-v3.1`). |
61
+ | `input` | array | Full cumulative OpenAI-format `messages` array. The assistant's output from iteration N-1 is embedded in iteration N's input. `input[N]` is a strict prefix-superset of `input[N-1]`. |
62
+ | `pre_gap` | float | Seconds between the previous iteration's response completing (last streamed token) and this iteration's request being sent. This is the real tool-execution / user-thinking time. Always `0.0` for the first iteration of a session. Median: 0.71s, mean: 2.08s, p95: 3.73s. |
63
+ | `output_length` | int | Completion tokens generated for this iteration. |
64
+
65
+ ### Timing Model
66
+
67
+ The `pre_gap` field captures the **client-side delay** between consecutive LLM calls within a session. This is the time spent executing tools (running bash commands, reading files, making web requests) or processing the LLM's response before sending the next request. It does **not** include LLM inference time — that depends on the serving system being benchmarked.
68
+
69
+ ```
70
+ |-- LLM inference (N-1) --|-- pre_gap[N] (tool exec / think time) --|-- LLM inference (N) --|
71
+ ```
72
+
73
+ This enables accurate trace replay: a benchmarking tool can fire request N exactly `pre_gap[N]` seconds after receiving the last token of response N-1, faithfully reproducing the original workload timing without baking in the original server's inference latency.
74
+
75
+ ## Dataset Statistics
76
+
77
+ ### Turns per Session
78
+
79
+ The dataset spans a wide range of conversation lengths. SWE-bench sessions are the longest (median 38 turns, many hitting the 50-turn cap). GAIA sessions vary from 5 to 26 turns depending on task difficulty. WildClaw sessions range from 6 to 41 turns.
80
+
81
+ ![Turns per session distribution](stats/turns_per_session.png)
82
+
83
+ ![Turns per session by source](stats/turns_by_source.png)
84
+
85
+ ### Context Growth
86
+
87
+ The key property for KV cache benchmarking: how context size grows as a session progresses. All sessions are filtered to reach at least 10K tokens of context. On average, context starts at ~14K tokens and grows linearly to ~35K tokens by turn 50.
88
+
89
+ ![Context growth curve](stats/context_growth.png)
90
+
91
+ Per-source context growth shows distinct patterns:
92
+ - **SWE-bench**: steady linear growth from ~14K to ~37K tokens (large system prompts + code context)
93
+ - **GAIA**: rapid growth to ~20K tokens then plateau (web search results accumulate then stabilize)
94
+ - **WildClaw**: steep growth from ~30K to ~130K tokens (complex multi-tool agent sessions)
95
+
96
+ ![Context growth by source](stats/context_growth_by_source.png)
97
+
98
+ ### Token Distributions
99
+
100
+ Input tokens (prompt size) follow a right-skewed distribution with median 21K tokens, dominated by SWE-bench's large contexts. Output tokens have a median of 104 tokens — these are the short, frequent tool-call requests that dominate agentic iteration. However, the dataset also captures substantial long-form generation: 11.5% of outputs exceed 500 tokens and the tail extends to 11K+ tokens. These longer outputs — code patches, detailed analyses, multi-step plans — are the responses typically visible to the end user in an agent interaction, and they represent the bulk of the generation workload despite being less frequent.
101
+
102
+ ![Token distributions](stats/token_distributions.png)
103
+
104
+ ## Usage with AIPerf
105
+
106
+ This dataset can be converted to [AIPerf](https://github.com/ai-dynamo/aiperf)'s `mooncake_trace` format for benchmarking. See [sammshen/agentic-dataset](https://github.com/sammshen/agentic-dataset) for the converter script and full documentation.
107
+
108
+ ```bash
109
+ # Convert to mooncake_trace format (pre_gap → delay in ms)
110
+ python convert_lmcache_to_mooncake.py --output trace.jsonl
111
+
112
+ # Recommended: concurrent sessions, sequential intra-session turns
113
+ aiperf profile \
114
+ --input-file trace.jsonl \
115
+ --custom-dataset-type mooncake_trace \
116
+ --concurrency 20 \
117
+ --request-timeout-seconds 3600 \
118
+ --extra-inputs ignore_eos:true \
119
+ --use-server-token-count
120
+ ```
121
+
122
+ AIPerf guarantees that requests within the same `session_id` run strictly sequentially in all scheduling modes. `--concurrency N` keeps N sessions active with no inter-turn delay (max cache pressure). For realistic timing with tool-execution gaps, use `--fixed-schedule` which honors the `delay` field from `pre_gap`.
123
+
124
+ ## Intended Use
125
+
126
+ This dataset is designed for:
127
+
128
+ - **KV cache system benchmarking**: Evaluate prefix-aware caching strategies (e.g., LMCache, Mooncake, vLLM prefix caching, SGLang RadixAttention) using realistic workloads with verified prefix structure.
129
+ - **LLM serving research**: Study context growth patterns, request timing distributions, and output length distributions in real agentic workloads.
130
+ - **Cache policy design**: Use the per-source breakdown to understand how different workload types create different caching opportunities (e.g., SWE-bench's large steadily growing contexts vs GAIA's rapid growth and plateau).
131
+
132
+ ## Citation
133
+
134
+ If you use this dataset, please cite:
135
+
136
+ ```bibtex
137
+ @misc{lmcache-agentic-dataset-2026,
138
+ title={LMCache Agentic Dataset: Multi-Turn LLM Agent Sessions for KV Cache Benchmarking},
139
+ author={LMCache},
140
+ year={2026},
141
+ url={https://huggingface.co/datasets/sammshen/lmcache-agentic-traces}
142
+ }
143
+ ```
144
+
145
+ ## License
146
+
147
+ CC-BY-4.0
data/train-00000-of-00005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7d8fde279e899c0cd97e1b4b73dd2a0d76132c533e77ac1cdd310494710d7447
3
+ size 502376957
data/train-00001-of-00005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:594c934498c9d099e75f9d3332feaaed3587b8b0b8eeb5063e79514cc2aedc8f
3
+ size 555802662
data/train-00002-of-00005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:476b661879f28732bf5c56af4887666194b4f489a1128af59e58bdbfdf6d1ccc
3
+ size 476154555
data/train-00003-of-00005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca61176d73e4de62e273983a44531ceeacb251405f8db3b92a791d9343e2c66f
3
+ size 437652845
data/train-00004-of-00005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a59fe71cf84ae0beb460cabb4edfd3e04f7da945c5d6777ae5df18716eceab71
3
+ size 398199928
stats/context_growth.png ADDED

Git LFS Details

  • SHA256: c09b87da69a027c8bb0c559cedd22ebc65fb67037a80bc37f5b8ad09c385e3ab
  • Pointer size: 131 Bytes
  • Size of remote file: 133 kB
stats/context_growth_by_source.png ADDED

Git LFS Details

  • SHA256: d6663ed34ce27ce6cb67509373bb60978b3cdc2031db26c7922ca2dba21594a7
  • Pointer size: 131 Bytes
  • Size of remote file: 150 kB
stats/token_distributions.png ADDED

Git LFS Details

  • SHA256: 6e6b1d15a0bf23d99cdd7fde35d83632221d201834c10e4eca5c2662b1733654
  • Pointer size: 130 Bytes
  • Size of remote file: 80.3 kB
stats/turns_by_source.png ADDED

Git LFS Details

  • SHA256: 37dc33229f12f7158f0151c353306c9d04284e4616a9f017ea80102610f90582
  • Pointer size: 130 Bytes
  • Size of remote file: 62.2 kB
stats/turns_per_session.png ADDED

Git LFS Details

  • SHA256: 016e14c299323ed3f3d949edba2684ef21cd8b0baf50404591b391406ed31940
  • Pointer size: 130 Bytes
  • Size of remote file: 50.2 kB