Skip to content

Ruby SDK

Community Ruby 3.1+ client for TypeSafe's System One API with Noul, Choice and Score objects, retries and pooled HTTP.

LibrarybetaMIT

Overview

typesafe-sdk for Ruby is a community client for the TypeSafe System One API, defaulting to jev-latest. You create a client with an API key and call system_one with a state and a hash of questions built from Noul, Choice and Score objects, or plain hashes with a type key; extra keys pass through to the API untouched for forward compatibility. Responses expose answers keyed by name, plus filtered nouls, choices and scores with probabilities, confidence and legends mirroring the Python SDK.

The client validates obvious mistakes before sending (no questions, a score with fewer than two levels, a choice without criteria, NaN in state) and converts objects that respond to as_json. It retries 408, 429 and 5xx responses and connection failures with exponential backoff and jitter, with a configurable retry policy and total time budget, and lists models. The list notes thread-safe pooled HTTP and no async client. The README emphasises gating actions on confidence.

What the decision model decides

TypeQuestionAnswers
ChoiceWhich team should handle this?billing · technical · sales
ScoreHow frustrated the customer appearsCalm, just stating facts · Frustrated but civil · Very angry, strong language
Yes / noThe message conveys urgency or time-sensitivity—

How it works

  1. bundle add typesafe-sdk and create a client
  2. Build Noul/Choice/Score questions
  3. Call system_one(state:, questions:)
  4. Gate actions on the returned confidence

Strengths

  • Client-side validation saves wasted calls
  • Configurable retries with total time budget
  • Thread-safe pooled HTTP per the list

Caveats

  • Community project, not official
  • No async client

Getting started

bundle add typesafe-sdk, then Typesafe::SDK::Client.new(api_key: "sk-...").system_one(state:, questions:).

At a glance

Type
Library
Status
beta
Language
Ruby
Runtime
Ruby gem (3.1+)
Has code
yes
License
MIT

Use cases and integrations

How curated lists describe it

Frequently asked questions

Is this the official Ruby SDK?

It is described as a community client.

Does it retry failed calls?

Yes, 408, 429, 5xx and connection failures, two retries by default with backoff.

Which model does it use?

jev-latest unless you specify another.

Related projects

  • Hack Club's lightweight LLM proxy, listed for adding a Jev forwarding endpoint behind its auth, limits and usage logging.

    MCP serverproductionTypeScript
  • 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
  • Go MCP server giving any client typed Jev decisions via OpenRouter or TypeSafe, with validated answers and no paid retries.

    MCP serverproductionGo
  • Simon Willison's LLM plugin that adds Jev as a model for yes/no, choice and score questions from the command line.

    PluginproductionPython