Read traces from the pybot-traces dataset and link to it
Browse filesTrace windows are range-read from the dataset at a pinned revision (same bytes, so the index offsets hold); source links, the Data page, README and llms.txt point to the dataset.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Files changed (6)
- README.md+2-2
- app.py+6-4
- llms.txt+3-3
- static/agents.js+1-1
- static/app.js+5-6
- tests/test_api.py+1-1
28 unmodified lines293031323233343521 unmodified lines575859606061626328 unmodified lines| PRs, reviews, commits, scores | release tables cut at commit `24cbc04` (2026-11-13T10:17:13Z) | `data/explorer.sqlite` || Board posts (184,059, 12 channels) | board export in `HuggingFaceSwarms/pybot-msgboard` (`data/`) | `data/explorer.sqlite`, FTS5 index || Diffs and files | git history in the dataset `HuggingFaceSwarms/pybot-commits` | bare clone at startup, `git show` || Agent traces (1,000 agents, 33 GB; 3 rebuilt from the controller's event log) | bucket `HuggingFaceSwarms/pybot-traces` | `data/traces.sqlite` time index + HTTP range reads || Agent traces (1,000 agents, 33 GB; 3 rebuilt from the controller's event log) | dataset `HuggingFaceSwarms/pybot-traces` | `data/traces.sqlite` time index + HTTP range reads |
The same job also sums each agent's assistant messages (model calls, tool calls, input, output andreasoning tokens) in total and per hour; output tokens include reasoning tokens.21 unmodified lines
```python build/build_db.py TABLES_DIR BOARD_DIR traces_manifest.jsonl data/explorer.sqlitehf jobs uv run --flavor cpu-upgrade -v hf://buckets/HuggingFaceSwarms/pybot-traces:/src:ro --secrets HF_TOKEN \hf jobs uv run --flavor cpu-upgrade -v hf://datasets/HuggingFaceSwarms/pybot-traces:/src --secrets HF_TOKEN \ build/index_traces.py /src/traces /tmp/traces.sqlite HuggingFaceSwarms/pybot-explorer```
13 unmodified lines1415161717181920212281 unmodified lines104105106105107108109110190 unmodified lines30130230330230330430530630730813 unmodified linesROOT = Path(__file__).parentDATA = Path(os.environ.get("EXPLORER_DATA", ROOT / "data"))COMMITS_REPO = os.environ.get("COMMITS_REPO", "HuggingFaceSwarms/pybot-commits")TRACES_BUCKET = os.environ.get("TRACES_BUCKET", "HuggingFaceSwarms/pybot-traces")TRACES_REPO = os.environ.get("TRACES_REPO", "HuggingFaceSwarms/pybot-traces") # a dataset# Pinned so the trace index's byte offsets always match the bytes read; bump it if the trace files change.TRACES_REVISION = os.environ.get("TRACES_REVISION", "00c26ddf3e2afc6eb8bd3800ae66ca7e69a1a5f1")BOARD_URL = os.environ.get("BOARD_URL", "https://huggingfaceswarms-pybot-msgboard.hf.space")HUB = "https://huggingface.co"GIT_DIR = Path(os.environ.get("GIT_DIR_PATH", "/tmp/pybot-commits.git"))81 unmodified lines
def trace_url(lane, agent): return f"{HUB}/buckets/{TRACES_BUCKET}/resolve/traces/{lane}/{agent}.jsonl" return f"{HUB}/datasets/{TRACES_REPO}/blob/main/traces/{lane}/{agent}.jsonl"
def message_url(mid):190 unmodified lines
def read_range(lane, agent, start, end): from huggingface_hub import HfFileSystem # uses HF_TOKEN if set; the bucket is public return HfFileSystem().cat_file(f"buckets/{TRACES_BUCKET}/traces/{lane}/{agent}.jsonl", start=start, end=end) from huggingface_hub import HfFileSystem # uses HF_TOKEN if set; the dataset is public return HfFileSystem().cat_file(f"datasets/{TRACES_REPO}@{TRACES_REVISION}/traces/{lane}/{agent}.jsonl", start=start, end=end)
@app.get("/api/traces/{agent}", summary="An agent's trace records in a time window (paginated by byte cursor)")36 unmodified lines37383940414240414243444536 unmodified lines
## Data sourcesEverything is the scrubbed release data, cut at commit 24cbc04 (the board export runs ~1 day longer). API answers carry a `source` URL where a direct link exists (commit, file in a diff, merged PR, trace file, board post).- Agent traces: bucket https://huggingface.co/buckets/HuggingFaceSwarms/pybot-traces (traces/<lane>/<agent>.jsonl, traces/_manifest.jsonl, README, Apache-2.0). File URL: https://huggingface.co/buckets/HuggingFaceSwarms/pybot-traces/resolve/traces/<lane>/<agent>.jsonl `hf buckets cp hf://buckets/HuggingFaceSwarms/pybot-traces/traces/_manifest.jsonl .` `hf buckets sync hf://buckets/HuggingFaceSwarms/pybot-traces/traces/safety ./traces/safety`- Agent traces: dataset https://huggingface.co/datasets/HuggingFaceSwarms/pybot-traces (traces/<lane>/<agent>.jsonl, traces/_manifest.jsonl, README, Apache-2.0). File page: https://huggingface.co/datasets/HuggingFaceSwarms/pybot-traces/blob/main/traces/<lane>/<agent>.jsonl (download: /resolve/main/...) `hf download HuggingFaceSwarms/pybot-traces --repo-type dataset --include "traces/_manifest.jsonl" --local-dir pybot-traces` `hf download HuggingFaceSwarms/pybot-traces --repo-type dataset --include "traces/answers/*" --local-dir pybot-traces`- Message board: Space https://huggingface.co/spaces/HuggingFaceSwarms/pybot-msgboard (data/, start with data/manifest.json; web/reader.js decodes chunks). Viewer post link: https://huggingfaceswarms-pybot-msgboard.hf.space/#msg/<id> `hf download HuggingFaceSwarms/pybot-msgboard --repo-type space --local-dir pybot-msgboard`- Commits: dataset https://huggingface.co/datasets/HuggingFaceSwarms/pybot-commits (git history: 8,609 commits up to 24cbc04, plus one commit that adds the dataset card). Commit: /commit/<sha>; file: /blob/<sha>/<path>155 unmodified lines156157158159159160161162155 unmodified lines <div class="label">Agent · ${esc(a.lane || 'lane unknown')}</div><h1>${esc(a.name)}</h1> ${a.reconstructed ? RECON : ''} <p class="meta-line">${a.has_trace ? `trace ${time(a.first_ts).slice(0, 16)} → ${time(a.last_ts).slice(0, 16)} · ${d3.format(',')(a.records)} records · <a href="${a.source}" target="_blank" rel="noopener">trace file in the bucket ↗</a>` : 'no trace released for this agent'}</p> <a href="${a.source}" target="_blank" rel="noopener">trace file ↗</a>` : 'no trace released for this agent'}</p> <div class="meta">${stat('Model calls', fmt(a.model_calls))}${stat('Tool calls', fmt(a.tool_calls))}${stat('Input tokens', fmt(a.input_tokens))} ${stat('Output tokens', fmt(a.output_tokens))}${stat('Reasoning tokens', fmt(a.reasoning_tokens))}${stat('Board posts', fmt(a.posts))} ${stat('PRs opened / merged', `${a.prs_opened} / ${a.prs_merged}`)}${stat('Reviews given', fmt(a.reviews))}</div>355 unmodified lines356357358359359360361362177 unmodified lines540541542543544543544545546547548546547548549550355 unmodified lines const x = w[i], { recs: all, end } = await lastTurns(x, 1200), recs = all.slice(-12); if (!ok()) return; box.innerHTML = (x.reconstructed ? RECON : '') + `<p class="muted">${esc(x.agent)} · last ${recs.length} turns before ${x.role === 'author' ? 'the merge' : 'the review'} (${time(end).slice(11, 16)}); click a turn to open it · <a data-nav href="/commit/${ex.sha}?tab=traces">full trace →</a> · <a href="${x.source}" target="_blank" rel="noopener">trace file in the bucket ↗</a></p>` + (recs.map(miniTurn).join('') || '<p class="muted">No turns in this window.</p>'); · <a data-nav href="/commit/${ex.sha}?tab=traces">full trace →</a> · <a href="${x.source}" target="_blank" rel="noopener">trace file ↗</a></p>` + (recs.map(miniTurn).join('') || '<p class="muted">No turns in this window.</p>'); box.onclick = e => { const t = e.target.closest('.mturn'); if (t && !e.target.closest('a')) t.classList.toggle('open'); }; }; el.querySelector('.chips').onclick = e => { const b = e.target.closest('button'); if (b) show(+b.dataset.i).catch(err => box.innerHTML = errBox(err)); };177 unmodified lines
// ---------- data sources ----------const SOURCES = [ { name: 'Agent traces', kind: 'Bucket', repo: 'HuggingFaceSwarms/pybot-traces', url: 'https://huggingface.co/buckets/HuggingFaceSwarms/pybot-traces', what: 'Every agent\'s session log: 1,000 agents (3 rebuilt from the controller\'s event log, which may have gaps), 51.3M records, ~33 GB of Pi JSONL (session header, system/user/assistant/tool-result messages, controller events). README and Apache-2.0 licence in the bucket.', { name: 'Agent traces', kind: 'Dataset', repo: 'HuggingFaceSwarms/pybot-traces', url: 'https://huggingface.co/datasets/HuggingFaceSwarms/pybot-traces', what: 'Every agent\'s session log: 1,000 agents (3 rebuilt from the controller\'s event log, which may have gaps), 51.3M records, ~33 GB of Pi JSONL (session header, system/user/assistant/tool-result messages, controller events). README and Apache-2.0 licence in the dataset.', layout: 'traces/<lane>/<agent>.jsonl · traces/_manifest.jsonl (one row per agent)', cmds: ['hf buckets cp hf://buckets/HuggingFaceSwarms/pybot-traces/traces/_manifest.jsonl .', 'hf buckets cp hf://buckets/HuggingFaceSwarms/pybot-traces/traces/answers/agile-gorilla.jsonl .', 'hf buckets sync hf://buckets/HuggingFaceSwarms/pybot-traces/traces/safety ./traces/safety'] }, cmds: ['hf download HuggingFaceSwarms/pybot-traces --repo-type dataset --include "traces/_manifest.jsonl" --local-dir pybot-traces', 'hf download HuggingFaceSwarms/pybot-traces --repo-type dataset --include "traces/answers/*" --local-dir pybot-traces'] }, { name: 'Message board', kind: 'Space', repo: 'HuggingFaceSwarms/pybot-msgboard', url: 'https://huggingface.co/spaces/HuggingFaceSwarms/pybot-msgboard', viewer: 'https://huggingfaceswarms-pybot-msgboard.hf.space', what: 'What the agents said to each other: 184,059 messages in 12 channels, channel docs and stored files, with a read-only viewer (shared links: /#msg/<id>).',105 unmodified lines106107108109109110111112105 unmodified lines p2 = c.get(f"/api/traces/ann?from=2026-11-01T09:10:00Z&to=2026-11-01T09:30:00Z&limit=3&cursor={p1['next_cursor']}").json() assert [r["message"]["content"][0]["text"] for r in p2["records"]] == ["step 25", "step 30"] assert c.get("/api/traces/nobody").status_code == 404 assert p1["source"].endswith("/resolve/traces/lane1/ann.jsonl") and w["author"]["source"] == p1["source"] assert p1["source"].endswith("/blob/main/traces/lane1/ann.jsonl") and w["author"]["source"] == p1["source"]
def test_bad_inputs_are_400(client):README.md+2-2
app.py+6-4
llms.txt+3-3
static/agents.js+1-1
static/app.js+5-6
tests/test_api.py+1-1