crmne/ruby_llm
요약
RubyLLM은 OpenAI, Anthropic, Google 등 다양한 AI 제공업체를 통합 지원하는 Ruby 프레임워크입니다. 챗봇, AI 에이전트, RAG 애플리케이션 및 멀티모달 워크플로우를 단일 인터페이스로 쉽게 구축할 수 있도록 돕습니다.
핵심 포인트
- 다양한 AI API를 동일한 인터페이스로 통합 관리
- 챗봇, 에이전트, RAG, 이미지 생성 등 폭넓은 기능 지원
- 멀티모달(이미지, 비디오, 오디오) 데이터 처리 가능
- 도구 호출(Tool calling)을 통한 에이전트 정의 지원
- Faraday, Zeitwerk, Marcel 등 최소한의 의존성
모든 주요 AI 제공업체를 위한 단 하나의 아름다운 Ruby 프레임워크. 챗봇, AI 에이전트 (AI agents), RAG 애플리케이션, 콘텐츠 생성기 및 당신이 생각할 수 있는 모든 AI 워크플로우를 쉽게 구축하세요.
챗봇, AI 에이전트 (AI agents), RAG 애플리케이션을 구축하세요. OpenAI, xAI, Anthropic, Google, AWS, 로컬 모델 (local models) 및 모든 OpenAI 호환 API와 함께 작동합니다.
demo.mp4
모든 AI 제공업체는 각자 비대해진 클라이언트 (client)를 출시합니다. 서로 다른 API, 서로 다른 응답 형식, 서로 다른 컨벤션 (conventions). 이는 매우 지치는 일입니다.
RubyLLM은 이 모든 것을 위한 하나의 아름다운 프레임워크를 제공합니다. GPT, Claude 또는 로컬 Ollama를 사용하든 인터페이스는 동일합니다. 단 세 가지 의존성 (dependencies)만 필요합니다: Faraday, Zeitwerk, 그리고 Marcel. 그게 전부입니다.
# 그냥 질문하세요
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.ask "What's happening in this video?", with: "video.mp4"
...
# 여러 파일을 동시에
chat.ask "Analyze these files", with: ["diagram.png", "report.pdf", "notes.txt"]
# 응답 스트리밍 (Stream responses)
chat.ask "Tell me a story about Ruby" do |chunk|
print chunk.content
...
# 이미지 생성
RubyLLM.paint "a sunset over mountains in watercolor style"
# 임베딩 (embeddings) 생성
RubyLLM.embed "Ruby is elegant and expressive"
# 오디오를 텍스트로 전사 (Transcribe)
RubyLLM.transcribe "meeting.wav"
# 안전을 위한 콘텐츠 모더레이션 (Moderate)
RubyLLM.moderate "Check if this text is safe"
# AI가 당신의 코드를 사용하게 하세요
class Weather < RubyLLM::Tool
desc "Get current weather"
...
# 지침(instructions) + 도구(tools)를 사용하여 에이전트 정의
class WeatherAssistant < RubyLLM::Agent
model "gpt-5-nano"
...
# 구조화된 출력 (structured output) 받기
class ProductSchema < RubyLLM::Schema
string :name
...
Chat: RubyLLM.chat을 이용한 대화형 AI
Vision: 이미지 및 비디오 분석
Audio: RubyLLM.transcribe를 이용한 음성 전사 및 이해
Documents: PDF, CSV, JSON 및 모든 파일 유형에서 데이터 추출
Image generation: RubyLLM.paint를 이용한 이미지 생성
Embeddings: RubyLLM.embed를 이용한 임베딩 (Embeddings) 생성
Moderation: RubyLLM.moderate를 이용한 콘텐츠 안전성 (Content safety) 검사
Tools: AI가 사용자의 Ruby 메서드를 호출할 수 있도록 허용
Agents: RubyLLM::Agent를 이용한 재사용 가능한 어시스턴트 (Assistants)
Structured output: 즉시 작동하는 JSON 스키마 (JSON schemas)
Streaming: 블록 (Blocks)을 이용한 실시간 응답
Rails: acts_as_chat를 통한 ActiveRecord 통합
Async: Fiber 기반의 동시성 (Concurrency)
Model registry: 기능 감지 및 가격 정보가 포함된 800개 이상의 모델
Extended thinking: 모델의 추론 (Deliberation) 과정을 제어, 확인 및 유지
Providers: OpenAI, xAI, Anthropic, Gemini, VertexAI, Bedrock, DeepSeek, Mistral, Ollama, OpenRouter, Perplexity, GPUStack 및 모든 OpenAI 호환 API
Gemfile에 추가하세요:
gem 'ruby_llm'
그 다음 bundle install을 실행하세요.
.
API 키를 설정하세요:
# config/initializers/ruby_llm.rb
RubyLLM.configure do |config|
config.openai_api_key = ENV['OPENAI_API_KEY']
...
# Rails 통합 설치
bin/rails generate ruby_llm:install
bin/rails db:migrate
...
class Chat < ApplicationRecord
acts_as_chat
end
...
즉시 사용 가능한 채팅 인터페이스를 확인하려면
http://localhost:3000/chats를 방문하세요!
CONTRIBUTING.md를 참조하세요.
MIT 라이선스 하에 배포됩니다.
AI 자동 생성 콘텐츠
본 콘텐츠는 GitHub Claude Ecosystem의 원문을 AI가 자동으로 요약·번역·분석한 것입니다. 원 저작권은 원저작자에게 있으며, 정확한 내용은 반드시 원문을 확인해 주세요.
원문 바로가기