Keel's Laravel chat streams AI tokens via Livewire without websockets or Node
A Keel starter kit developer describes streaming AI chat replies in Laravel 13 using a single Livewire component, avoiding websocket servers, Node sidecars, and pub/sub services. The ChatBox component forwards each provider token to the browser with Livewire's built-in stream method while accumulating the full reply on the server. Each reply runs as one long-lived HTTP request, which keeps message ordering and credit metering simple, at the cost of holding a PHP worker for the duration. Credit balance checks, transactional re-checks, and rate limiting fail cleanly as form errors, and the deployment needs no extra realtime services. The author notes a queue plus Reverb setup as the likely next step if concurrency grows.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in