optiq-lab-traces / README.md
codelion's picture
Point the default config at the Parquet shard
618ce49 verified
|
Raw
History Blame Contribute Delete
3.78 kB
---
task_categories:
- text-generation
tags:
- agent-traces
- format:agent-traces
- agent
- tool-use
- deep-research
- optiq
- optiq-lab
size_categories:
- n<1K
configs:
- config_name: default
data_files:
- split: train
path: data/*.parquet
---
# OptiQ Lab Traces
Research and tool-calling sessions produced by [**OptiQ Lab**](https://mlx-optiq.com/docs/lab/), the local web UI that ships with mlx-optiq. Each session is a complete run: a deep-research report built from live web sources, or a multi-turn agent loop driving the Lab's own sandboxed tools.
The dataset is **866 sessions in HuggingFace [Session-Traces format](https://huggingface.co/docs/hub/session-traces-format)** (the `agent-traces` viewer). Each `.jsonl` file is one session: a header line carrying the run's metadata, then one message per turn.
## The two halves
| | sessions | what a trace contains |
|---|---|---|
| **Deep research** | 605 | plan → first draft → rounds of draft-driven search → cited report |
| **Chat** | 261 | a tool-calling agent loop over `web_search`, `python` and `terminal` |
**Deep research** runs the TTD-DR loop: the model plans, writes a noisy first draft, and then each round searches against the draft's own gaps and folds the retrieved sources back in. Every model call in that loop appears as the prompt sent and the completion returned.
**Chat** is a genuine agent loop. The model chooses a tool, the Lab executes it in a sandboxed container, the result returns, and the model decides again. These traces carry real `toolCalls` and `toolCallId` records.
## Session header
Every session line carries `mode` (`deep_research` or `chat`), `model`, `domain`, `ok`, and `elapsed_s`.
Research sessions add:
| field | meaning |
|---|---|
| `sources` | pages actually retrieved and read |
| `citations` | distinct source markers used in the report body |
| `report_chars` | length of the final report |
| `model_calls` | model calls the loop made |
Chat sessions add:
| field | meaning |
|---|---|
| `turns_used` | assistant turns |
| `tool_calls` | tool calls issued |
| `tools_used` | which of the three tools appeared |
`citations` counts markers in the prose, not the appended reference list, so a run that retrieved five sources and cited none reads as `sources: 5, citations: 0`.
## Loading
The dataset preview is turned off. Each session is its own small `.jsonl`, and
at 866 files the preview worker spends longer opening them than its budget
allows, so it timed out and made a working dataset look broken. `load_dataset`
is unaffected.
```python
from datasets import load_dataset
ds = load_dataset("mlx-community/optiq-lab-traces", split="train")
# one session = one file; the header line carries the metadata
sessions = [r for r in ds if r["type"] == "session"]
research = [s for s in sessions if s["mode"] == "deep_research"]
```
## Generation
Research traces were generated against a local OpenAI-compatible endpoint served by `optiq serve`; chat traces against `deepseek/deepseek-v4-flash-0731`. The `model` field records which, per session. Questions and tasks span 43 domains for research and 25 for chat, from ML systems and cryptography through epidemiology and public policy.
The chat tools ran in the Lab's own sandbox: a container with no network and the Python standard library, which is why those traces use `math`, `statistics`, `json`, `csv` and `itertools` rather than numpy or pandas.
## Related
- [**OptiQ Code Traces**](https://huggingface.co/datasets/mlx-community/optiq-code-traces) — agentic software-engineering trajectories in the same format
- [mlx-optiq](https://mlx-optiq.com) — the toolkit that produced these
- [OptiQ Lab](https://mlx-optiq.com/docs/lab/) — quantize, fine-tune, research and chat, locally