Model or dataset
crmne/ruby_llm avatar
crmne/ruby_llm

RubyLLM: A Ruby-Native Wrapper for Seventeen AI Providers

One delightful Ruby framework for every major AI provider. Build AI agents, chatbots, RAG apps, and multimodal workflows in beautiful, expressive code.

4,369 stars498 forksRubyMIT

At a glance

What is it?
RubyLLM gives Ruby and Rails developers one API for chat, vision, audio, documents, image and video generation, embeddings, reranking, moderation, tools, and agents across seventeen providers. The framework is active and at release candidate 2.0.0, but its breadth comes with a real learning curve and a dependency on provider-specific feature support.
Who is it for?
Adopt RubyLLM if you are a Ruby or Rails developer who wants a single, consistent API for multiple AI providers, especially if you value first-class Rails integration with Active Record, Active Storage, Hotwire streaming, and background jobs. Do not adopt it if you need the absolute latest provider-specific feature on day one, or if you prefer to control raw HTTP calls and provider SDKs directly.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Ruby, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What RubyLLM solves and who it targets

RubyLLM exists because Ruby developers who wanted to build AI features historically had to learn a different SDK for each provider: OpenAI, Anthropic, Google, AWS, and local models all ship their own clients with different request and response shapes. RubyLLM replaces that with one consistent interface. The README claims you can "build AI features the Ruby way" and shows a chat that works in two minutes. The target user is a Ruby or Rails developer who wants to add chat, tools, agents, image generation, or embeddings without switching languages or learning multiple vendor APIs. The project is battle-tested at Chat with Work, a private work AI product, which suggests real production use, though the README does not detail scale or traffic. The framework is not a language-agnostic gateway; it is written in Ruby and designed to feel native to that ecosystem, with ERB prompt templates and Active Record persistence for Rails apps.

The mechanism: one API, provider registry, and modality dispatch

RubyLLM works by exposing a set of top-level methods that each map to a provider capability. For example, RubyLLM.chat returns a chat object, RubyLLM.paint generates images, RubyLLM.animate generates videos, RubyLLM.embed creates embeddings, RubyLLM.rerank orders retrieval results, RubyLLM.transcribe handles speech to text, RubyLLM.speak does text to speech, RubyLLM.ocr extracts document text as markdown, and RubyLLM.moderate checks content. Each method takes a model name, and the framework maintains a model registry that knows which providers support which modalities. The README shows that you can pass a file to a chat ask call, and the framework decides if the model supports that input type, as in the example with gemini-3.7-flash handling an image, video, audio, or PDF. Underneath, the framework handles tool calls, usage ledger, and batches, so you do not manage those details. For structured output, you define a Ruby schema using the Schematist library and read response.parsed. For agents, you subclass RubyLLM::Agent, set a model and instructions, and attach tools. The agentic loop is exposed through ask_later, step, and complete? so you can drive it manually instead of using the built-in loop.

Getting it running: install, configure, and first commands

The README points to a Getting Started page for installation and provider configuration, but it does not include the actual gem install or API key setup commands in the cleaned material. The examples use version 2.0.0.rc2, so you would install that release candidate to match the documented API. The core entry points are simple. You start a chat with RubyLLM.chat and call ask, optionally passing a block to stream chunks. To add tools, you define a class that inherits from RubyLLM::Tool, implement execute with keyword arguments, and pass it to with_tools. For an agent, you subclass RubyLLM::Agent, declare a model and instructions, then instantiate and ask. Structured output uses a schema class from Schematist, which is not part of RubyLLM itself but is shown as the way to define fields. The README also shows Rails-specific integration: the API works on your own Chat and Message records, uses Active Storage for attachments, supports Hotwire streaming, and provides generators. There is no command line tool visible; this is a library you require in your Ruby project.

Limits and failure modes: provider coverage and version churn

The most obvious limitation is that RubyLLM is a wrapper, so you are at the mercy of what the provider registry knows. The README says seventeen providers are built in, and you can connect any OpenAI-compatible endpoint, but it does not list which models are available for which capabilities. If you need a brand-new model that is not in the registry, you may have to wait for a gem update or fall back to a raw client. The framework also relies on each provider supporting the same feature set. The README carefully says "with a model that supports their input types," which means not every model can handle every file type. Video generation with RubyLLM.animate is shown, but only certain providers likely support it. Another failure mode is the 2.0.0 release candidate status. The examples are explicitly for 2.0.0.rc2, and the project has two release candidates within two days, followed by a stable 1.16.0 from three months earlier. That suggests the API may still shift before final release. If you build on the release candidate, expect breaking changes. The README also mentions tool approval with requires_approval, which pauses a run until a human approves, but does not explain how that interacts with streaming or background jobs, so you would need to read deeper documentation.

Alternatives: raw SDKs versus other multi-provider gems

The direct alternative is to use each provider's official Ruby SDK, such as the openai gem or the anthropic gem, and write your own abstraction layer. That gives you immediate access to new features and full control over request parameters, but it means maintaining multiple integration paths and normalizing responses yourself. Another alternative is to use a language-agnostic gateway or proxy that exposes an OpenAI-compatible API, then use a single OpenAI SDK from Ruby. That approach centralizes provider switching at the network layer, but it adds a service to operate and does not give you Ruby-native objects for media files or tool calls. RubyLLM differs by doing the abstraction inside Ruby, with a model registry that hides which provider is behind a model name. It also goes further than a simple HTTP wrapper by providing Rails integration, a usage ledger, streaming blocks, and a tool framework. If you only need one provider, the official SDK is lighter. If you need many providers and want to stay in Ruby, RubyLLM is the more complete package, but you trade version lag for convenience.

Maintenance and licence considerations

RubyLLM is released under the MIT licence, which means you can use it in commercial projects with few restrictions, though you should read the licence text for exact terms. The repository is not archived, and the last push was September 2026, with a 2.0.0.rc2 release on the same day. That indicates active maintenance, but the release candidate status is a caution flag for production use. The README says the framework has "a handful of small dependencies," which is a positive for maintenance, as it reduces supply chain risk and upgrade friction. However, the project depends on each provider's API remaining stable, and providers change endpoints and model names frequently. When a provider updates, RubyLLM must release a new version to update its registry. If you pin an older version, you may lose access to new models. The framework also depends on Schematist for structured output, which is a separate library, so you would track its updates as well. There is no mention of a migration guide between 1.x and 2.0, so upgrading from the stable 1.16.0 to the release candidate may require manual changes based on the API differences shown in the README examples.

Editorial conclusion

Adopt RubyLLM if you are a Ruby or Rails developer who wants a single, consistent API for multiple AI providers, especially if you value first-class Rails integration with Active Record, Active Storage, Hotwire streaming, and background jobs. Do not adopt it if you need the absolute latest provider-specific feature on day one, or if you prefer to control raw HTTP calls and provider SDKs directly. Before committing, verify that the models you plan to use are in the built-in registry for the 2.0.0 release, check how the release candidate's API changes affect your existing code, and confirm that the provider endpoints you rely on are supported for the specific modality (vision, audio, video) you need. The framework's breadth is its main strength, but it is a wrapper, so you are trading direct control for convenience, and the 2.0.0 release candidate signals that breaking changes are still possible.

Official sources

  1. crmne/ruby_llm on GitHub
  2. License: MIT
  3. Project website
  4. README
  5. Releases
Community notes

Community notes