Replay & diff
The drop-in SDKs can capture each call’s prompt and reply (captureContent, off
by default; secrets are scrubbed server-side). With that captured content, Lookspan
can close the loop from observe to improve: replay a trace’s prompt and
diff the result against the original.
Provide a key
Section titled “Provide a key”Replay calls a real provider, so it needs an API key. Keys live in memory only — never written to the database or logged:
LOOKSPAN_OPENAI_API_KEY=sk-... npx lookspan# ...or LOOKSPAN_ANTHROPIC_API_KEY / --openai-key / --anthropic-keyReplay a trace
Section titled “Replay a trace”From the dashboard, open a trace and use the Replay & judge panel. Or call the API directly:
# Replay the captured prompt against another model and diff cost/latency/outputcurl -X POST localhost:3100/api/traces/<id>/replay \ -H 'content-type: application/json' \ -d '{"model":"gpt-4o-mini"}' # omit "model" to re-run the originalThe replay request body accepts { model?, provider?, spanId? }:
- omit
modelto re-run against the original model (catch nondeterminism / drift), - set
model(and optionallyprovider) to try a cheaper or stronger model, - set
spanIdto replay a specific span within the trace.
Lookspan runs the prompt, records a new replay, and shows the diff — cost, latency and output side-by-side against the original run. List past replays with:
curl localhost:3100/api/traces/<id>/replaysKeeping content out
Section titled “Keeping content out”Replay only works for spans whose content was captured. Content is omitted by
default; pass { captureContent: true } to observeOpenAI / observeAnthropic
only when the prompt and reply are safe to persist.
Lookspan is part of Fervon, the autonomous software studio of Jonathan Martín — local-first developer tools built by fleets of AI agents.