dspy-ruby

Build type-safe LLM applications in Ruby with Sorbet signatures.

9|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/sylvanding/omelette --skill dspy-ruby-sylvanding
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy-ruby
Source: https://github.com/sylvanding/omelette/tree/main/.claude/skills/dspy-ruby
Command: npx skills add https://github.com/sylvanding/omelette --skill dspy-ruby-sylvanding

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

This Skill eliminates the guesswork and fragility of hand-crafted LLM prompts by providing a type-safe, modular framework for building production-grade AI applications in Ruby. Instead of manually tuning prompt strings, developers define inputs and outputs using Sorbet types and let DSPy.rb handle prompt generation, optimization, and structured output parsing.

Core Features & Use Cases

  • Type-Safe Signatures: Define LLM interfaces with Ruby types and enums, ensuring compile-time safety and reliable structured outputs.
  • Modular Agents & Tools: Compose ReAct and CodeAct agents with type-safe tools, enabling complex multi-step workflows like research automation and data processing.
  • Automatic Optimization: Improve prompt accuracy using MIPROv2 and GEPA optimizers with real evaluation data instead of manual guesswork.
  • Production Observability: Built-in event tracing, Langfuse integration, and lifecycle callbacks for monitoring LLM applications in Rails environments.
  • Use Case: A Rails developer building a customer support classifier can define a signature with typed inputs and outputs, wrap it in a module with error handling, and optimize it against real support tickets—all without writing raw prompt strings.

Quick Start

Use the dspy-ruby skill to build a type-safe sentiment analysis predictor that classifies customer feedback and returns a confidence score.

Frequently Asked Questions about dspy-ruby

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build type-safe LLM applications in Ruby without hand-writing prompts?

You can build type-safe LLM applications in Ruby by defining inputs and outputs using Sorbet types and letting DSPy.rb handle prompt generation, structured output parsing, and optimization automatically.

How do I optimize LLM prompts automatically using real evaluation data in Ruby?

You can optimize LLM prompts in Ruby by applying MIPROv2 and GEPA optimizers against real evaluation data, replacing manual prompt string tuning with automated accuracy improvements.

Can I use Ruby on Rails to build multi-step agent workflows with structured LLM outputs?

Yes, you can compose ReAct and CodeAct agents with type-safe tools in Rails to execute complex multi-step workflows like research automation and data processing with reliable structured outputs.

Does this framework support provider-agnostic integration with OpenAI, Anthropic, and Gemini?

Yes, the framework supports provider-agnostic integration, allowing you to connect with OpenAI, Anthropic, and Gemini APIs while maintaining Sorbet type safety across your LLM application.

How do I monitor LLM applications in production Ruby on Rails environments?

You can monitor LLM applications in Rails using built-in event tracing, Langfuse integration, and lifecycle callbacks to achieve production-grade observability for your AI features.

What is the best way to ensure structured LLM outputs in a Ruby application?

The best way to ensure structured LLM outputs in Ruby is to define LLM interfaces using type-safe signatures with Ruby types and enums, guaranteeing compile-time safety and reliable parsing.