cd /news/ai-tools/rubyllm-a-single-beautiful-ruby-fram… · home topics ai-tools article
[ARTICLE · art-37896] src=rubyllm.com ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

RubyLLM: A single, beautiful Ruby framework for all major AI providers

RubyLLM, a unified Ruby framework for multiple AI providers, launched to simplify building chatbots, agents, and AI workflows. The framework supports OpenAI, Anthropic, Google, and others with a single interface, reducing dependency bloat. It offers features like chat, vision, audio, document analysis, image generation, and tool integration.

read2 min views8 publishedJun 24, 2026
RubyLLM: A single, beautiful Ruby framework for all major AI providers
Image: source

A single, beautiful Ruby framework for all major AI providers. Easily build chatbots, AI agents, RAG applications, content generators, and every AI workflow you can think of.

Battle tested at - Fully private work AI

Build a working Ruby AI chat in two minutes #

Using RubyLLM? Share your story! Takes 5 minutes.

Why RubyLLM? #

Every AI provider ships their own bloated client. Different APIs. Different response formats. Different conventions. It’s exhausting.

RubyLLM gives you one beautiful framework for all of them. Same interface whether you’re using GPT, Claude, or your local Ollama. Just three dependencies: Faraday, Zeitwerk, and Marcel. That’s it.

Show me the code #

chat = RubyLLM.chat
chat.ask "What's the best way to learn Ruby?"
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.ask "Analyze these files", with: ["diagram.png", "report.pdf", "notes.txt"]
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"
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

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

Features #

Chat: Conversational AI withRubyLLM.chat

Vision: Analyze images and videosAudio: Transcribe and understand speech withRubyLLM.transcribe

Documents: Extract from PDFs, CSVs, JSON, any file typeImage generation: Create images withRubyLLM.paint

Embeddings: Generate embeddings withRubyLLM.embed

Moderation: Content safety withRubyLLM.moderate

Tools: Let AI call your Ruby methodsAgents: Reusable assistants withRubyLLM::Agent

Structured output: JSON schemas that just workStreaming: Real-time responses with blocksRails: ActiveRecord integration withacts_as_chat

Async: Fiber-based concurrencyModel registry: 800+ models with capability detection and pricingExtended thinking: Control, view, and persist model deliberationProviders: OpenAI, xAI, Anthropic, Gemini, VertexAI, Bedrock, DeepSeek, Mistral, Ollama, OpenRouter, Perplexity, GPUStack, and any OpenAI-compatible API

Installation #

Add to your Gemfile:

gem 'ruby_llm'

Then bundle install

.

Configure your API keys:

RubyLLM.configure do |config|
  config.openai_api_key = ENV['OPENAI_API_KEY']
end

Rails #

bin/rails generate ruby_llm:install
bin/rails db:migrate
bin/rails ruby_llm:load_models # v1.13+

bin/rails generate ruby_llm:chat_ui
class Chat < ApplicationRecord
  acts_as_chat
end

chat = Chat.create! model: "claude-sonnet-4"
chat.ask "What's in this file?", with: "report.pdf"

Visit http://localhost:3000/chats

for a ready-to-use chat interface!

── more in #ai-tools 4 stories · sorted by recency
── more on @rubyllm 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/rubyllm-a-single-bea…] indexed:0 read:2min 2026-06-24 ·