{"by":"earcar","descendants":19,"id":43330235,"kids":[43341765,43333410,43336780,43331250,43332645,43332076,43331967,43331692,43331606,43331700,43332239],"score":30,"text":"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\n    embedding = RubyLLM.embed(&quot;Ruby is elegant&quot;)\n    image = RubyLLM.paint(&quot;a sunset over mountains&quot;)\n</code></pre>\nWorks with multiple providers through one API:<p><pre><code>    # Start with GPT\n    chat = RubyLLM.chat(model: &#x27;gpt-4o-mini&#x27;)\n    # Switch to Claude? No problem\n    chat.with_model(&#x27;claude-3-5-sonnet&#x27;)\n</code></pre>\nStreaming that makes sense:<p><pre><code>    chat.ask &quot;Write a story&quot; do |chunk|\n      print chunk.content  # Same chunk format for all providers\n    end\n</code></pre>\nRails integration that just works:<p><pre><code>    class Chat &lt; ApplicationRecord\n      acts_as_chat\n    end\n</code></pre>\nTools without the JSON Schema pain:<p><pre><code>    class Search &lt; RubyLLM::Tool\n      description &quot;Searches our database&quot;\n      param :query, desc: &quot;The search query&quot;\n      \n      def execute(query:)\n        Document.search(query).map(&amp;:title)\n      end\n    end\n</code></pre>\nIt supports vision, PDFs, audio, and more - all with minimal dependencies.<p>Website: <a href=\"https:&#x2F;&#x2F;rubyllm.com\" rel=\"nofollow\">https:&#x2F;&#x2F;rubyllm.com</a>\nGitHub: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;crmne&#x2F;ruby_llm\" rel=\"nofollow\">https:&#x2F;&#x2F;github.com&#x2F;crmne&#x2F;ruby_llm</a>","time":1741680082,"title":"Show HN: RubyLLM 1.0 – A Beautiful Ruby Way to Work with AI","type":"story","url":"https://rubyllm.com/"}