4 ms·
Show HN: RubyLLM 1.0 – A Beautiful Ruby Way to Work with AI
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 https://rubyllm.com
GitHub: https://github.com/crmne/ruby_llm https://github.com/crmne/ruby_llm
- steephun 2y agoNice one this!
- earcar 2y agoThank you!
- JavierLTo 2y agoCool
- earcar 2y agoThank you!
- robknobs 2y agoyup!!
- shakthiprasad 2y agoNice one
- earcar 2y agoThank you!
- icnosman 2y agoVery cool
- earcar 2y agoThank you!
- levitano2222 2y agoEpic!
- earcar 2y agoThank you!
- Piaggy 2y ago[dead]
- lemoncoffee 2y agoNice!
- earcar 2y agoThank you!
- zaibatus 2y agoThat's great! Starred.
- earcar 2y agoThank you!
- BrettBrettBrett 2y agoSuper cool stuff
- earcar 2y agoThank you!
- crucero 2y agoReally great work - would I be able to use a self-hosted model as well?
- earcar 2y agoThank you! Not yet, but we have an issue about it https://github.com/crmne/ruby_llm/issues/2 https://github.com/crmne/ruby_llm/issues/2