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