RubyLLM is a streamlined Ruby API designed to unify interactions with various AI models, including GPT, Claude, Gemini, and more. It simplifies the development of chatbots, AI agents, retrieval-augmented generation (RAG) applications, and content generators by providing a consistent interface across different AI providers. With minimal dependencies—only Faraday, Zeitwerk, and Marcel—RubyLLM ensures lightweight integration into Ruby applications.
Key Features and Functionality:
- Conversational AI: Facilitates seamless chatbot development using `RubyLLM.chat`.
- Vision Capabilities: Enables analysis of images and videos.
- Audio Processing: Supports transcription and understanding of speech through `RubyLLM.transcribe`.
- Document Handling: Extracts information from various file types, including PDFs, CSVs, and JSON.
- Image Generation: Creates images with `RubyLLM.paint`.
- Embeddings: Generates embeddings using `RubyLLM.embed`.
- Content Moderation: Ensures content safety with `RubyLLM.moderate`.
- Tool Integration: Allows AI to call Ruby methods, enhancing functionality.
- Structured Output: Provides JSON schemas for organized data handling.
- Streaming Responses: Delivers real-time responses using blocks.
- Rails Integration: Offers ActiveRecord integration with `acts_as_chat`.
- Asynchronous Processing: Utilizes fiber-based concurrency for efficient operations.
- Extensive Model Support: Maintains a registry of over 500 models with capability detection and pricing.
- Multiple Providers: Supports various AI providers, including OpenAI, Anthropic, Gemini, VertexAI, Bedrock, DeepSeek, Mistral, Ollama, OpenRouter, Perplexity, GPUStack, and any OpenAI-compatible API.
Primary Value and User Solutions:
RubyLLM addresses the complexity of interacting with multiple AI providers, each with its own client libraries, APIs, and response formats. By offering a unified and elegant API, it eliminates the need to manage disparate clients, streamlining the development process. This consistency allows developers to focus on building robust AI-powered applications without the overhead of integrating and maintaining multiple provider-specific clients. Whether developing chatbots, AI agents, or content generators, RubyLLM provides the tools necessary to build sophisticated applications efficiently.