llm-coalesce · step 1 demochecking provider…

One call, many widgets

Every widget below wants the same answer at the same moment. The Node server behind this page is deliberately dumb — it has no idea what coalescing is; every request it receives triggers a real provider call. The coalescing happens entirely in this page's JavaScript, imported from the real llm-coalesce npm package (not a copy of it): on the left, each widget calls this demo's own createSSEStream() helper on its own; on the right, widgets go through the package's coalescer.stream(), and only the first one actually reaches the server. llm-coalesce itself never parses SSE or talks to any provider — it only ever sees a plain async stream, supplied by the caller. Watch the provider-call counters — they count actual stream responses received by this page.

WIDGETS

Without coalescing

each widget calls fetch() on its own
0
stream responses received
0
tokens generated
Press "Run demo" to start.

With llm-coalesce

widgets share one client-side registry entry
0
stream responses received
0
tokens generated
Press "Run demo" to start.