--- license: apache-2.0 pretty_name: CC Traces — Weka (April 2026) task_categories: - text-generation tags: - llm - inference - benchmarking - kv-cache - agentic - multi-turn - claude size_categories: - n<1K configs: - config_name: default data_files: - split: train path: traces.jsonl --- # CC Traces — Weka (April 2026) A collection of **739 multi-turn agentic traces** (≈ 59.3k individual model requests) driven by `claude-opus-4-5-20251101`. Each trace captures the full request/response sequence of a single agent session, including per-request KV block hashes, so the dataset can be replayed against an inference engine or used to simulate prefix-cache behavior offline. - **Traces:** 739 - **Requests:** 59,274 total, mean **80.2** per trace, max **1,178** - **Model:** `claude-opus-4-5-20251101` - **KV block size:** 64 tokens - **Hash scope:** `local` — block hash IDs are only comparable *within* a single trace; they are not a global content-addressable identity. ## What's in each trace Top-level trace fields: | field | type | description | |-----------------|------------------|-----------------------------------------------------| | `id` | str | Trace identifier, e.g. `trace_0001` | | `models` | list[str] | Models used by the trace (all one entry here) | | `block_size` | int | KV block size used to derive `hash_ids` (64) | | `hash_id_scope` | str | `local` — hash IDs are per-trace, not global | | `tool_tokens` | int | Size of the tool-definition block for the session | | `system_tokens` | int | Size of the system prompt for the session | | `requests` | list[object] | Ordered list of per-request records | Each entry in `requests` is: | field | type | description | |----------------|-------------|----------------------------------------------------------------| | `t` | float | Seconds since start of trace | | `type` | str | Request type marker (e.g. `n`) | | `model` | str | Target model for this request | | `in` | int | Input tokens (ISL) | | `out` | int | Output tokens (OSL) | | `hash_ids` | list[int] | Block-hash IDs for the input, one per 64-token block | | `input_types` | list[str] | Content kinds in the input (`text`, `tool_result`, …) | | `output_types` | list[str] | Content kinds in the output (`text`, `thinking`, `tool_use`, …) | | `stop` | str | Stop reason (`tool_use`, `end_turn`, …) | | `api_time` | float | End-to-end server time for this call (seconds) | | `think_time` | float | Client think/tool time between this request and the next (s) | `hash_ids` make the dataset unusually useful for KV-cache work: the contiguous common prefix between turn *t* and turn *t − 1* exactly measures the portion of the input that a local prefix cache would be able to reuse. ## Summary statistics | metric | p50 | p75 | p90 | p95 | mean | |---------------------|--------:|--------:|--------:|--------:|------:| | ISL (input tokens) | 109,903 | 150,308 | 300,118 | 395,328 |139,925| | OSL (output tokens) | 218 | 441 | 937 | 1,563 | 446 | | `think_time` (s) | 10 | 30 | 154 | 435 | 199 | | `api_time` (s) | 6.47 | 11.02 | 19.50 | 29.63 | 10.18 | | requests / trace | 48 | 101 | 201 | 253 | 80.2 | Aggregate prefix-KV-cache hit rate across **all** requests and **all** traces: **96.57 %** of the 129,409,824 blocks would have been served from a local prefix cache (incl. turn 0 which can never hit). ## Plots All plots below were produced from the full dataset with the analysis script published alongside the repo. Vertical dashed lines mark p50 / p75 / p90 / p95. ### Input sequence length (ISL) Agentic traces accumulate a very large context over time — the median turn sends ~110k tokens of input, and the p95 exceeds 395k. ![ISL — log x](plots/isl_hist_log.png) ![ISL — linear x](plots/isl_hist_linear.png) ### Output sequence length (OSL) Outputs are short by comparison: most turns produce a tool call or a brief text response. The median is 218 tokens and p95 is ~1,600. ![OSL — log x](plots/osl_hist_log.png) ![OSL — linear x](plots/osl_hist_linear.png) ### Client think time Time between a completed response and the next request — this includes local tool execution, user wait time, etc. The distribution has an extreme heavy tail (p95 ≈ 7 min, p99 ≈ 50 min). The linear plot also shows the large spike at `0 s` (≈888 requests fired back-to-back). ![Think time — linear x](plots/think_time_hist_linear.png) ![Think time — log x, zeros excluded](plots/think_time_pos_log.png) ### Prefix KV cache behavior Because this is a sequence of agentic turns on the same conversation, the hit rate of a local prefix cache is **extremely high** — almost every turn reuses nearly the full preceding context. **Per-request hit rate.** The distribution is saturated near 1.0: ![Prefix hit rate histogram](plots/kv_hit_rate_prefix_hist.png) **Per-request miss rate (log x).** Viewing `1 − hit_rate` on a log axis is more informative; most turns miss <2 % of blocks, but there's a visible secondary mode near 1.0 corresponding to conversation resets / compaction: ![Prefix miss rate histogram](plots/kv_miss_rate_prefix_hist.png) **New tokens to prefill per request.** Tokens the prefix cache did *not* cover — i.e. the work an engine actually has to do on prefill: ![New tokens per request](plots/kv_new_tokens_hist.png) **Hit rate across turns.** After the first couple of turns the mean hit rate stabilizes around 0.97, with occasional dips wherever the client compacts or rebuilds the context: ![Prefix hit rate vs turn index](plots/kv_hit_rate_vs_turn.png) **Cached tokens vs ISL.** Each point is one (non-first) request. Most sit on the *y = x* line (fully cacheable). The distinctive horizontal band near *y = 0* is the compaction/reset cluster: ![Cached tokens vs ISL](plots/kv_cached_tokens_vs_isl.png) ## Intended uses - **Inference benchmarking:** replay traces against a serving engine (vLLM, SGLang, TRT-LLM, etc.) to measure throughput / latency under a realistic agentic workload. - **KV-cache research:** the `hash_ids` field exposes block-level prefix structure directly, without needing to re-tokenize any text. - **Capacity planning:** the ISL / OSL / think-time distributions are a reasonable first-order model of traffic from long-context agentic clients. ## Loading ```python from datasets import load_dataset ds = load_dataset("semianalysisai/cc-traces-weka-042026", split="train") print(ds[0]["id"], len(ds[0]["requests"])) ``` ## License & attribution Released under the **Apache 2.0** license. Credit: **Callan Fox**.