SocialLocalMobile commited on
Commit
0907996
·
verified ·
1 Parent(s): b5c4306

Publish agentx-mini distilled AgentX dataset

Browse files
Files changed (7) hide show
  1. .gitattributes +2 -60
  2. .gitignore +4 -0
  3. LICENSE +202 -0
  4. README.md +182 -0
  5. distill.py +145 -0
  6. stats.txt +9 -0
  7. traces.jsonl +3 -0
.gitattributes CHANGED
@@ -1,60 +1,2 @@
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
 
1
+ # Modified for agentx-mini: track traces.jsonl with Git LFS.
2
+ traces.jsonl filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.gitignore ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ __pycache__/
2
+ .ruff_cache/
3
+ rebuilt/
4
+ .DS_Store
LICENSE ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
README.md ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ pretty_name: agentx-mini
4
+ task_categories:
5
+ - text-generation
6
+ tags:
7
+ - llm
8
+ - inference
9
+ - agentic
10
+ - benchmarking
11
+ - kv-cache
12
+ - multi-turn
13
+ - subagents
14
+ size_categories:
15
+ - n<1K
16
+ configs:
17
+ - config_name: default
18
+ data_files:
19
+ - split: train
20
+ path: traces.jsonl
21
+ ---
22
+
23
+ # agentx-mini
24
+
25
+ **agentx-mini** is a smaller workload for benchmarking local LLM servers, derived from
26
+ [semianalysisai/cc-traces-weka-062126-256k](https://huggingface.co/datasets/semianalysisai/cc-traces-weka-062126-256k).
27
+ It contains **200 sessions and 9,439 model calls**, including **1,363 subagent calls**.
28
+ The original dataset's filters still apply; the changes below are additional.
29
+
30
+ Changes from the original dataset:
31
+
32
+ - Divide input and output lengths by **8**, rounding each output up. Hash IDs stay the same; logical blocks shrink from 64 to 8 tokens.
33
+ - Divide active request time by **8** and cap ordinary whole-session idle gaps at **1 second**. Keep original gaps over an hour just above the harness's one-hour stream-separation threshold; the runtime idle cap skips those waits.
34
+ - Keep complete sessions with **less than 10,000 requested output tokens**, counting all subagents and auxiliary calls. Total requested output: **962,859 tokens**.
35
+ - Preserve request grouping, spawn/join dependencies, shared prompt content, and reference overlaps. The agentx-mini traces are model-independent; actual replay overlap depends on server speed.
36
+
37
+ ## Stats
38
+
39
+ ```text
40
+ traces: 200
41
+ main_turns: 8,076
42
+ subagent_groups: 76
43
+ subagent_inner_requests: 1,363
44
+ total_model_requests: 9,439
45
+ total_input_tokens: 126,413,728
46
+ total_output_tokens: 962,854
47
+ ```
48
+
49
+ These use the original dataset's counting convention: main turns are top-level
50
+ calls, and subagent groups are explicit containers. Token totals are trace
51
+ counts; rendered prompts also include tokenizer and chat-template overhead.
52
+ Five zero-output calls request one token each during replay, bringing requested
53
+ output to **962,859 tokens**.
54
+
55
+ Input totals count repeated prefixes on every call. With a cold, unlimited
56
+ cache shared by all agents of each session on one model, the hash-based estimate
57
+ is **5,499,568 uncached input tokens** (**95.65% prefix reuse**). Concurrent
58
+ prefills, eviction, and tokenizer/chat-template overhead affect actual prefill.
59
+
60
+ ## Files and reproduction
61
+
62
+ `traces.jsonl` contains the scaled Weka records; `stats.txt` contains their totals.
63
+ Each record's optional `totals` field includes a modification notice and token
64
+ totals; this metadata does not affect replay.
65
+ AgentX Harness handles prompt synthesis and replay using the target model's tokenizer.
66
+ All 200 sessions retain their original request grouping and execution dependencies
67
+ with the tested harness. Seven agent/auxiliary labels change across six sessions;
68
+ their execution graph and synthesized prompt content remain equivalent.
69
+
70
+ To rebuild agentx-mini:
71
+
72
+ ```sh
73
+ pip install huggingface-hub orjson
74
+ python distill.py --output rebuilt
75
+ ```
76
+
77
+ [distill.py](distill.py) pins the source revision and applies deterministic token
78
+ and timeline transforms. It needs no model, tokenizer, or replay plugin.
79
+
80
+ ## Run agentx-mini with AgentX Harness
81
+
82
+ Requires Python 3.11–3.13. Install in a dedicated virtual environment, following
83
+ the [AgentX Harness README](https://github.com/SemiAnalysisAI/agentx-harness#install-and-run-agentx):
84
+
85
+ ```bash
86
+ python3 -m venv .venv
87
+ source .venv/bin/activate
88
+ pip install agentx-harness==1.0.7
89
+ ```
90
+
91
+ The package is `agentx-harness`; the command is `agentx`. Its built-in `weka_hf`
92
+ loader reads agentx-mini and synthesizes prompts using your chosen tokenizer.
93
+
94
+ 1. **Download agentx-mini** into a local directory.
95
+ 2. **Start your local LLM server** and load your model, for example using
96
+ `llama-server`. It must expose an OpenAI-compatible API. Enable parallel
97
+ request slots to exercise subagents. Allow up to 32,000 tokens per request
98
+ for input plus output, with additional room for chat-template overhead.
99
+ Keep the server running during the benchmark.
100
+ 3. **Configure AgentX.** Save the configuration below as `benchmark.yaml` beside
101
+ `traces.jsonl`. Replace the served model name, tokenizer, and server URL with
102
+ your server's settings. Set `hf_weka_dataset` to the **absolute path** of the
103
+ downloaded dataset directory (run `pwd` there to get it).
104
+
105
+ ```yaml
106
+ benchmark:
107
+ models: [YOUR_SERVED_MODEL_NAME]
108
+ tokenizer:
109
+ name: YOUR_TOKENIZER
110
+ endpoint:
111
+ urls: [http://127.0.0.1:8000]
112
+ streaming: true
113
+ extra: {ignore_eos: true}
114
+ use_legacy_max_tokens: true
115
+ datasets:
116
+ - name: default
117
+ type: public
118
+ dataset: weka_hf
119
+ hf_weka_dataset: /absolute/path/to/agentx-mini
120
+ sampling: sequential
121
+ trace_idle_gap_cap_seconds: 1
122
+ phases:
123
+ - name: profiling
124
+ type: concurrency
125
+ timing_mode: agentic_replay
126
+ concurrency: 1
127
+ duration: 1200
128
+ trajectory_start_min_ratio: 0
129
+ trajectory_start_max_ratio: 0
130
+ ```
131
+
132
+ Run from that directory:
133
+
134
+ ```bash
135
+ agentx profile \
136
+ --config benchmark.yaml \
137
+ --random-seed 42 \
138
+ --output-artifact-dir ./results/agentx-mini
139
+ ```
140
+
141
+ **Automatic download:** instead of downloading first, set `hf_weka_dataset` to
142
+ the HF repository ID (`SocialLocalMobile/agentx-mini`) and run the same command
143
+ from the directory containing `benchmark.yaml`. AgentX Harness downloads agentx-mini
144
+ automatically. `distill.py` is only for rebuilding agentx-mini.
145
+
146
+ With `--config`, AgentX Harness uses the settings in the YAML file. This configuration
147
+ starts sessions at their first turn and runs one session tree at a time,
148
+ including its parallel subagents, with a **20-minute profiling budget**.
149
+ Startup and final request draining can add time; this does not guarantee that
150
+ all 200 sessions finish. To replay all 200 once, replace `duration: 1200` with
151
+ `requests: 9439`.
152
+
153
+ Keep `timing_mode: agentic_replay` and the runtime idle cap: the retained long
154
+ reference gaps help reconstruct separate agent streams, while the cap skips
155
+ waits when the entire session tree is idle. Ordinary fixed-schedule replay
156
+ would wait through those gaps. At the tested harness version, some joins can
157
+ still leave extra idle waits (about 8–11 seconds observed). For a tighter bound
158
+ with `concurrency: 1`, optionally add `system_idle_gap_cap_seconds: 1` to the
159
+ profiling phase.
160
+
161
+ All **200 sessions / 9,439 calls** were replayed against a mock server using
162
+ unmodified agentx-harness commit
163
+ [`e4bb2f8`](https://github.com/SemiAnalysisAI/agentx-harness/commit/e4bb2f835ffedbbe6b76252ea5c93caec68c5faf)
164
+ with its default reconstruction thresholds. Call coverage, output budgets,
165
+ prefix reuse, and dependency ordering were checked; mock timings do not measure
166
+ real model performance.
167
+
168
+ The released `agentx-harness==1.0.7` was also tested with Qwen3-0.6B on
169
+ `llama-server`: a 20-minute run completed 26 sessions plus part of another,
170
+ with **1,279 successful calls**. Output budgets and dependency ordering passed.
171
+
172
+ ## License
173
+
174
+ [Apache 2.0](LICENSE), matching the source dataset published by SemiAnalysis
175
+ from its Claude Code proxy traces. The dataset, script, and documentation in
176
+ this repository are distributed under these terms.
177
+
178
+ **Modified files:** `traces.jsonl` is a scaled and filtered derivative of source
179
+ revision [`8fecd2f`](https://huggingface.co/datasets/semianalysisai/cc-traces-weka-062126-256k/tree/8fecd2fc56694469f758f0afbbb6335ad3043740);
180
+ `stats.txt` is regenerated, and this README and `.gitattributes` are adapted for
181
+ agentx-mini. The data changes are listed above. References to SemiAnalysis
182
+ identify the source and do not imply endorsement.
distill.py ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ """Rebuild the scaled Weka records without loading a model or tokenizer."""
3
+
4
+ import argparse
5
+ import copy
6
+ from pathlib import Path
7
+
8
+ import orjson
9
+ from huggingface_hub import hf_hub_download
10
+
11
+ SOURCE = "semianalysisai/cc-traces-weka-062126-256k"
12
+ REVISION = "8fecd2fc56694469f758f0afbbb6335ad3043740"
13
+ TOKEN_DIVISOR = 8
14
+ TIME_DIVISOR = 8
15
+ IDLE_CAP_SECONDS = 1
16
+ # AgentX uses this gap threshold to distinguish a new stream from a continuation.
17
+ STREAM_GAP_SECONDS = 3600
18
+ OUTPUT_LIMIT = 10_000
19
+ MODIFICATION_NOTICE = (
20
+ f"Modified for agentx-mini from {SOURCE}@{REVISION}, published by SemiAnalysis "
21
+ "under Apache-2.0. Token lengths scaled by 8; timeline compressed with long "
22
+ "stream-separation gaps retained; sessions filtered to fewer than 10,000 "
23
+ "requested output tokens. See README.md for details and LICENSE for terms."
24
+ )
25
+
26
+
27
+ def requests(trace):
28
+ for entry in trace["requests"]:
29
+ yield from entry["requests"] if entry["type"] == "subagent" else (entry,)
30
+
31
+
32
+ def make_timeline(calls):
33
+ """Use one shared clock; retain long gaps that identify separate streams."""
34
+ intervals = sorted((r["t"], r["t"] + r["api_time"]) for r in calls)
35
+ origin, end = intervals[0]
36
+ gaps = []
37
+ for start, stop in intervals[1:]:
38
+ if start > end:
39
+ gaps.append((end, start))
40
+ end = max(end, stop)
41
+
42
+ def timeline(seconds):
43
+ value = (seconds - origin) / TIME_DIVISOR
44
+ for start, end in gaps:
45
+ if seconds <= start:
46
+ break
47
+ original_width = end - start
48
+ scaled_width = original_width / TIME_DIVISOR
49
+ if original_width > STREAM_GAP_SECONDS:
50
+ # The runtime idle cap skips this wait after graph reconstruction.
51
+ target_width = min(original_width, STREAM_GAP_SECONDS + 1)
52
+ else:
53
+ target_width = min(scaled_width, IDLE_CAP_SECONDS)
54
+ fraction = min(seconds - start, original_width) / original_width
55
+ value -= fraction * (scaled_width - target_width)
56
+ return value
57
+
58
+ return timeline
59
+
60
+
61
+ def scale_prefix(entry):
62
+ # Round the combined prefix once so separate rounding cannot add tokens.
63
+ tools, system = entry.get("tool_tokens", 0), entry.get("system_tokens", 0)
64
+ scaled_tools = (tools + TOKEN_DIVISOR - 1) // TOKEN_DIVISOR
65
+ total = (tools + system + TOKEN_DIVISOR - 1) // TOKEN_DIVISOR
66
+ if "tool_tokens" in entry:
67
+ entry["tool_tokens"] = scaled_tools
68
+ if "system_tokens" in entry:
69
+ entry["system_tokens"] = total - scaled_tools
70
+
71
+
72
+ def distill_trace(raw):
73
+ calls = list(requests(raw))
74
+ requested_output = sum(max(1, (r["out"] + TOKEN_DIVISOR - 1) // TOKEN_DIVISOR) for r in calls)
75
+ if requested_output >= OUTPUT_LIMIT:
76
+ return None
77
+ block_size = raw["block_size"]
78
+ if block_size % TOKEN_DIVISOR or any(r["in"] != len(r["hash_ids"]) * block_size for r in calls):
79
+ raise ValueError("Expected complete hash blocks divisible by the token scale")
80
+ timeline = make_timeline(calls)
81
+
82
+ def duration(start, seconds):
83
+ return max(0.0, timeline(start + seconds) - timeline(start))
84
+
85
+ trace = copy.deepcopy(raw)
86
+ trace.pop("totals", None)
87
+ trace["block_size"] = block_size // TOKEN_DIVISOR
88
+ scale_prefix(trace)
89
+ for request in requests(trace):
90
+ request["in"] //= TOKEN_DIVISOR
91
+ request["out"] = (request["out"] + TOKEN_DIVISOR - 1) // TOKEN_DIVISOR
92
+ start = request["t"]
93
+ request["t"] = timeline(start)
94
+ request["api_time"] = duration(start, request["api_time"])
95
+ if request.get("ttft") is not None:
96
+ request["ttft"] = duration(start, request["ttft"])
97
+ if request.get("think_time") is not None:
98
+ think = request["think_time"]
99
+ request["think_time"] = duration(start - think, think)
100
+ for entry in trace["requests"]:
101
+ scale_prefix(entry)
102
+ if entry["type"] == "subagent":
103
+ start = entry["t"]
104
+ entry["t"] = timeline(start)
105
+ if entry.get("duration_ms") is not None:
106
+ # Map millisecond endpoints before subtraction to retain precision.
107
+ end = start + entry["duration_ms"] / 1000
108
+ entry["duration_ms"] = round(
109
+ max(0.0, timeline(end) * 1000 - timeline(start) * 1000)
110
+ )
111
+ entry["total_tokens"] = sum(r["in"] + r["out"] for r in entry["requests"])
112
+ # Weka's optional, opaque totals field carries the change notice without
113
+ # adding an unknown schema field or changing any replay request.
114
+ calls = list(requests(trace))
115
+ trace["totals"] = {
116
+ "input_tokens": sum(r["in"] for r in calls),
117
+ "output_tokens": sum(r["out"] for r in calls),
118
+ "modification_notice": MODIFICATION_NOTICE,
119
+ }
120
+ return trace
121
+
122
+
123
+ def main():
124
+ parser = argparse.ArgumentParser(description=__doc__)
125
+ parser.add_argument(
126
+ "--input", type=Path, help="Original traces.jsonl; otherwise download the pinned HF source"
127
+ )
128
+ parser.add_argument("--output", type=Path, required=True, help="New output directory")
129
+ args = parser.parse_args()
130
+ source = args.input or Path(
131
+ hf_hub_download(SOURCE, "traces.jsonl", repo_type="dataset", revision=REVISION)
132
+ )
133
+ args.output.mkdir(parents=True, exist_ok=False)
134
+ count = 0
135
+ with source.open("rb") as inputs, (args.output / "traces.jsonl").open("wb") as output:
136
+ for line in inputs:
137
+ trace = distill_trace(orjson.loads(line))
138
+ if trace is not None:
139
+ output.write(orjson.dumps(trace) + b"\n")
140
+ count += 1
141
+ print(f"Wrote {count} sessions to {args.output / 'traces.jsonl'}")
142
+
143
+
144
+ if __name__ == "__main__":
145
+ main()
stats.txt ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Modified for agentx-mini: totals regenerated from the scaled, filtered dataset.
2
+ # Source: semianalysisai/cc-traces-weka-062126-256k (SemiAnalysis), Apache-2.0.
3
+ traces: 200
4
+ main_turns: 8,076
5
+ subagent_groups: 76
6
+ subagent_inner_requests: 1,363
7
+ total_model_requests: 9,439
8
+ total_input_tokens: 126,413,728
9
+ total_output_tokens: 962,854
traces.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:99ff1cacf2d3e9e6f857890a832da6f5a3ba48e701f102cd3ceed6af7952e3a0
3
+ size 73394607