Skip to content

typesafe-ai (Rust)

Typed Rust client for System One with async reqwest or blocking ureq backends and observable retries.

LibrarybetaApache-2.0

Overview

typesafe-ai is an Apache-2.0 Rust crate that brings System One into ordinary Rust code. Noul, Choice and Score responses deserialize into Rust enums with probabilities, distributions, confidence and usage. You can use the default async reqwest client or disable default features for a blocking ureq client without Tokio.

You can call evaluate for a simple result or observe each failure and planned retry through a lazy iterator or async stream. Errors keep status, headers, request IDs and response bytes without exposing credentials. Examples include a PR-questions CLI that applies JSON rules to pull request metadata and diffs, with a GitHub Actions guide, and a semantic search example. The PR-questions example shows a practical use: rules stored as JSON files are applied to pull request metadata and diffs from a CLI that can run in GitHub Actions.

What the decision model decides

TypeQuestionAnswers
Yes / noIs the customer asking for a refund?yes · no
ChoiceWhich team should this support case go to?—
ScoreWhere does this item fall on an ordered rubric?—

How it works

  1. Build a Request with state and questions.
  2. Evaluate with the async or blocking client.
  3. Optionally observe retries as a stream.
  4. Read typed answers and apply your own thresholds.

Strengths

  • Async or blocking backends.
  • Observable retries and inspectable errors.
  • Credentials kept out of error display text.

Caveats

  • Requires a TypeSafe key.
  • Community crate.

Getting started

Add the typesafe-ai crate to Cargo.toml; see docs/getting-started.md.

At a glance

Type
Library
Status
beta
Language
Rust
Runtime
library (crate)
Has code
yes
License
Apache-2.0

Use cases and integrations

How curated lists describe it

  • Rust ecosystem: typed TypeSafe AI client with async (reqwest) and blocking (ureq) backends, deserializing Noul, Choice, and Score responses into Rust enums with observable retry streams.

    yibie/awesome-jev
  • Another Rust client: async + blocking transports, typed responses, observable retries.

    AnotiaWang/awesome-decision-models
  • A Rust TypeSafe client with asynchronous reqwest or blocking ureq backends and observable retries.

    logicrw/awesome-jev-projects
  • Typed TypeSafe AI clients for Rust, with async and blocking backends and observable retries.

    hellogumbo/awesome-jev

Frequently asked questions

Can I use it without Tokio?

Yes, disable default features and use the blocking ureq client.

How are retries handled?

Use evaluate for simplicity or observe each retry through an iterator or stream.

Are there examples?

Yes, including a PR-questions CLI for GitHub Actions and a semantic search example.

Related projects

  • Provider-neutral Unix CLI for Jev: pipe state in, ask one Noul, Choice or Score question, get JSON out for scripts and CI.

    LibrarybetaGo
  • Zero-dependency Node bridge that exposes Jev through an OpenAI-compatible API, plus a CLI, code-audit tool and auto-fix loop.

    CLIbetaJavaScript
  • 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