Skip to content

RubyLLM TypeSafe

TypeSafe provider for RubyLLM 2 that exposes Jev's Noul, Choice and Score through structured output, until native judgments ship.

LibrarybetaMIT

Overview

ruby_llm-typesafe adds a :typesafe provider to RubyLLM 2. Because Jev only returns typed answers, the provider works solely through RubyLLM's structured output API: you build questions with RubyLLM::Providers::TypeSafe::Schema (noul, choice and score with instructions and criteria), pass it to chat.with_schema, call ask with the state, and read answers from response.parsed. Calling ask without a schema, streaming or tools raises an error before any request is sent. It also adds TypeSafe's model catalog to RubyLLM's registry for offline metadata.

The README notes that the next RubyLLM release adds built-in judgments (RubyLLM::Judge classes with probability, choice and score questions answered by Jev through a native TypeSafe provider); once available, users should switch and remove this gem, since both register a provider named :typesafe. Keys are sent only in the Authorization header and scrubbed from test cassettes, and timeouts, retries and logging come from RubyLLM's own configuration.

What the decision model decides

TypeQuestionAnswers
Yes / noDoes this convey urgency?—
ChoiceWhich team should handle this?billing · technical · other
ScoreHow frustrated is the customer?Calm · Frustrated · Angry

How it works

  1. Configure typesafe_api_key
  2. Build a Schema of noul/choice/score questions
  3. chat = RubyLLM.chat(model: 'jev-latest', provider: :typesafe).with_schema(schema)
  4. ask(state) and read response.parsed

Strengths

  • Uses RubyLLM's standard configuration and HTTP stack
  • Fails fast on unsupported calls
  • Offline model metadata

Caveats

  • Superseded by RubyLLM's built-in judgments when available
  • Do not load alongside the built-in provider

Getting started

gem 'ruby_llm-typesafe', set config.typesafe_api_key, then RubyLLM.chat(model: 'jev-latest', provider: :typesafe).with_schema(schema).ask(state).

At a glance

Type
Library
Status
beta
Language
Ruby
Runtime
RubyLLM 2 provider gem
Has code
yes
Has tests
yes
License
MIT

Use cases and integrations

How curated lists describe it

Frequently asked questions

Why only structured output?

Jev returns typed answers, not text, so the provider supports only schema-based asks.

Should I still use this gem?

Only on RubyLLM 2.0; the README says to switch to built-in judgments when available.

Can I stream or use tools?

No; those raise an error before a request is sent.

Related projects

  • Ax, a DSPy-style multi-language LLM framework, listed with a native TypeSafe provider for Boolean, Choice, Score and raw Jev questions.

    PluginproductionTypeScript
  • Effect TypeScript library whose @effect/ai-typesafe package maps classify, probability and rating operations to Jev questions.

    ProjectproductionTypeScript
  • PHP monorepo whose Polyglot module adds a TypeSafe driver for typed Noul, Choice and Score decisions alongside LLM inference.

    ProjectproductionPHP
  • Elixir library for unified LLM calls across providers, with an evaluate interface that calls Jev via TypeSafe or OpenRouter.

    ProjectproductionElixir
  • Self-hosted multi-tenant AI agent platform listed as including optional TypeSafe client tools for classification, scoring and yes/no.

    LibraryproductionPython
  • Provider-agnostic TypeScript AI SDK; per list sources, an @tanstack/ai-typesafe adapter exposes Jev decisions through decide().

    ServiceproductionTypeScript