Back to chat

About Rails AI Chat

Rails AI Chat is an open-source ChatGPT clone built with Ruby on Rails. It's designed to be a starting point for developers who want to explore AI integration in Rails applications, or who need a solid foundation to kick off their own AI-powered projects.

What is this?

This project demonstrates how to build a modern, streaming AI chat interface using Rails 8, Hotwire, and the ruby_llm gem. It supports multiple LLM providers (Gemini, OpenAI, Mistral) and features real-time streaming responses via Server-Sent Events.

Features

  • Real-time streaming responses
  • Multiple LLM providers (Gemini, OpenAI, Mistral)
  • Bring Your Own Key (BYOK) support — API keys stay in your browser
  • Markdown rendering for assistant responses
  • Dark mode with automatic system preference detection
  • Copy assistant messages to clipboard
  • Retry the last assistant response
  • Abort in-progress responses
  • Automatic conversation title generation
  • Session-based conversation isolation (no auth required)
  • Mobile and desktop friendly
  • Built with Rails 8, Hotwire, Stimulus, Tailwind CSS v4 and Ruby LLM

Get the code

The source code is available on GitHub. Feel free to fork it, learn from it, or use it as a starting point for your own project.


Built by Markos Fragkakis.