Source linked

RubyLLM Unifies 11 AI Providers Under 3 Dependencies

Three Ruby gems replace every bloated AI client, covering 800+ models with a single chat interface.

rubyllmrubyai frameworksopenaianthropicdeveloper tools

RubyLLM ships with exactly three dependencies - Faraday, Zeitwerk, and Marcel - to replace every bloated AI client I've ever had to install. Eleven providers, 800+ models, one Ruby gem.

Model Registry That Knows What Your Model Can Do

RubyLLM's model registry tracks 800+ models from OpenAI, xAI, Anthropic, Gemini, VertexAI, Bedrock, DeepSeek, Mistral, Ollama, OpenRouter, Perplexity, and GPUStack. Each entry includes capability detection and pricing. You don't hardcode which model supports vision or tools; the framework figures it out. RubyLLM.chat with any model string just works.

Three lines to configure your API keys and you're running. gem 'ruby_llm', bundle install, set keys in a config block. No more wrestling with HTTP wrappers per provider.

Tools, Agents, and Structured Output Without Boilerplate

Define a Ruby class that inherits from RubyLLM::Tool, add a desc and an execute method, and the AI calls it like a function. WeatherAssistant class with model "gpt-5-nano" and instructions "Be concise and always use tools for weather." - that's a reusable agent with zero routing code.

Structured output goes through RubyLLM::Schema: string :name, number :price, array :features do string end. Pass it to chat.with_schema(ProductSchema).ask(...) and get back a validated Ruby object. No manual JSON parsing, no retries on malformed responses.

Rails Integration That Puts Chat in Your Database

acts_as_chat on an ActiveRecord model gives you persistence, streaming, file attachments, and a pre-built chat UI with one generator command. bin/rails generate ruby_llm:install then bin/rails generate ruby_llm:chat_ui. Visit /chats and you have a working interface. RubyLLM::Agent works in Rails too.

RubyLLM 1.16.0 is current as of this writing. The maintainers claim battle testing at "Fully private work AI." Whether you trust that or not, the framework itself is open source on GitHub.

Python dominates AI tooling. RubyLLM doesn't care. It gives Rubyists a single interface to the entire modern AI stack - chat, images, audio, video, PDFs, tools, agents - with the ergonomics that made Ruby stick around in the first place.


Source: RubyLLM: A single, beautiful Ruby framework for all major AI providers
Domain: rubyllm.com

Read original source ->

External source stays available while the OJO article and comment thread stay local.

Comments load interactively on the live page.