What problem does it solve?
DSPy.rb enables developers to program LLMs, not prompt them. Instead, you define application requirements through type-safe, composable modules that can be tested, optimized, and version-controlled like regular code. It provides guidance on creating type-safe signatures, building modules, configuring multiple LLM providers, and deploying robust AI features in Ruby applications.
Core Features & Use Cases
- Type-safe Signatures: Input/output contracts with runtime type checking
- Composable Modules: Reusable, chainable workflows for LLM tasks
- Multiple Providers: Unified configuration for OpenAI, Anthropic, Gemini, Ollama, and OpenRouter
- Agents with Tools & Testing: Tool-enabled agents, testing patterns with RSpec, and observability
- Production Best Practices: Deployment patterns and observability for production AI
Quick Start
- Install the DSPy Ruby gem and require it in your Ruby project
- Configure a provider (e.g., OpenAI) with your API key
- Create a simple Signature and Module, then run a basic forward call in Ruby to validate the workflow