The streaming endpoint runs the same three-stage council process as the blocking message endpoint, but instead of waiting for everything to finish it emits a Server-Sent Event (SSE) as each stage begins and completes. This lets your frontend update the UI progressively — showing Stage 1 model responses as soon as they arrive, then the peer rankings, then the chairman’s final answer — without holding open a long-polling request or managing complex state on the client.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/karpathy/llm-council/llms.txt
Use this file to discover all available pages before exploring further.
Stream a Message
POST /api/conversations/{conversation_id}/message/stream
Sends a user message and streams back stage progress as SSE. The response Content-Type is text/event-stream, and the server sets Cache-Control: no-cache and Connection: keep-alive to prevent buffering by intermediary proxies.
Path Parameters
UUID of an existing conversation. Create one first with
POST /api/conversations.Request Body
The user’s question or prompt text.
SSE Event Types
Each event arrives as a singledata: line containing a JSON payload, followed by a blank line. The type field in the payload identifies what stage the event corresponds to.
stage1_start
Emitted immediately when Stage 1 begins. All council models are queried in parallel from this point forward.
stage1_complete
Emitted when all council models have returned their responses. The data array contains one entry per model that responded successfully.
stage2_start
Emitted immediately when Stage 2 (peer review) begins. Responses from Stage 1 have been anonymized and are being distributed to evaluators.
stage2_complete
Emitted when all peer evaluations are collected and aggregate rankings computed. This event includes the metadata block — the only place in the SSE stream where label_to_model and aggregate_rankings appear.
label_to_model and aggregate_rankings are included only in the stage2_complete event. They are not present in stage1_complete or any other event, and they are not persisted to the conversation file on disk.stage3_start
Emitted when the chairman model begins synthesizing its final answer.
stage3_complete
Emitted when the chairman’s synthesized response is ready.
title_complete
Emitted only on the first message of a conversation, once the auto-generated title has been saved to disk. Title generation runs in parallel with Stage 1, so this event typically arrives around the same time as stage2_start.
complete
Emitted after all stages have finished and the full assistant message (stages 1–3) has been written to the conversation file. The stream closes after this event.
error
Emitted if an unhandled exception occurs during processing. The stream closes after this event. Note that individual model failures do not trigger this event — only a failure of the overall pipeline does.
Wire Format
SSE payloads are newline-delimited. Each event is adata: line followed by a blank line: