RubyLLM TypeSafe
TypeSafe provider for RubyLLM 2 that exposes Jev's Noul, Choice and Score through structured output, until native judgments ship.
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
| Type | Question | Answers |
|---|---|---|
| Yes / no | Does this convey urgency? | — |
| Choice | Which team should handle this? | billing · technical · other |
| Score | How frustrated is the customer? | Calm · Frustrated · Angry |
How it works
- Configure typesafe_api_key
- Build a Schema of noul/choice/score questions
- chat = RubyLLM.chat(model: 'jev-latest', provider: :typesafe).with_schema(schema)
- 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
TypeSafe provider for RubyLLM 2 with offline model metadata and typed responses.
AnotiaWang/awesome-decision-modelsA TypeSafe provider for RubyLLM 2 that exposes Jev’s three judgment types through structured output.
logicrw/awesome-jev-projectsTypeSafe structured-output provider for RubyLLM 2.
hellogumbo/awesome-jevTypeSafe provider for RubyLLM 2.
MrJev/awesome-jev
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.
PluginproductionTypeScriptEffect TypeScript library whose @effect/ai-typesafe package maps classify, probability and rating operations to Jev questions.
ProjectproductionTypeScriptPHP monorepo whose Polyglot module adds a TypeSafe driver for typed Noul, Choice and Score decisions alongside LLM inference.
ProjectproductionPHPElixir library for unified LLM calls across providers, with an evaluate interface that calls Jev via TypeSafe or OpenRouter.
ProjectproductionElixirSelf-hosted multi-tenant AI agent platform listed as including optional TypeSafe client tools for classification, scoring and yes/no.
LibraryproductionPythonProvider-agnostic TypeScript AI SDK; per list sources, an @tanstack/ai-typesafe adapter exposes Jev decisions through decide().
ServiceproductionTypeScript