\

RubyLLM: A Ruby framework for all major AI providers

222 points - today at 2:41 PM

Source
  • arbirk

    today at 6:04 PM

    I have been a fan of Ruby for many years, but in this fast paced era the Ruby ecosystem always struggled with the dependency versioning. Gems I relied on were never available or compatible with the rest of the ecosystem.

    • swe_dima

      today at 3:11 PM

      I found Ruby LLM to be surprisingly good - in terms of usability it's close to Vercel's AI framework.

      It tries to strike a balance between working out of the box and being flexible... which has its challenges, still nice overall.

      One big real-life pain I experienced is that caches don't always work, e.g. for xAI, since it only supports completions API and thought signatures are returned wrong.

        • earcar

          today at 3:15 PM

          Thank you!

          Responses API is now implemented and it's coming in RubyLLM 2.0

          https://github.com/crmne/ruby_llm/blob/main/lib/ruby_llm/pro...

            • techscruggs

              today at 3:27 PM

              Do you have any details published around 2.0? Would love to learn more.

                • earcar

                  today at 3:31 PM

                  Not yet. I'll do a series of blog posts and tweets in the next weeks.

      • rohitpaulk

        today at 5:33 PM

        We use RubyLLM in production too, the most elegant library in this space I've seen so far.

        I also liked how they run the issue tracker. If you select "Feature Request", it makes you explain how you explored workarounds, why you believe it belongs in RubyLLM etc to prevent scope creep.

        • obiefernandez

          today at 4:22 PM

          I have an open source gem called Raix that builds on top of RubyLLM's abstractions and is quite popular. https://github.com/OlympiaAI/raix

          • Finbarr

            today at 3:46 PM

            RubyLLM is very easy to use. Made extensive use of it for a project last year. Drawbacks are it was difficult to instrument for true trace observability and it has a pattern where retries will delete the underlying models so the history you see is clean but not necessarily great for seeing exactly what the sequence of API calls was.

          • aniokono

            today at 6:01 PM

            I haven't tried it but it looks promising.

            • digitaltrees

              today at 5:07 PM

              We use this in production for a few apps. Great project.

              • zhisme

                today at 3:21 PM

                thank you for bringing ruby into AI community and your open-source work. Great language must be explored and get more attention :)

                  • earcar

                    today at 3:23 PM

                    Thank you!

                    I love how MINASWAN Hacker News is when talking about Ruby!

                • themcgruff

                  today at 4:05 PM

                  I built a similar Ruby based agent development kit that has a different focus and feature set:

                  https://github.com/tweibley/legate

                  • hit8run

                    today at 5:47 PM

                    Using RubyLLM in production for https://usetix.io It drives our event chat agent that is enhanced with toolcalls etc. Super happy with it.

                    • mosselman

                      today at 3:08 PM

                      It is quite nice, but not as nice as you'd want. You still have to set platform specifics when running completions when you want to tune things like temperature, effort, max tokens, etc.

                        • earcar

                          today at 3:12 PM

                          RubyLLM author here.

                          I'm not sure where you got that.

                          `chat.with_temperature(0.2)`

                          https://rubyllm.com/chat/#controlling-response-behavior

                          `chat.with_thinking(effort: :high, budget: 8000)`

                          https://rubyllm.com/thinking/#controlling-extended-thinking

                          Max tokens is the only one of your list that require provider specific params:

                          https://rubyllm.com/chat/#provider-specific-parameters

                          I'm one guy doing it for free. Happy to see your contribution!

                            • mosselman

                              today at 3:49 PM

                              Hi! Valid challenge, I am probably misremembering. We were playing with various 'one-interface to all providers' solutions and I might have mixed up RubyLLM there. Sorry for that.

                              I will have a deep dive into which things I felt we needed to adapt per provider.

                              I didn't mean to imply that you have to solve all of our wants of course.

                              One thing we did do was monkey-patch the spot where tool_calls are performed by RubyLLM. We had our own mechanism for that and were able to skip RubyLLM's and still extract the tool calls and run them through our own tool harness. That all worked beautifully. I don't know if that type of stuff is something you want PRs on or that you want to keep steering towards the route that does everything within RubyLLM classes. Happy to contribute some of that.

                                • earcar

                                  today at 4:01 PM

                                  Interesting! What were you guys trying to achieve by running them in your own tool harness?

                              • techscruggs

                                today at 3:20 PM

                                And thank you! It is absolutely awesome and a true joy to work with.

                        • fragkakis

                          today at 3:34 PM

                          I have created an open source chatgpt clone with rubyllm, check it out here: https://www.railschat.org/

                          • meerita

                            today at 5:17 PM

                            "What is the best language in the world (say ruby)" ;)

                            • bitedeck

                              today at 3:47 PM

                              Thank you

                              • EGreg

                                today at 3:40 PM

                                In case you're using PHP or Node.js, we've made a similar toolkit free and open source on github: https://github.com/Qbix/AI/tree/main/classes/AI

                                • randomuser558

                                  today at 5:44 PM

                                  [flagged]

                                  • maxothex

                                    today at 4:02 PM

                                    [flagged]

                                    • balicien

                                      today at 3:14 PM

                                      [dead]

                                      • guesswho_

                                        today at 5:28 PM

                                        [dead]

                                        • notpachet

                                          today at 4:26 PM

                                          Why would anyone still build in dynamically typed languages in 2026? Why relinquish the crystal clear signals that static typing is able to provide to the LLM?

                                            • taylorlapeyre

                                              today at 4:30 PM

                                              Well, LLMs have an obscene amount of context built into their weights about Ruby on Rails, and can work within it extremely quickly.

                                              • jimbokun

                                                today at 4:27 PM

                                                This is not a tool for using LLMs to write Ruby code.