{"slug": "rubyllm-a-single-beautiful-ruby-framework-for-all-major-ai-providers", "title": "RubyLLM: A single, beautiful Ruby framework for all major AI providers", "summary": "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.", "body_md": "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.\n\nBattle tested at [ ](https://chatwithwork.com)*- Fully private work AI*\n\n## Build a working Ruby AI chat in two minutes\n\nUsing RubyLLM? [Share your story](https://tally.so/r/3Na02p)! Takes 5 minutes.\n\n## Why RubyLLM?\n\nEvery AI provider ships their own bloated client. Different APIs. Different response formats. Different conventions. It’s exhausting.\n\nRubyLLM 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.\n\n## Show me the code\n\n```\n# Just ask questions\nchat = RubyLLM.chat\nchat.ask \"What's the best way to learn Ruby?\"\n# Analyze any file type\nchat.ask \"What's in this image?\", with: \"ruby_conf.jpg\"\nchat.ask \"What's happening in this video?\", with: \"video.mp4\"\nchat.ask \"Describe this meeting\", with: \"meeting.wav\"\nchat.ask \"Summarize this document\", with: \"contract.pdf\"\nchat.ask \"Explain this code\", with: \"app.rb\"\n# Multiple files at once\nchat.ask \"Analyze these files\", with: [\"diagram.png\", \"report.pdf\", \"notes.txt\"]\n# Stream responses\nchat.ask \"Tell me a story about Ruby\" do |chunk|\n  print chunk.content\nend\n# Generate images\nRubyLLM.paint \"a sunset over mountains in watercolor style\"\n# Create embeddings\nRubyLLM.embed \"Ruby is elegant and expressive\"\n# Transcribe audio to text\nRubyLLM.transcribe \"meeting.wav\"\n# Moderate content for safety\nRubyLLM.moderate \"Check if this text is safe\"\n# Let AI use your code\nclass Weather < RubyLLM::Tool\n  desc \"Get current weather\"\n\n  def execute(latitude:, longitude:)\n    url = \"https://api.open-meteo.com/v1/forecast?latitude=#{latitude}&longitude=#{longitude}&current=temperature_2m,wind_speed_10m\"\n    JSON.parse(Faraday.get(url).body)\n  end\nend\n\nchat.with_tool(Weather).ask \"What's the weather in Berlin?\"\n# Define an agent with instructions + tools\nclass WeatherAssistant < RubyLLM::Agent\n  model \"gpt-5-nano\"\n  instructions \"Be concise and always use tools for weather.\"\n  tools Weather\nend\n\nWeatherAssistant.new.ask \"What's the weather in Berlin?\"\n# Get structured output\nclass ProductSchema < RubyLLM::Schema\n  string :name\n  number :price\n  array :features do\n    string\n  end\nend\n\nresponse = chat.with_schema(ProductSchema).ask \"Analyze this product\", with: \"product.txt\"\n```\n\n## Features\n\n**Chat:** Conversational AI with`RubyLLM.chat`\n\n**Vision:** Analyze images and videos**Audio:** Transcribe and understand speech with`RubyLLM.transcribe`\n\n**Documents:** Extract from PDFs, CSVs, JSON, any file type**Image generation:** Create images with`RubyLLM.paint`\n\n**Embeddings:** Generate embeddings with`RubyLLM.embed`\n\n**Moderation:** Content safety with`RubyLLM.moderate`\n\n**Tools:** Let AI call your Ruby methods**Agents:** Reusable assistants with`RubyLLM::Agent`\n\n**Structured output:** JSON schemas that just work**Streaming:** Real-time responses with blocks**Rails:** ActiveRecord integration with`acts_as_chat`\n\n**Async:** Fiber-based concurrency**Model registry:** 800+ models with capability detection and pricing**Extended thinking:** Control, view, and persist model deliberation**Providers:** OpenAI, xAI, Anthropic, Gemini, VertexAI, Bedrock, DeepSeek, Mistral, Ollama, OpenRouter, Perplexity, GPUStack, and any OpenAI-compatible API\n\n## Installation\n\nAdd to your Gemfile:\n\n```\ngem 'ruby_llm'\n```\n\nThen `bundle install`\n\n.\n\nConfigure your API keys:\n\n```\n# config/initializers/ruby_llm.rb\nRubyLLM.configure do |config|\n  config.openai_api_key = ENV['OPENAI_API_KEY']\nend\n```\n\n## Rails\n\n```\n# Install Rails Integration\nbin/rails generate ruby_llm:install\nbin/rails db:migrate\nbin/rails ruby_llm:load_models # v1.13+\n\n# Add Chat UI (optional)\nbin/rails generate ruby_llm:chat_ui\nclass Chat < ApplicationRecord\n  acts_as_chat\nend\n\nchat = Chat.create! model: \"claude-sonnet-4\"\nchat.ask \"What's in this file?\", with: \"report.pdf\"\n```\n\nVisit `http://localhost:3000/chats`\n\nfor a ready-to-use chat interface!", "url": "https://wpnews.pro/news/rubyllm-a-single-beautiful-ruby-framework-for-all-major-ai-providers", "canonical_source": "https://rubyllm.com/", "published_at": "2026-06-24 14:41:41+00:00", "updated_at": "2026-06-24 15:09:19.296507+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "large-language-models", "generative-ai"], "entities": ["RubyLLM", "OpenAI", "Anthropic", "Google", "Ollama", "Faraday", "Zeitwerk", "Marcel"], "alternates": {"html": "https://wpnews.pro/news/rubyllm-a-single-beautiful-ruby-framework-for-all-major-ai-providers", "markdown": "https://wpnews.pro/news/rubyllm-a-single-beautiful-ruby-framework-for-all-major-ai-providers.md", "text": "https://wpnews.pro/news/rubyllm-a-single-beautiful-ruby-framework-for-all-major-ai-providers.txt", "jsonld": "https://wpnews.pro/news/rubyllm-a-single-beautiful-ruby-framework-for-all-major-ai-providers.jsonld"}}