Docs/Get started
Quickstart
Install tracetune, point it at a trace file, and get a training dataset in about a minute.
Install
uv tool install tracetune
tracetune --version
Prefer another tool? pipx install tracetune works too, as does pip install tracetune inside a virtual environment. On Ubuntu and Debian, plain pip install outside a virtual environment is blocked by the system, so use one of these.
Prepare your traces
tracetune reads a JSONL file: one JSON object per line, one line per agent run. Each trace needs a trace_id, an input and an output. See the trace format for every field.
cat > traces.jsonl <<'EOF'
{"trace_id":"t1","input":"How many customers are in Delhi?","steps":[{"name":"run_sql","args":{"query":"SELECT COUNT(*) FROM customers WHERE city='Delhi'"},"result":"3"}],"output":"Answer: 3","feedback":1}
{"trace_id":"t2","input":"Top product?","output":"I don't know","feedback":-1}
{"trace_id":"t3","input":"Total revenue?","output":"","error":"timeout"}
EOF
Build the dataset
tracetune build --traces traces.jsonl --out dataset.jsonl
traces read : 3
kept : 1 -> dataset.jsonl
dropped : 2
- negative_feedback: 1
- trace_error: 1
dataset.jsonl now holds the good run in chat format, ready for a trainer such as TRL or Unsloth.
Tune the selection
| Option | Default | Effect |
|---|---|---|
--min-score |
0.0 |
Keep traces scoring at least this much. Raise it to be stricter. |
--dedup |
best |
best keeps only the highest-scoring run for each identical question. none keeps every run. |
How the score is built is explained in Scoring and deduplication and Reward design.
Collect traces automatically
To receive traces from a running agent, start the collector:
make up
curl -i -X POST localhost:8080/v1/traces -d '{"trace_id":"a","input":"hi","output":"hello"}'
It listens on 127.0.0.1 only by default. Read Security before exposing it to other machines.