Comment by aaronbrethorst

6 hours ago

I'm building something that is only pointed at Claude, and I don't anticipate moving away from the Anthropic ecosystem. Does RubyLLM offer me an advantage over directly using Anthropic's Ruby SDK?

To put it differently, is this more like choosing between Fog and aws-sdk-s3, or choosing between Active Storage and aws-sdk-s3?

It analogous to Active Storage and aws-sdk-s3.

Some of the things I like about RubyLLM: 1. the DSL - You can chain methods like ActiveRecord. 2. the Structure - If gives a way to organize agents, tools & prompts 3. the Portability - The costs of AI usage, will one day be an issue for any successful product. Being able to easily test and move from Anthropic to DeepSeek cut my bill down by over 90%. Knowing how easy RubyLLM makes it, ignoring this eventuality feels reckless to me. 4. ActiveRecord Integration - With a simple `bin/rails generate ruby_llm:install `, you can save each chat to your database. 5. Agent Training - This is a side benefit of the above, but has been a huge unlock for me. Since I have all my chats saved, I will regularly pull down that history and give it to claude code to refine my agent instructions.

Why build it in such a way that there you're locked into one provider when you can just use this tool and have the ability to choose any provider in the future? I mean, even for fallbacks, like what if anthropic API is down that particular day when you need the service?

  • Not the commenter, but the reason is the same as the choice to use direct db driver vs ORM - you get to take full advantage of special features and intricacies of one system, rather than trying to maintain a lowest common denominator of functionality between multiple ones.

    You can always build multiple clients however. It could be one thorough integration with one API, and a simpler backup via RubyLLM.

    Unless of course RubyLLM supports all of the above, but even then, are they going to be able to keep up as much as a native client in the long term?

    The answer is almost always that a native client for a more critical integration is the right call. You can always add another if you need it.