Skip to content

typesafe-client

Unofficial typed async Rust client for System One where answer keys are typed by question kind and responses are verified.

Librarybeta

Overview

typesafe-client is an unofficial Rust crate for TypeSafe's System One API. Its main idea is end-to-end typing: adding a question returns a key typed by its answer, so reading a Choice answer as a yes/no probability does not compile. Enums and runtime values map directly to Choice options.

Requests are checked against documented limits before sending and responses are verified against the questions before you see them. Defaults are production-oriented: retries on 408, 429, 5xx, connection errors and timeouts with exponential backoff, Retry-After support and a hard deadline per call. Application code can depend on a SystemOne trait, and a fake feature provides an in-memory implementation for tests. Without default features, it is just types, builders and validation with no HTTP stack. It is on crates.io with CI.

What the decision model decides

TypeQuestionAnswers
Yes / noYes/no question about given contentyes · no
ChoiceChoice whose options come from a Rust enum or runtime values—
ScorePosition on a scale—

How it works

  1. Build a request and add typed questions, receiving typed keys.
  2. The client validates limits and sends the request.
  3. Responses are verified against the questions.
  4. Read answers with their typed keys.

Strengths

  • Compile-time safety when reading answers.
  • Request and response validation.
  • In-memory fake for testing.
  • Types-only mode without HTTP dependencies.

Caveats

  • Unofficial.
  • Requires a TypeSafe key for live calls.

Getting started

cargo add typesafe-client

At a glance

Type
Library
Status
beta
Language
Rust
Runtime
library (crate)
Has code
yes
Has tests
yes

Use cases and integrations

How curated lists describe it

Frequently asked questions

What makes it type-safe?

Each question returns a key typed by its answer kind, so mismatched reads do not compile.

How do I test code using it?

Depend on the SystemOne trait and use the fake feature's in-memory implementation.

Is it official?

No, it is a community project.

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