Back
RubyLLM: a Ruby framework for all major AI providers
SiTech AI Team2 წთ. საკითხავი

RubyLLM: a Ruby framework for all major AI providers

RubyLLM 2.0.0 ships as a single gem that handles chat, tools, streaming and structured output across major AI providers, with Rails integration and a built-in skill for coding agents.

One line to start

RubyLLM, a Ruby gem that wraps the APIs of major AI providers behind a single interface, is documented with version 2.0.0 in its installation command: bundle add ruby_llm --version 2.0.0. A chat session starts with one call — RubyLLM.chat.ask "What's the best way to learn Ruby?" — and the framework keeps the conversation history, so follow-up questions stay in context.

The library covers what developers usually assemble by hand: sending images, audio recordings and PDFs to a model, streaming responses into a terminal or a Rails view, defining tools as Ruby classes with an execute method, and requesting structured output through a Ruby schema that comes back as a hash.

Agents, batches and provider tools

Beyond basic chat, RubyLLM defines agents as Ruby classes that bundle a model, instructions and tools, and it can run many chats in parallel through ask_later and RubyLLM.batch. The framework also exposes embeddings and reranking, prompt caching, usage tracking with token and cost figures, and provider-side tools such as web search with citations. Media capabilities are included as well: transcription, speech synthesis, OCR, image generation and video generation, plus a moderation call that returns a flagged status.

RubyLLM is designed to feel native to Rails. Conversations can be stored with Active Record and streamed with Hotwire, and generators produce a working chat interface together with agent, tool and schema skeletons.

What developers say

The project publishes testimonials from teams that replaced their own provider layers. Jorge Manrubia, principal programmer at 37signals, says the company uses the OpenAI API through RubyLLM. Nick Warwick of Nodal Networks describes rebuilding a failing LangGraph agent with the gem: “Not only was it far simpler, it performed better.” Brendan Samek of Build Canada says his team's unified AI interface had accumulated cruft while serving more than 100,000 end users at Yuma. Others highlight the Rails integration, multi-provider support and the small amount of code left behind after adoption.

The gem also ships with a skill for coding agents, installed from the bundle path with npx skills add "$(bundle show ruby_llm)" --skill rubyllm, which gives an assistant the API surface, examples and Rails conventions of the project.

SSiTech

SiTech — AI-powered web development

We build fast, modern websites and bring AI into real business workflows. Have a project or a question? We'd love to help.