Skip to content

Build AI features the Ruby way

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

A single interface for all providers

Integrate with 13 major providers and all OpenAI-compatible ones. Use local models through Ollama and GPUStack. Without changing your code.

chat = RubyLLM.chat(model: "claude-opus-4-7")
chat.say "Hello!"

All with a comprehensive, refreshable model registry, so you can track costs.

Talk is cheap, show me the code

RubyLLM.chat.ask "What's the best way to learn Ruby?"
chat = RubyLLM.chat
chat.ask "What's in this image?", with: "ruby_conf.jpg"
chat.ask "What's happening in this video?", with: "video.mp4"
chat.ask "Describe this meeting", with: "meeting.wav"
chat.ask "Summarize this document", with: "contract.pdf"
chat.ask "Explain this code", with: "app.rb"
chat = RubyLLM.chat
chat.ask "Analyze these files", with: ["diagram.png", "report.pdf", "notes.txt"]
chat = RubyLLM.chat
chat.ask "Tell me a story about Ruby" do |chunk|
  print chunk.content
end
RubyLLM.paint "a sunset over mountains in watercolor style"
RubyLLM.embed "Ruby is elegant and expressive"
RubyLLM.transcribe "meeting.wav"
RubyLLM.moderate "Check if this text is safe"
chat = RubyLLM.chat
class Weather < RubyLLM::Tool
  desc "Get current weather"

  def execute(latitude:, longitude:)
    url = "https://api.open-meteo.com/v1/forecast?latitude=#{latitude}&longitude=#{longitude}&current=temperature_2m,wind_speed_10m"
    JSON.parse(Faraday.get(url).body)
  end
end

chat.with_tool(Weather).ask "What's the weather in Berlin?"
class WeatherAssistant < RubyLLM::Agent
  model "gpt-5-nano"
  instructions "Be concise and always use tools for weather."
  tools Weather
end

WeatherAssistant.new.ask "What's the weather in Berlin?"
class ProductSchema < RubyLLM::Schema
  string :name
  number :price
  array :features do
    string
  end
end

chat = RubyLLM.chat
response = chat.with_schema(ProductSchema).ask "Analyze this product", with: "product.txt"

Feels at home in Rails

Persist chats with ActiveRecord, generate a Hotwire chat UI, all without learning a new interface.

bundle add ruby_llm
bin/rails generate ruby_llm:install
bin/rails db:migrate
bin/rails ruby_llm:load_models
bin/rails generate ruby_llm:chat_ui # http://localhost:3000/chats
chat = Chat.create! model: "claude-opus-4-7"
chat.ask "What's in this file?", with: "report.pdf"
bin/rails generate ruby_llm:agent Support
bin/rails generate ruby_llm:tool Weather
bin/rails generate ruby_llm:schema Product

You're already using RubyLLM

Trusted by hundreds of companies, serving millions of users

Using RubyLLM? Get featured or sponsor us

Wall of Love

Marc KöhlbruggeMarc KöhlbruggeFounder/CEO, Startup Jobs

Ruby-esque DSL and the right level of abstraction: composable, flexible on architecture, opinionated on lower-level implementation.

Jorge ManrubiaJorge ManrubiaPrincipal Programmer, 37signals

We are using OpenAI API using the fantastic RubyLLM gem from @paolino.

Kieran KlaassenKieran KlaassenFounder, Cora

Love deleting code when adding a library, and love the thought that goes into the gem.

Elvinas PredkelisElvinas PredkelisCEO, Primevise

RubyLLM is pretty much the devise of this generation. Adding it to any application is pretty much a no-brainer.

Nick WarwickNick WarwickFounding Engineer, Nodal Networks

Our Langgraph agent was failing. I took a gamble and rebuilt it using RubyLLM. Not only was it far simpler, it performed better.

Brendan SamekBrendan SamekFounding Software Engineer, Build Canada

It feels natural. At Yuma, serving over 100,000 end users, our unified AI interface had accumulated so much cruft. RubyLLM is so much nicer than all of that.

Axel GrubbaAxel GrubbaFounder, Crevio

Love how Ruby-like it feels. The DSL is incredibly intuitive and follows all the conventions I would expect.

Luis EzcurdiaLuis EzcurdiaSoftware Engineer

RubyLLM is awesome, easy and intuitive. You should try it, even if you don’t work with Ruby.

Chris SonnierChris SonnierRuby/Rails Engineer

If you can find a better Ruby AI library than RubyLLM, I will only write JavaScript for the rest of the year!

Using RubyLLM? Share your story! Takes 5 minutes.