TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: RubyLLM 1.0 – A Beautiful Ruby Way to Work with AI

30 点作者 earcar2 个月前
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(&quot;Ruby is elegant&quot;) image = RubyLLM.paint(&quot;a sunset over mountains&quot;) </code></pre> Works with multiple providers through one API:<p><pre><code> # Start with GPT chat = RubyLLM.chat(model: &#x27;gpt-4o-mini&#x27;) # Switch to Claude? No problem chat.with_model(&#x27;claude-3-5-sonnet&#x27;) </code></pre> Streaming that makes sense:<p><pre><code> chat.ask &quot;Write a story&quot; do |chunk| print chunk.content # Same chunk format for all providers end </code></pre> Rails integration that just works:<p><pre><code> class Chat &lt; ApplicationRecord acts_as_chat end </code></pre> Tools without the JSON Schema pain:<p><pre><code> class Search &lt; RubyLLM::Tool description &quot;Searches our database&quot; param :query, desc: &quot;The search query&quot; def execute(query:) Document.search(query).map(&amp;:title) end end </code></pre> It 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> GitHub: <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>

10 条评论

crucero2 个月前
Really great work - would I be able to use a self-hosted model as well?
评论 #43356465 未加载
zaibatus2 个月前
That&#x27;s great! Starred.
评论 #43356466 未加载
BrettBrettBrett2 个月前
Super cool stuff
评论 #43356468 未加载
steephun2 个月前
Nice one this!
评论 #43356469 未加载
lemoncoffee2 个月前
Nice!
评论 #43356470 未加载
levitano22222 个月前
Epic!
评论 #43356472 未加载
icnosman2 个月前
Very cool
评论 #43356473 未加载
shakthiprasad2 个月前
Nice one
评论 #43356474 未加载
JavierLTo2 个月前
Cool
评论 #43356475 未加载
robknobs2 个月前
yup!!