Builds type-safe, modular LLM applications using Ruby's programmatic prompt framework with signatures and automated optimization.
DSPy.rb brings software engineering rigor to LLM development by replacing brittle prompt engineering with declarative Ruby signatures and modular components. It leverages Sorbet for strict type safety, allowing developers to define clear input/output interfaces, compose complex AI workflows through modules like ChainOfThought and ReAct, and automatically optimize prompts using data-driven techniques like MIPROv2 and GEPA. Designed for production, it integrates seamlessly with Ruby on Rails and supports a wide array of providers including Anthropic, OpenAI, and Gemini.
주요 기능
01Rails-style lifecycle callbacks for instrumentation and telemetry
02Type-safe signatures using Sorbet for robust LLM input/output validation
03Modular AI components including Predict, ChainOfThought, and ReAct agents
04Automatic prompt optimization using MIPROv2 and Genetic-Pareto evolution
051 GitHub stars
06Multi-provider support for OpenAI, Anthropic, Gemini, and local Ollama models
사용 사례
01Optimizing LLM prompt performance using systematic, data-driven evaluation frameworks
02Building complex, multi-step AI agents with type-safe tool-calling capabilities
03Developing production-grade Ruby on Rails applications with integrated LLM logic