Skip to content

typesafe.zig

Unofficial Zig client for System One where answer types come from the questions at compile time.

Librarybeta

Overview

typesafe.zig is an unofficial Zig client for TypeSafe's System One API and Jev. You declare questions as a comptime struct: noul with yes and no descriptions, choice over your own Zig enum, and score over levels. The client returns a struct of answers whose types are derived from the questions at compile time.

Nothing is stringly typed: a Choice answer is your enum, its probabilities are a struct with one f64 per tag, and Score probabilities are a fixed-size array. A misspelled question id, an option not in the enum, or a Score with one level is a compile error. Thresholds and policy stay in your code. The README sections cover installation, questions, configuration and errors, and the design keeps the client to returning judgments as data.

What the decision model decides

TypeQuestionAnswers
Yes / noDoes this convey urgency?Explicitly time-sensitive · No urgency expressed
ChoiceWhich team should handle this?billing · technical · sales
ScoreHow frustrated is the customer?Calm · Frustrated · Very angry

How it works

  1. Declare a comptime question struct.
  2. Init the client from the environment.
  3. Call ask with the state.
  4. Read compile-time typed answers.

Strengths

  • Compile-time checking of ids, options and levels.
  • Enum-typed choices and fixed-size probability arrays.

Caveats

  • Unofficial.
  • Requires a TypeSafe key.

At a glance

Type
Library
Status
beta
Language
Zig
Runtime
library
Has code
yes

Use cases and integrations

How curated lists describe it

Frequently asked questions

What is checked at compile time?

Question ids, Choice options against the enum, and Score level counts.

Is it official?

No.

Where do thresholds go?

In your own code.

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