RubyLLM provides a unified interface to OpenAI, Anthropic, Google, and DeepSeek models with a clean, elegant API that feels like Ruby.<p>What makes it different?<p>Beautiful interfaces:<p><pre><code> chat = RubyLLM.chat
embedding = RubyLLM.embed("Ruby is elegant")
image = RubyLLM.paint("a sunset over mountains")
</code></pre>
Works with multiple providers through one API:<p><pre><code> # Start with GPT
chat = RubyLLM.chat(model: 'gpt-4o-mini')
# Switch to Claude? No problem
chat.with_model('claude-3-5-sonnet')
</code></pre>
Streaming that makes sense:<p><pre><code> chat.ask "Write a story" do |chunk|
print chunk.content # Same chunk format for all providers
end
</code></pre>
Rails integration that just works:<p><pre><code> class Chat < ApplicationRecord
acts_as_chat
end
</code></pre>
Tools without the JSON Schema pain:<p><pre><code> class Search < RubyLLM::Tool
description "Searches our database"
param :query, desc: "The search query"
def execute(query:)
Document.search(query).map(&:title)
end
end
</code></pre>
It supports vision, PDFs, audio, and more - all with minimal dependencies.<p>Website: <a href="https://rubyllm.com" rel="nofollow">https://rubyllm.com</a>
GitHub: <a href="https://github.com/crmne/ruby_llm" rel="nofollow">https://github.com/crmne/ruby_llm</a>