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

by earcaron 3/11/2025, 8:01 AMwith 19 comments

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

by cruceroon 3/12/2025, 10:43 AM

Really great work - would I be able to use a self-hosted model as well?

by zaibatuson 3/11/2025, 3:26 PM

That's great! Starred.

by BrettBrettBretton 3/11/2025, 8:39 PM

Super cool stuff

by steephunon 3/11/2025, 11:08 AM

Nice one this!

by lemoncoffeeon 3/11/2025, 2:13 PM

Nice!

by levitano2222on 3/11/2025, 1:11 PM

Epic!

by icnosmanon 3/11/2025, 12:58 PM

Very cool

by shakthiprasadon 3/11/2025, 12:16 PM

Nice one

by JavierLToon 3/11/2025, 12:05 PM

Cool

by robknobson 3/11/2025, 12:17 PM

yup!!