crmne/ruby_llm
One delightful Ruby framework for every major AI provider. Build AI agents, chatbots, RAG apps, and multimodal workflows in beautiful, expressive code.
What it solves
RubyLLM is a unified framework for integrating AI capabilities into Ruby and Rails applications. It eliminates the need to manage multiple bloated provider-specific clients and inconsistent API formats by providing a single, consistent interface for various LLM providers.
How it works
The framework provides a high-level Ruby API to interact with a wide range of AI models (including OpenAI, Anthropic, Google, and local models via Ollama). It abstracts the model-specific logic, allowing developers to switch providers without rewriting code. It supports multimodal inputs (images, videos, audio, and documents) and provides built-in tools for creating agents, handling structured JSON outputs, and integrating directly with Rails via ActiveRecord.
Who it’s for
Ruby and Rails developers who want to build AI-powered features like chatbots, agents, and RAG systems without being locked into a single AI provider's SDK.
Highlights
- Unified Interface: One API for OpenAI, xAI, Anthropic, Gemini, VertexAI, Bedrock, DeepSeek, Mistral, Ollama, and more.
- Multimodal Support: Native handling of images, video, audio transcription, and document extraction (PDFs, CSVs, etc.).
- Agentic Capabilities: Built-in support for creating reusable agents with specific instructions and custom Ruby tools.
- Rails Integration: Includes
acts_as_chatfor ActiveRecord and an optional ready-to-use chat UI. - Advanced AI Features: Support for streaming responses, structured output via schemas, embeddings, and provider-side batch processing.
- Lightweight: Minimal dependencies (Faraday, Zeitwerk, and Marcel).