shipwithjev

Catalog / Tools & apps

0308GitHub

ruby_decision_model

Ruby client with standard-library transport for TypeSafe and OpenRouter decision endpoints.

obie/ruby_decision_modelREADME ↗
# ruby_decision_model

The decision-model interface for Ruby. Decision models answer typed questions
about a state with calibrated probabilities instead of generating text. This gem
talks to them through one `Client` with a provider behind it. OpenRouter is the
default. Typesafe (Jev), OpenAI (gpt-6-luna), Cloudflare (Clef), Perplexity
(pplx-decider), and Databricks (`ai_decide`) each have a native provider, and
any server that speaks the System One API (Ollama, strands-decider, the
autojev server) works through `:system_one`. Your questions and answers keep
one shape whichever provider serves them. No runtime dependencies beyond the
standard library.

## Install

```ruby
gem "ruby_decision_model"
```

## Quick start

```ruby
require "ruby_decision_model"

client = RubyDecisionModel::Client.new

response = client.ask(
  state: { title: "Server returns 500 on checkout", reporter: "support" },
  questions: {
    "urgent" => RubyDecisionModel::Questions.noul("Is this urgent?"),
    "severity" => RubyDecisionModel::Questions.score(
      "How severe is this issue?",
      criteria: ["cosmetic", "minor", "major", "critical"]
    )
  }
)

response["urgent"].noul       # => 0.87
response["severity"].score    # => 2.4
response.usage.input_tokens   # => 120
```

`Client.new` with no arguments reads the environment.
`RUBY_DECISION_MODEL_PROVIDER` names a provider outright (`openai`,
`cloudflare`, and so on, in any case, with `-` or `_`), and an `api_key:` passed without `provider:` goes
to that provider. Without it, `TYPESAFE_API_KEY` selects Typesafe,
then `OPENROUTER_API_KEY` selects OpenRouter, then `SYSTEM_ONE_BASE_URL`
selects a System One server. General-purpose credentials such as
`OPENAI_API_KEY` or `CLOUDFLARE_API_TOKEN` never pick a provider on their own,
since plenty o

Also filed under Tools & apps

  1. 0616

    Jevstiller: distill Jev calls into a local model

    A self-hosted proxy that trains a local model on Jev's answers. It served 72% of Banking77 locally at 15 ms, with a 2% audit and a bound on disagreement.

    tomerglick57 · Tools & apps · 15 ms local

  2. 0611

    Scruple: code checks for what linters miss

    Semantic-aware linting with System One models: rules you can state in a sentence, checked against your code by Jev.

    @nalexpeae · Tools & apps

  3. 0606

    Algolia-style Postgres search with a Jev reranker

    Typo tolerance, typeahead, barcodes and facet counts in plain Postgres SQL, plus an optional Jev step that asks one question per top-10 result.

    @alex_forman1 · Tools & apps

  4. 0604

    Virtual Closet: outfits from closet videos

    built a virtual closet & outfit generator from raw closet videos. classification + semantic search thanks to jev 🥰. clueless closet dreams finally coming to life

    @maitreemervana · Tools & apps