RubyLLM: One Ruby Framework for All Major AI Providers

RubyLLM 1.16.0 is a Ruby framework that provides a unified interface for all major AI providers, including OpenAI, xAI, Anthropic, Gemini, VertexAI, Bedrock, DeepSeek, Mistral, Ollama, OpenRouter, Perplexity, GPUStack, and any OpenAI-compatible API. It supports chat, vision, audio, documents, image generation, embeddings, moderation, tools, agents, structured output, streaming, and Rails integration.
Quick Start
Add to Gemfile: gem 'ruby_llm', then bundle install.
Configure API keys:
RubyLLM.configure do |config|
config.openai_api_key = ENV['OPENAI_API_KEY']
end
Key Features
- Chat:
RubyLLM.chat.ask('question') - Vision: Analyze images and videos —
chat.ask('Describe', with: 'photo.jpg') - Audio: Transcribe and understand speech —
RubyLLM.transcribe('meeting.wav') - Documents: Extract from PDFs, CSVs, JSON, any file type
- Image generation:
RubyLLM.paint('prompt') - Embeddings:
RubyLLM.embed('text') - Moderation:
RubyLLM.moderate('text') - Tools: Let AI call your Ruby methods by subclassing
RubyLLM::Tool - Agents: Reusable assistants with
RubyLLM::Agent - Structured output: JSON schemas with
RubyLLM::Schema - Streaming: Real-time responses with blocks
- Rails: ActiveRecord integration with
acts_as_chatand optional Chat UI - Async: Fiber-based concurrency
- Model registry: 800+ models with capability detection and pricing
Code Examples
Chat with vision:
chat = RubyLLM.chat
chat.ask('What is in this image?', with: 'ruby_conf.jpg')
chat.ask('Summarize this document', with: 'contract.pdf')
Using tools:
class Weather < RubyLLM::Tool
desc 'Get current weather'
def execute(latitude:, longitude:)
JSON.parse(Faraday.get('https://api.open-meteo.com/...').body)
end
end
chat.with_tool(Weather).ask('What is the weather in Berlin?')
Structured output:
class ProductSchema < RubyLLM::Schema
string :name
number :price
array :features do
string
end
end
response = chat.with_schema(ProductSchema).ask('Analyze', with: 'product.txt')
Rails Integration
bin/rails generate ruby_llm:install
bin/rails db:migrate
bin/rails generate ruby_llm:chat_ui
Then create a Chat model with acts_as_chat and visit /chats for a ready-to-use UI.
RubyLLM has only three dependencies: Faraday, Zeitwerk, and Marcel.
📖 Read the full source: HN AI Agents
👀 See Also

MiniMax Music 2.5 AI Music Generator Released with Studio-Grade Audio Control
MiniMax Music 2.5 is an AI music generation model that creates studio-quality songs with 44.1kHz Hi-Fi output, 100+ instruments, and paragraph-level precision control using 14+ structural tags for directing song structure.

Claude Code Prompt Improver v0.5.3: Plan Mode Refactor and Subagent-First Research
v0.5.3 adds a PreToolUse hook for plan mode readability (clean rewrites, no decision history) and moves vague prompt research to Task/Explore subagents on Haiku to save main-context tokens. The plugin now works on Windows and has 1.4K+ GitHub stars.

Claude Review: IntelliJ Plugin for Real-Time Code Review with Claude Code
Claude Review is an open-source IntelliJ plugin that automatically reviews code changes on every file save using Claude Code. It sends unstaged git diffs to Claude with customizable prompts and displays findings as native IntelliJ annotations.

Off Grid Mobile App Adds On-Device AI Tool Use with 3x Speed Improvement
Off Grid mobile app now enables AI models to use tools like web search, calculator, date/time, and device info entirely offline, with configurable KV cache options delivering up to 30 tokens/second on phones.