Skip to content

Jev directory

TypeSafe AI Rails

A community Rails integration built on the typesafe-sdk Ruby gem that adds Rails configuration, persisted usage and cost telemetry, and persistence-backed confidence policies for Choice and Score answers.
Stars
3
Language
Ruby
License
MIT
Reading time
3 min
Published by
Community
Author
GenieRobot
Last verified
Sep 2026

About this project

Community Rails integration for TypeSafe AI's System One API, built on the community typesafe-sdk Ruby gem. This project is not an official TypeSafe package. The SDK stays framework-neutral. typesafe-ai-rails adds Rails configuration, persisted usage/cost telemetry, and an opt-in persistence-backed confidence policy for Choice and Score answers. Bundler loads the gem through typesafe-ai-rails. The stable Ruby API remains under Typesafe::Rails; direct users may also require "typesafe/rails".

Quoted from the project's README. Read the full README.

Highlights

  • Built on the community typesafe-sdk gem and explicitly not an official TypeSafe package; the SDK stays framework-neutral while the gem adds Rails wiring.
  • Each successful ask appends a typesafe_calls row with decision type, model, token counts, pricing rates, estimated cost, request ID, and latency.
  • Result#act! is a fail-closed helper: without an active DecisionPolicy it raises MissingPolicyError, and a fallback of "escalate" raises LowConfidenceError.
  • A Jev family rate lets jev-latest resolve to versioned names such as jev-1.13.0 without losing the cost estimate; unknown models record cost_usd = NULL.
  • A telemetry database failure is non-fatal by default, and strict_logging = true makes complete accounting take priority over availability.

Quickstart

bash
bundle add typesafe-ai-rails
bin/rails generate typesafe:rails:install
bin/rails db:migrate

Watch out

MIT-licensed and not an official TypeSafe package. Needs a Rails app, the community typesafe-sdk gem, and an API key in credentials; debug logging may place application state in logs.

Questions about this entry

Short answers drawn from the linked project or page.

From the Jev guides

Original write-ups on what this entry is for.

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai