Streaming
Streaming evaluation results and trace progress — SSE and WebSocket patterns.
Last updated
Was this helpful?
Streaming evaluation results and trace progress — SSE and WebSocket patterns.
Async evaluations and trace evaluations queue and run in the background. The default consumption pattern is polling (wait_for_completion() in the SDK). For responsive UIs, Stratix supports server-sent events (SSE).
CI / batch jobs — runs to completion, then exits
Single-shot scripts
Anywhere the caller is comfortable blocking for seconds-to-minutes
Dashboards showing live progress to a user
Long-running evaluations (large datasets, GEPA optimizations)
Multi-eval runs where you want incremental results as each completes
GET /api/v1/evaluations/{id}/stream
X-API-Key: ll_...
Accept: text/event-streamEvents emitted:
status
Current status (queued, running, completed, failed)
progress
{rows_complete: N, rows_total: M}
row_complete
Row-level result (one per scored example)
final
Final result object on completion
error
Error object on failure
Your backend consumes the SSE from Stratix; pipe events to the browser via your own SSE or WebSocket connection. See calling Stratix from a backend for the proxy shape.
The Python SDK exposes async iteration:
One concurrent stream per eval per consumer
Streams close after 60 minutes of inactivity (use polling for very long jobs)
Server-side reconnect is supported; client should resume with Last-Event-ID header
Last updated
Was this helpful?
Was this helpful?
async for event in client.evaluations.stream(eval_id):
if event.type == "row_complete":
print(event.row.score)
elif event.type == "final":
print("done:", event.result.accuracy)
break