Same client-side principle I use for a colour-by-letter PDF generator. Browser-only really is the right answer for these single-use file tools. Curious what you're using for the PDF assembly, pdf-lib or something else?
Can it be used easily for streaming things other than AI tokens? Long-running progress updates, log tails, SSE for webhook fanout, the OpenSwoole base seems like it should support these but curious how friction-free that is in practice.