Skip to content

Rust SDK (typesafe-ai-rs)

Independent Rust SDK for TypeSafe's System One API with async and blocking clients, typed Noul/Choice/Score, retries and metadata.

LibrarybetaMIT

Overview

typesafe-ai-rs is an independently maintained Rust client for the TypeSafe System One API. It provides async and blocking clients, typed Noul, Choice and Score questions and answers, model discovery, configurable retries, cancellation and complete HTTP response metadata. It targets parity with the official Python and JavaScript SDKs at version 0.6.0, with parity notes documenting exact source revisions and deliberate Rust differences.

A request is built from a JSON state and keyed questions; responses expose filtered nouls, choices and scores. Configuration comes from TYPESAFE_API_KEY, TYPESAFE_BASE_URL, TYPESAFE_DEFAULT_MODEL (jev-latest) and TYPESAFE_LOG_LEVEL. TLS defaults to Rustls with an optional native-tls feature, and logging uses the log facade with sensitive headers redacted. Rust 1.88 or newer is required.

What the decision model decides

TypeQuestionAnswers
Yes / noIs this about billing?—
ChoiceWhat is the customer's tone?calm · frustrated · angry
ScoreHow urgent is this?can wait · this week · today

How it works

  1. cargo add typesafe-ai-rs and set TYPESAFE_API_KEY
  2. Build a SystemOneRequest with state and typed questions
  3. Call client.system_one (async or blocking)
  4. Read typed answers and response metadata

Strengths

  • Async and blocking clients
  • Parity with official SDK 0.6.0 documented
  • Redacted logging of secrets

Caveats

  • Independent, not official
  • Requires Rust 1.88+

Getting started

cargo add typesafe-ai-rs tokio serde_json, set TYPESAFE_API_KEY, then Client::new()?.system_one(...).

At a glance

Type
Library
Status
beta
Language
Rust
Runtime
Rust library
Has code
yes
Has tests
yes
License
MIT

Use cases and integrations

How curated lists describe it

Frequently asked questions

Is this the official Rust SDK?

No; it is an independent client that tracks the official SDKs' behaviour.

Does it support synchronous code?

Yes, enable the blocking feature.

Which model does it use by default?

jev-latest, overridable with TYPESAFE_DEFAULT_MODEL.

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