+2
Daily
+16
Weekly
4,514
stars
538
forks
27
watchers
1,027
prs
535
issues
49
releases
README
The Ruby AI framework
Build AI features the Ruby way: models, tools, agents, evaluations, and Rails conventions, designed together, with one consistent API.
ruby
chat = RubyLLM.chat
chat.ask "What's the best way to learn Ruby?"
chat.ask "What's in this image?", with: "ruby_conf.jpg"
chat.with_model("claude-sonnet-5").ask "Now say it as a haiku"
RubyLLM.paint("a sunset over mountains in watercolor").save("sunset.png")
Website · Getting Started · What's New in 2.2
Battle tested at - Fully private work AI
https://github.com/user-attachments/assets/519fcb20-ab8c-4af3-9185-0953b3ba7b81
[!NOTE]
Using RubyLLM? Share your story! Takes 5 minutes.
---
23 providers. One API.
Build with the models you want. Move between hosted and local providers without rewriting your application, or connect an OpenAI-compatible endpoint.
Browse models and pricing · Connect a provider
A complete AI framework for Ruby
More than a client for model APIs. RubyLLM gives your application the conventions, the runtime, and every piece in between, designed to work together. Everything below ships in RubyLLM 2.2.
Conversations
Chat: Conversational AI with RubyLLM.chat
Streaming: Real-time responses with blocks
Attachments: Ask about images, videos, audio, PDFs, and other documents with with:
Structured output: Define a Ruby schema and read the result with response.parsed
Extended thinking: Control, view, and persist model deliberation
Citations: Normalized source citations from documents, search, and grounding
Prompt caching: Turn on the provider's cache with with_caching and cache_until_here
Compaction: Let providers condense long conversations with with_compaction
Token counting: Count a request before you send it with count_tokens
Fallbacks and cancellation: Retry on backup models with with_fallbacks, stop a run with cancel
Tools and agents
Tools: Let AI call your Ruby methods
Tool approval: Park a run until a human approves with requires_approval
Provider tools: Web search, code execution, and MCP connectors with with_provider_tools
MCP: Connect agents to your systems with server classes in app/mcp, per-user inputs, tool filtering, and OAuth with RubyLLM::MCP
Agents: Reusable assistants with RubyLLM::Agent
The agentic loop: Drive it yourself with ask_later, step, and complete?
Prompt templates: ERB prompts in app/prompts, rendered with RubyLLM.render_prompt
Workflows: Correlate multi-agent runs in your telemetry with RubyLLM.workflow
Evaluations: Reusable datasets, model criteria, and Ruby assertions with RubyLLM::Evaluation
Judgments: Probabilities, choices, and scores with RubyLLM::Judge and RubyLLM.judge
Individual operations
Image generation: Create images with RubyLLM.paint
Video generation: Create videos with RubyLLM.animate
Audio: Transcribe speech with RubyLLM.transcribe and generate it with RubyLLM.speak
OCR: Turn documents into markdown with RubyLLM.ocr
Embeddings: Generate embeddings with RubyLLM.embed
RTop issues
#1669Body logging is tied to the logger's debug level, and streaming debug lines ignore the context logger2 comments · 2026-11-14#1556[FEATURE] Headers per context for every request, including embed2 comments · 2026-11-08#1682[BUG] `Tool#ask` does not check that a stored answer belongs to the question it asks now1 comments · 2026-11-15#1674[FEATURE] Cap how many tool calls run at once1 comments · 2026-11-15#1673[BUG] FileStore::Directory follows links to folders inside its own folder1 comments · 2026-11-15#1679[BUG] ReleaseRequest raises when Faraday response has no request options0 comments · 2026-11-15#1672[BUG] FileStore::Directory#list returns nothing when a file vanishes mid-listing0 comments · 2026-11-15
Discussions
#1260[OpenAI Bug] File upload - OpenAI multipart uploads1 comments · 2026-10-20#1064testing acts_as_chat2 comments · 2026-10-12#1054Comparing evaluation runs (baselines, regressions) - plans for RubyLLM::Evaluation?0 comments · 2026-10-10#1034A hard dollar limit per background job with RubyLLM (openai_api_base + with_headers)0 comments · 2026-10-03#1013New Judgments feature naming1 comments · 2026-10-01#958Evals?2 comments · 2026-09-23#957multiple chat and message models?2 comments · 2026-09-22#946Agent with custom context2 comments · 2026-09-18
Latest release
RubyLLM 2.2.2 v2.2.2 2026-11-15RubyLLM 2.2.2 loads the Ruby classes apps keep in app/skills again, keeps model rows your chats still use when a registry refresh runs without a foreign key, and shows each choice's title on the generated question cards. sh bundle add ruby_llm --version 2.2.2 Already on 2.2? Run bundle update ruby_llm. No schema or code changes are needed. Fixed - Your own classes in app/skills load again. 2.2 told the Rails autoloader to skip the whole app/skills folder, so an app that keeps its own Ruby classes there got NameError for every one of them after upgrading, whether or not it used RubyLLM sk