Ruby Llm

Ruby Llm

RubyLLM is the Ruby-native AI framework: 19 providers, one API for chat, agents, tools, and RAG.

70/100Safe BetFreeFree

If your stack is Ruby, RubyLLM removes the usual fork in the road between adopting an AI feature and adopting a second language ecosystem. The 2.1 stable line covers the unglamorous parts — batching, evaluations, caching, cost tracking, MCP — that decide whether a prototype survives contact with production. Skip it if you need a non-Ruby client or want a hosted dashboard rather than a gem you own.

Verified 4d ago · liveness 70/100 · cite: rightaichoice.com/tools/ruby-llm

Best for
  • Ruby and Rails teams adding chat, agents, or RAG to an app already in production
  • Shops that want one API across 19 providers, including local models via Ollama
  • Rails apps that need conversations persisted in Active Record and streamed with Hotwire
  • Developers building tool-calling agents and structured-output pipelines in plain Ruby
Not ideal for
  • Non-Ruby teams — RubyLLM ships no Python or JavaScript client
  • Anyone wanting a no-code or visual AI builder instead of a gem
  • Teams that want a hosted platform owning API keys and dashboards
Visit Website

IntermediateFor a Rails developer, first value arrives quickly: `bundle add ruby_llm --version 2.0.0`, then `bin/rails generate ruby_llm:install` and `bin/rails db:migrate`, and a single `RubyLLM.chat.ask` returns a response. Adding the scaffolded chat UI is one more generator and a `bin/rails server`. Expect longer if you are wiring an agent with real tools, since that means writing tool classes and testingAPIAPI availableVerified 4d ago
Pricing
Free
FreeFree tier3 hidden costs
Learning curve
Intermediate
For a Rails developer, first value arrives quickly: `bundle add ruby_llm --version 2.0.0`, then `bin/rails generate ruby_llm:install` and `bin/rails db:migrate`, and a single `RubyLLM.chat.ask` returns a response. Adding the scaffolded chat UI is one more generator and a `bin/rails server`. Expect longer if you are wiring an agent with real tools, since that means writing tool classes and testing
Runs on
API
API available · 13 integrations
Who it's for
Rails developer adding a first AI featureBackend engineer building a tool-calling agentPlatform engineer running batch summarization
Live sentiment
Is Ruby Llm actually worth it?

We scan live Reddit threads, YouTube comments, X posts, G2 reviews and other communities — and hand you an honest verdict in under a minute.

  • Honest verdict, not marketing
  • Real pros & cons from real users
  • Attributed quotes with receipts
Run a free scan

3 free scans · no card needed

Skip it if

Skip RubyLLM if your team does not write Ruby — there is no Python or JavaScript client, and the framework, generators, and Active Record persistence all live in the Ruby and Rails ecosystem.

The 30-second take
Biggest gripe

The gem is free, but every model call bills against your own provider account — a Claude Opus 5 request at $5 per million input tokens and $20 per million output tokens is your invoice, not RubyLLM's.

Price reality

The gem itself costs nothing to install via `bundle add ruby_llm`. What you actually pay is your model provider bill, and RubyLLM is unusual in surfacing that number directly: the model registry lists USD per million text tokens for 1,874 models with cache read and cache write rates shown under input prices, and every response exposes `response.cost.total`. That transparency makes it easy to compare a $5/$25-per-million Claude Opus 4.5 call against a $2/$10 Claude Sonnet 5 call before you

In short

Ruby Llm — RubyLLM is the Ruby-native AI framework: 19 providers, one API for chat, agents, tools, and RAG. Best for Ruby and Rails teams adding chat, agents, or RAG to an app already in production, Shops that want one API across 19 providers, including local models via Ollama, Rails apps that need conversations persisted in Active Record and streamed with Hotwire. Free to use.

What's new in Ruby Llm

Checked 5 days ago

Across the latest 1 update: 1 feature update.

What people actually say about Ruby Llm — is it worth it?

We ran a structured research pass across product reviews, community discussions, and post-purchase forum threads to surface the patterns vendors won't publish themselves. Below: the recurring strengths, the hidden costs people mention most, and the cohort that consistently regrets adopting this tool.

41 mentions across 2 sources (Hacker News, Lemmy) · researched Jul 3, 2026.

65% positive35% critical

Average across the 2 sources that answered — each source counts once, not each post.

Recurring strengths
  • +Elegant ActiveRecord-like DSL for chaining AI methods.
  • +Unified interface across 20+ AI providers.
  • +Minimal dependencies: only Faraday, Zeitwerk, and Marcel.
  • +Rails integration via acts_as_chat and ActiveRecord.
  • +Async, fiber-based concurrency for non-blocking calls.
Recurring frustrations
  • −Cache does not always work, causing wasted API calls.
  • −Protocol mapping between providers can be fragile.
  • −Limited community outside of sparse HN/Lemmy posts.
  • −Local model performance can be very slow.
  • −Advanced features like agents have a learning curve.
Patterns worth knowing
Elegant DSL and Rails integration praised as standout features
Seen on Hacker News, Lemmy
Cache and protocol mapping issues cause frustration in production
Seen on Hacker News
Multi-provider abstraction is a key differentiator vs. provider-specific SDKs
Seen on Hacker News
Learning curve
intermediateProductive in ~A few hours
Hidden costs people mention
  • • API usage costs from providers (OpenAI, etc.)
  • • Potential extra costs from ineffective caching

Viability Score

70/100
Safe Bet

How well maintained and how widely used is Ruby Llm? Built from what the vendor actually publishes (docs, changelog, tutorials, integrations, pricing), whether the site is live, and how much real users discuss it. How we calculate this

Recent activity
90
Traction
100
Site health
95
User sentiment
65
What the vendor publishes
20

Last calculated: October 2026

How we score →

Key Features

  • Chat with any registered model through RubyLLM.chat and keep conversation history
  • Stream responses by passing a block to chat.ask for terminals or Rails views
  • Attach images, audio recordings, and PDFs with with:, from paths or URLs
  • Define tools as RubyLLM::Tool subclasses with description and execute
  • Mark tools requires_approval for irreversible actions like issuing refunds
  • Connect MCP servers with RubyLLM::MCP and expose only the tools you choose
  • Define agents as RubyLLM::Agent classes with model and instructions
  • Get structured output from Schematist schemas and read response.parsed
  • Run agent evaluations with RubyLLM::Evaluation from Ruby, RSpec, Minitest, or Rake
  • Batch many chats with RubyLLM.batch for large backfills
  • Cache long prompts with with_caching and cache_until_here
  • Use provider tools like web search with with_provider_tools and response.citations
  • Generate embeddings with RubyLLM.embed and rerank with RubyLLM.rerank
  • Transcribe audio with RubyLLM.transcribe and synthesize with RubyLLM.speak
  • OCR scanned documents with RubyLLM.ocr and read document.markdown

About Ruby Llm

FreeIntermediateAPI availableAPI

RubyLLM is a Ruby gem that gives Rails and plain-Ruby developers one consistent API for chat, agents, tools, structured output, embeddings, audio, images, video, OCR, and moderation. Install with `bundle add ruby_llm --version 2.1.1`, then `RubyLLM.chat` starts a conversation that keeps history across follow-ups — no orchestration layer, no Python sidecar. You pick a provider by configuration and swap hosted for local without rewriting application code. The feature set spans more than chat. Pass a block to stream chunks into a terminal or a Rails view. Attach images, audio, or PDFs with `with:`. Define deterministic functions as `RubyLLM::Tool` subclasses with an `execute` method, and connect Model Context Protocol servers by describing them in a Ruby class with `with_mcp`. Schematist schemas drive structured output you read from `response.parsed`, and `RubyLLM::Agent` subclasses bundle a model plus instructions into something you instantiate per request. The 2.1 line rounds out the production pieces: evaluations run in Ruby, RSpec, Minitest, or Rake; batching fans out many chats; prompt caching via `with_caching` and `cache_until_here`; provider tools like web search with `response.citations`; usage and cost reads on every response; OpenTelemetry tracing. Fallbacks, retries, per-tenant configuration, and `ask_later` for cross-job resumption handle the operational edges. Rails gets its own path: generators scaffold Active Record chat and message models, Active Storage attachments, an Active Job response job, and a Hotwire chat UI. The gem also ships a skill for coding agents. Choose it over hosted AgentOps platforms when the AI belongs inside your app; choose it over Python frameworks when your team is Ruby. Note: the vendor page lists version 2.1.1 as stable and 1.16.0 in the version menu; the newest changelog entry we have covers the 1.16.0 release.

Behind the Verdict

The question worth asking about any AI framework is where it stops being helpful. RubyLLM's boundary is Ruby itself. There is no Python or JavaScript client, so a polyglot team standardizing on TypeScript will end up maintaining two integration paths, one of which RubyLLM cannot serve. Where it earns its place is the Rails shop with an app already in production. Running `rails generate ruby_llm:install` plus `chat_ui` gets a scaffolded conversation model, controller, view, and background job — the plumbing that otherwise eats a sprint. Prompt templates live in ERB; attachments go through Active Storage; replies stream over Turbo Streams. That is a genuinely shorter path than wiring a Python service behind a queue. The beta-level surface is worth a look if you need judgment rather than generation. `RubyLLM::Evaluation` subclasses run agent output against a dataset with expected answers, from Minitest or Rake as well as plain Ruby, which means regression tests for prompts fit your existing CI. Pair that with batching when a backfill means thousands of chats, and with `with_caching` when a long system prompt gets resent on every call. Cost and latency control is not an afterthought. Fallbacks, retries, per-tenant configuration, and `request.resume` across jobs and deploys each solve a specific failure mode. Tracing via OpenTelemetry beats reading provider dashboards one at a time. Pass on this if your team wants a hosted platform with a UI, shared prompt workspace, and someone else holding the API keys. RubyLLM assumes you supply keys, pay providers directly, and take the pager when a provider degrades. Teams that want day-one parity with every vendor feature should check provider seams too — MCP and OpenAI-compatible endpoints cover a lot, but new vendor capabilities

Researching Ruby Llm? Get your full AI stack in 60 seconds.

Free, no signup — tell us your goal and get tools matched to your budget & existing stack.

Real-world workflow fit

Concrete scenarios for the personas Ruby Llm actually fits — and what changes day-one when you adopt it.

Rails developer adding a first AI feature

Run `bundle add ruby_llm --version 2.0.0`, then `bin/rails generate ruby_llm:install` and `bin/rails db:migrate` to create the Chat and Message models, and finally `bin/rails generate ruby_llm:chat_ui` to scaffold the controller, view, and ChatResponseJob. Seed a chat with `Chat.create! model: "claude-opus-5"` and ask a question with a PDF attached.

Outcome: A working Hotwire chat UI streaming replies through Turbo Streams into the page, with conversations persisted in Active Record — generated in minutes rather than assembled from a tutorial.

Backend engineer building a tool-calling agent

Subclass `RubyLLM::Tool`, write a `description` and an `execute` method that calls your internal API, and mark irreversible actions with `requires_approval`. Wrap the tool in a `RubyLLM::Agent` subclass with its own model and instructions, then instantiate it per request.

Outcome: The model decides when to call the tool, RubyLLM executes it and returns results to the model, and anything destructive waits for approval before it fires.

Platform engineer running batch summarization

Map over a set of documents, building one chat per document with `with_instructions` and calling `ask_later(doc.text)`, then hand the collection to `RubyLLM.batch`. Add retries and fallbacks so a provider hiccup does not kill the run.

Outcome: Summaries run concurrently with token and cost totals reported per response, and the work survives a failed provider call instead of losing the batch.

Use Cases

Models Under the Hood

claude-opus-5gemini-3.7-flash

as of 2026-10-16

Limitations

  • RubyLLM is an open-source Ruby gem, so you supply and manage your own API keys and provider accounts and rely on community support rather than a vendor SLA.
  • It is Ruby-specific, suited to plain Ruby or Rails applications.
  • The framework exposes 19 providers behind one consistent API, so provider coverage tracks each vendor's API as it is added, meaning newly announced vendor features land after the vendor ships them.

as of 2026-10-04

Verification history

We have re-verified Ruby Llm 10 times since . Each pass re-reads the vendor's own pages and re-checks every listed field against that evidence; passes where nothing had changed are marked as such.

  1. — re-verified summary, description, our verdict, our analysis, pricing model, pricing tiers, features, integrations, who it suits, who should skip it
  2. — re-verified summary, description, our verdict, our analysis, pricing model, pricing tiers, features, integrations, who it suits, who should skip it
  3. — re-checked, vendor evidence unchanged
  4. — re-verified summary, description, our verdict, our analysis, pricing model, pricing tiers, features, integrations, who it suits, who should skip it
  5. — re-checked, vendor evidence unchanged
  6. — re-checked, vendor evidence unchanged

Showing the 6 most recent of 10 verification passes.

Free to cite with attribution — this page re-verifies continuously.

12-month cost

Project the real annual outlay, including the implied monthly cost when only an annual tier is published.

Annual total
Free
Over 12 months
Effective monthly
—
—

Vendor list price only. Add-on usage, seat overages, and contract minimums are surfaced under Hidden costs & gotchas.

Plans compared

For each published Ruby Llm tier: who it actually fits, and what it adds vs. the previous tier. Cross-reference the cost calculator above for projected annual outlay.

Open Source

$0

Ideal for

Ruby and Rails teams that want to own their AI stack and pay only for the model tokens they consume, rather than a platform subscription.

What this tier adds

Starting tier — the gem installs free via `bundle add ruby_llm --version 2.0.0`; your only recurring cost is whatever your own model providers bill.

Hidden costs & gotchas

What the public pricing page doesn't put in bold. Captured from pricing-page footnotes, contract terms, and recurring complaints.

  • The gem is free, but every model call bills against your own provider account — a Claude Opus 5 request at $5 per million input tokens and $20 per million output tokens is your invoice, not RubyLLM's.
  • Long system prompts cost more than you expect unless you call with_caching; cache reads are cheaper than cache writes, but writes are priced above standard input on several Claude models.
  • Running agents in a loop multiplies token spend fast, and RubyLLM's cost tracking reports the number rather than capping it — nothing stops a runaway agent automatically.

Where the pricing makes sense

The company stage and team size where Ruby Llm's pricing actually pencils out — and where peers do it cheaper.

The gem itself costs nothing to install via `bundle add ruby_llm`. What you actually pay is your model provider bill, and RubyLLM is unusual in surfacing that number directly: the model registry lists USD per million text tokens for 1,874 models with cache read and cache write rates shown under input prices, and every response exposes `response.cost.total`. That transparency makes it easy to compare a $5/$25-per-million Claude Opus 4.5 call against a $2/$10 Claude Sonnet 5 call before you

Setup time & first value

How long it actually takes to get something useful out of Ruby Llm — broken out by persona, not the marketing-page minute.

For a Rails developer, first value arrives quickly: `bundle add ruby_llm --version 2.0.0`, then `bin/rails generate ruby_llm:install` and `bin/rails db:migrate`, and a single `RubyLLM.chat.ask` returns a response. Adding the scaffolded chat UI is one more generator and a `bin/rails server`. Expect longer if you are wiring an agent with real tools, since that means writing tool classes and testing

Switching to or from Ruby Llm

How to bring data in from common predecessors and how to get it back out — written for the switcher, not the buyer.

Migrating in
  • →From raw provider SDKs (OpenAI, Anthropic, Gemini): replace per-vendor client setup with `RubyLLM.chat(model:)` and swap the model name; attachments move to the `with:` option.
  • →From a Python orchestration stack: rebuild chains as Ruby tool classes plus `RubyLLM::Agent` subclasses, and use workflows to coordinate multi-agent flows.
  • →From a homegrown HTTP wrapper: point it at `RubyLLM.chat` and keep your existing provider keys, since RubyLLM supports OpenAI-compatible endpoints.
  • →From a hosted model endpoint to local inference: keep the same chat code and switch the configuration to Ollama or Ollama Cloud.
Migrating out
  • ↗To a non-Ruby stack: there is no Python or JavaScript client, so leaving means rewriting chat, tools, and schemas in the other language's framework.
  • ↗To a hosted AI platform: move conversation state out of Active Record and into the platform's store, and rebuild generators as platform configuration.
  • ↗To a visual/no-code builder: hand your tool definitions and schemas to the builder as configuration rather than Ruby classes.
  • ↗To direct provider SDKs: replace `RubyLLM.chat` with per-vendor clients and reimplement streaming, retries, fallbacks, and cost tracking yourself.

Integrations

RailsActive RecordActive StorageActive JobTurbo StreamsHotwireModel Context ProtocolOpenAIAnthropicGoogle GeminiOpenAI-compatible endpointsOllamaOllama Cloud

Resources & Guides

Tutorials & Learning

YouTube returned 6 videos for “Ruby Llm”, and we withheld 2: 2 did not mention Ruby Llm. Showing the 4 we can prove are about Ruby Llm.

Official links

Tools that pair well with Ruby Llm

Common stack mates teams adopt alongside Ruby Llm, with the specific reason each pairing earns its keep.

Featured Head-to-Head Comparisons

Alternatives to Ruby Llm

View all
SwiftOpenAI

SwiftOpenAI

MIT-licensed Swift package for calling the OpenAI API with native async/await and Combine on Apple platforms.

FreeTry
Xsai

Xsai

xsAI is an extra-small, OpenAI-compatible AI SDK for JavaScript and TypeScript — 13 KB gzipped with every package included.

FreeTry

Popular in LLM App Frameworks & SDKs

Marvin

Marvin

Marvin turns ordinary Python functions, classes, and Pydantic models into LLM-powered AI tasks with decorators like @ai_fn and

FreeTry

Frequently Asked Questions

Used Ruby Llm? Help shape our editorial sentiment research.