stream: true to receive the answer as server-sent events
while it is generated, instead of one JSON body at the end.
Event format
Each event is adata: line with one chat.completion.chunk, and the stream ends with data: [DONE]:
Token usage
To get the token counts of a stream, setstream_options.include_usage. The last chunk before data: [DONE] then
carries usage and an empty choices list:
Keep-alive comments
When a stream has nothing to send for a few seconds, such as while a long prompt is read, fastrun sends a comment line so that proxies and clients don’t close the connection:: are comments in the server-sent events format. OpenAI SDKs and other SSE clients skip them;
if you parse the stream yourself, skip them too.
Errors during a stream
If no GPU server has answered within 2 seconds, fastrun starts the response right away with status200 and keeps
it open with keep-alive comments until one does. If the request then fails, the status line has already been sent, so
the error arrives as an event instead:
error field. Treat
it like an HTTP error with the same code: see Errors and retries.

