Trace-to-Preference
v0.26.0 turns traffic logs into DPO / KTO training data. Point soup data from-traces at LangChain, OpenAI, or Soup-serve logs. Soup extracts preference signals — thumbs, regenerations, user edits — and writes clean pairs.
Ingest a log
soup data from-traces \
--logs chat_logs.jsonl \
--format langchain \
--signal thumbs_up \
--output prefs.jsonlFlags
| Flag | Meaning |
|---|---|
--logs | JSONL trace file (or a directory for the soup-serve format) |
--format | langchain · openai · soup-serve |
--signal | thumbs_up · regenerations · user_edit |
--output / -o | Destination JSONL (default prefs.jsonl) |
--judge | Keep only pairs an LLM judge agrees with |
--judge-provider | openai · server · ollama |
--judge-model | Model id for the judge |
--judge-api-base | Judge endpoint, validated against the SSRF guard: plain HTTP only for loopback, HTTPS for anything else, and since v0.75.2 never an IP address in a private, link-local or reserved range (see what v0.75.2 refuses) |
--min-confidence | Judge-confidence floor, default 0.7 |
Signals
thumbs_up— a prompt with both a thumbs-up and a thumbs-down response becomes a pair: the thumbed-up output is chosen, the thumbed-down one rejected. A prompt with only thumbs-up feedback yields no pairregenerations— if the user hit regenerate, the later response is preferreduser_edit— if the user rewrote the response, the edit becomes chosen
Review before training
soup data review prefs.jsonl --sample 10Previews the first N pairs in the file, in file order (--sample / -s, 1 to 100, default 10), each with its prompt, chosen and rejected text cut to 400 characters. It is not a random sample, so it will not show you problems that only occur later in the file. Use it as a sanity check before burning a GPU on junk data.
Train on them
DPO or KTO — the output format of from-traces matches both:
task: dpo
data:
train: prefs.jsonl
format: dpoSafety
- Logs never execute model code — parsers only read JSON.
- Traces may contain PII or secrets; Soup warns on ingest and leaves scrubbing to you before sharing pairs externally.
- Output JSONL can be validated with the same
soup data validatepipeline as any other dataset.
See also
Soup is free and Apache-2.0. If it saved you a training run, starring the repo costs nothing and helps most. You can also fund the GPU time behind the work a 4 GB laptop cannot reach.