dspy-ruby

Build type-safe LLM-powered Ruby applications with structured signatures and modules.

Updated May 20, 2022
One-click install
npx skills add https://github.com/andrewhwaller/dotfiles --skill dspy-ruby-andrewhwaller
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy-ruby
Source: https://github.com/andrewhwaller/dotfiles/tree/main/opencode/skills/dspy-ruby
Command: npx skills add https://github.com/andrewhwaller/dotfiles --skill dspy-ruby-andrewhwaller

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Type-safe, structured interfaces for building LLM-powered Ruby apps, reducing errors and boosting developer productivity by combining signatures, modules, and tool ecosystems.

Core Features & Use Cases

  • Type-safe signatures and enums that describe inputs/outputs precisely.
  • Modular composition with DSPy::Module, DSPy::Predict, and DSPy::ReAct-style workflows.
  • Observability, per-tool model selection, and fiber-local LM context for production-grade apps.

Quick Start

Install the dspyrb gem, define a simple signature (e.g., sentiment analysis), and run a predictor to classify text.

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?

To build type-safe LLM applications in Ruby, you can use a framework that enforces structured interfaces with signatures, modules, and JSON schemas. This approach minimizes errors and token waste by strictly validating inputs and outputs.

What is the best way to enforce structured outputs from LLMs in Ruby?

Enforcing structured outputs from LLMs in Ruby involves using type-safe signatures and enums that describe inputs and outputs precisely. This structured interface prevents unpredictable model responses and reduces token waste.

How do I add observability to Ruby LLM agents?

Adding observability to Ruby LLM agents requires a framework that supports production-grade monitoring alongside modular composition. This enables tracking of complex workflows, per-tool model selection, and fiber-local LM context.

Can I use different language models for specific tools within a single Ruby agent?

Yes, you can use different language models for specific tools within a single Ruby agent by utilizing per-tool model selection. This allows you to optimize performance and costs by matching the model to the specific task.

How do I define inputs and outputs for LLM routing in a Ruby application?

Defining inputs and outputs for LLM routing in a Ruby application is done by declaring type-safe signatures. These signatures, combined with enum and struct coercion, precisely describe the data contracts for your modules.