4 ms·
I have been working with streaming LLMs and Server Sent Events. It provides a very simple interface to work with, but you can feel SSE was never designed for th
by Yanael 2y ago
I have been working with streaming LLMs and Server Sent Events. It provides a very simple interface to work with, but you can feel SSE was never designed for this use case. As mentioned in the blog post:
> Annoyingly these can't be directly consumed using the browser EventSource API because that only works for GET requests, and these APIs all use POST.
It is not designed to send data to open a connection. You will then struggle to work with this streaming approach using frameworks and libraries that are based on the EventSource API.
- ekojs 2y agoEventSource is really really limited. However, you can instead use Fetch via something like https://github.com/Azure/fetch-event-source https://github.com/Azure/fetch-event-source to consume SSEs.
- Yanael 2y agoThis looks very good. The Fetch API is a nice one, so leveraging it sounds perfect. Thanks for the link.
- deleted 2y ago[deleted]