Rolling Summaries for Lower-Cost Streaming Chat
§1 Long chat histories make every live reply more expensive
A streaming chat interface feels lightweight: someone sends a message, and the answer appears token by token. Behind that interface, however, your application may send the conversation history with every request. As the conversation grows, you repeatedly pay to process old messages alongside the latest question.
Tokens are the small chunks of text that models read and generate. Input tokens cover the material you send; output tokens cover the reply. Streaming changes how the reply arrives, not how much conversation history the model needs to read.
A rolling summary replaces older messages with a compact account of what still matters. You keep recent exchanges intact and update the summary as the conversation develops. This can reduce repeated input costs without forcing users to start over.
§2 A rolling summary acts like a conversation handover
Imagine handing a support conversation to a colleague. They do not need every greeting or abandoned idea. They need the customer's goal, relevant facts, decisions already made, and questions still open. A useful conversation summary serves the same purpose.
For example, an assistant helping someone build a booking app might preserve their chosen database, budget limit, authentication decision, and current bug. It can discard repeated explanations and approaches the user explicitly rejected.
- – Keep the user's current goal and any constraints that still apply.
- – Record confirmed facts, decisions, and unresolved questions.
- – Preserve exact identifiers when spelling matters, such as error codes or file paths.
- – Separate confirmed information from guesses and superseded choices.
The summary is not perfect memory. Important details can disappear during compression, so retain the original transcript separately when your privacy and retention policies allow it.
§3 Combine a compact summary with recent messages
A practical request contains four parts: your application instructions, the rolling summary, several recent conversation turns, and the new user message. Recent turns preserve wording and conversational flow; the summary supplies older context.
Keep application instructions outside the summary. Treat summarized conversation text as context, not as a new source of authority. Otherwise, an instruction copied from an old user message could accidentally look like an application rule.
Set a token budget rather than summarizing after every fixed number of messages. One message may contain a sentence; another may contain a large document. When the older history exceeds your budget, summarize it and leave the recent window untouched.
Ask the summarizer to update the existing summary using only the newly retired messages. Give it a maximum length and tell it to preserve unresolved details without inventing facts. Periodically check summary quality against the original transcript to catch drift.
§4 Count summary overhead before claiming token savings
Suppose a request would include 20,000 tokens of history. Replacing that history with a 1,000-token summary and 3,000 tokens of recent messages reduces the history portion to 4,000 tokens: an 80% reduction for that request.
That is not automatically an 80% reduction in your total bill. Creating the summary costs input and output tokens, and the latest message, instructions, and answer still count. Provider caching and different token prices can also change the result.
Measure total spend across a conversation, including summary generation. Track answer quality too. A cheaper request is not a win if lost context makes users repeat themselves.
§5 Keep summary work away from the live token stream
Streaming does not remove the time spent processing input before the first token arrives. A shorter context may help responsiveness, but actual latency depends on the model and service conditions.
Where possible, refresh the summary between turns rather than making the user wait for a separate summarization call before every answer. Store a completed summary atomically so a new request never reads a half-written version.
Fluxio fits applications that want streaming delivery and pay-per-token access through one API key. Its OpenAI-compatible interface lets you manage summaries in your application while routing live replies through the relay. Rolling summaries reduce the context you submit; Fluxio delivers the resulting answer token by token. Check current pricing and measure your own workload before choosing a setup.
Sign up for Fluxio.