Guide

Stream LLM tokens the Rails way.

ActionCable + Turbo Streams + one DSL directive. Your chat UI updates token-by-token with zero custom JavaScript.

Turn on streaming

class Concierge < RailsAgents::Base
  model "gpt-4o"
  stream :tokens, to: :turbo
end

Render in the view

<%= turbo_stream_from @conversation %>
<agent-stream conversation="<%= @conversation.id %>"></agent-stream>