dspy-ruby_skill

This skill helps you build type-safe, modular, testable LLM apps in Ruby using DSPy.rb to define signatures, tools, and optimized prompts.
  • TypeScript

10.5k

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill everyinc/compound-engineering-plugin --skill dspy-ruby

  • SKILL.md22.9 KB

Overview

This skill packages DSPy.rb capabilities for building type-safe, modular LLM applications in Ruby. It exposes signatures, modules, agents, tools, optimization, and evaluation primitives so you can implement predictable AI features with Sorbet-backed types and production-ready observability. Use it to replace brittle prompt tinkering with typed contracts and repeatable optimization.

How this skill works

The skill maps Ruby types (T::Struct, T::Enum) to LLM schemas and enforces typed inputs and outputs via DSPy signatures. It provides modular building blocks — Predict, ReAct, ChainOfThought, and tool/agent tooling — plus optimization engines (MIPROv2, GEPA) and an evaluation framework for systematic improvement. Configuration layers let you select provider adapters or a unified RubyLLM router, and fiber-local context and lifecycle hooks control runtime behavior.

When to use it

  • Building reliable LLM endpoints that must return structured, type-safe data
  • Composing agent workflows that call typed tools and need predictable tool arguments
  • Optimizing prompts with data-driven search or genetic evolution rather than manual trial
  • Integrating LLM logic into Rails with clear directory patterns, hooks, and observability
  • Evaluating model performance with repeatable metrics and test datasets

Best practices

  • Define clear DSPy::Signature types instead of relying on free-form text outputs
  • Keep context as T::Struct types (Typed Context Pattern) so each field is explicit and testable
  • Use provider adapters or RubyLLM routing to manage multi-provider deployments
  • Instrument modules with DSPy events and lifecycle callbacks for observability and metrics
  • Run optimization (MIPROv2/GEPA) against real train/val splits and export checkpoints for reproducibility

Example use cases

  • Customer support triage: a typed EmailClassifier signature that returns category, priority, and confidence
  • Data-processing agent: a Toolset that converts and validates formats with typed enums
  • Feature-flagged model selection: fast model for selectors and powerful model for synthesis in Rails
  • Prompt optimization: run GEPA to evolve instructions with reflection LMs and feedback maps
  • Automated evaluation: batch-run DSPy::Evals with exact_match or composite metrics and export scores

FAQ

Use per-provider adapter gems for direct SDK access or the recommended RubyLLM unified adapter to route requests by model name.

Can I run experiments and save optimized programs?

Yes—use MIPROv2 or GEPA for optimization and DSPy::Storage::ProgramStorage to checkpoint and export optimized programs.

How do I observe runtime behavior and token usage?

Subscribe to DSPy.events with module-scoped or global subscriptions; events include module metadata and token counts.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
dspy-ruby skill by everyinc/compound-engineering-plugin | VeilStrat