dspy-ruby

Build type-safe LLM applications with Sorbet-based signatures and modular components.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

DSPy.rb enables building type-safe LLM applications by combining Sorbet-based signatures, modular components, and provider adapters.

Core Features & Use Cases

  • Modularity: Signatures, modules, tools, and predictors with fiber-local LM contexts, observability, and optimization.
  • Predictable prompts: JSON schemas and type-safe outputs for robust LLM interactions.
  • Real-world workflow: Build end-to-end LLM apps with chaining, tools, and evaluations.

Quick Start

Define a simple signature, instantiate a predictor with DSPy.rb, and run it on sample input.

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?

Type-safe LLM applications in Ruby use Sorbet-based signatures to define structured inputs and outputs, ensuring predictable JSON schema interactions with language models. Modular components and provider adapters combine to create robust production workflows.

What is the best way to structure modular LLM workflows with Ruby?

Structuring modular LLM workflows involves composing predictors, tools, and modules using fiber-local LM contexts. This allows you to chain components together while maintaining observability and optimization throughout the lifecycle of the request.

How do I get predictable JSON outputs from an LLM in Ruby?

To get predictable JSON outputs from an LLM in Ruby, define type-safe signatures that map to JSON schemas. These signatures enforce structured responses, making your LLM interactions robust and reliable for downstream processing.

Do I need Sorbet to use DSPy.rb for LLM development?

Yes, Sorbet is required because DSPy.rb relies on Sorbet-based signatures to enforce type safety. You need to set up a Ruby environment with the dspy gem and define signatures to wire models, tools, and evaluators.

Can I chain multiple LLM predictors and tools together in a Ruby application?

Yes, you can chain multiple LLM predictors and tools together by composing modules with features like with_lm and lifecycle callbacks. This supports building end-to-end LLM apps with complex chaining and evaluation workflows.

What are the limitations of using type-safe signatures for LLM interactions?

Using type-safe signatures requires strict adherence to defined JSON schemas, which may limit flexibility for highly open-ended or unstructured generation. You must carefully wire models, tools, and evaluators as described in the documentation to avoid workflow mismatches.