
Tutorials 10 min read· Aug 11, 2026· By Tutorials
Build a chatbot in Rails — Hotwire streaming
Turbo Streams + TokenBazaar for a Ruby-native chat UI.
Rails 7's Turbo Streams pair beautifully with LLM streaming. Broadcast chunks to a partial as they arrive.
ruby
client = OpenAI::Client.new(access_token: ENV["TB_KEY"], uri_base: "https://tokenbazaar.in/api/public")
client.chat(parameters: { model: "openai/gpt-5.4-mini", messages: msgs, stream: ->(chunk) { broadcast(chunk) } })Models in this article
Review current prices, specifications and source-linked benchmarks.