Skip to content

Typesafe.zig

An unofficial Zig client for TypeSafe's System One API where answer types come from your questions at compile time: Choice returns your own enum, Score returns a fixed-size probability array.

Stars
1
Language
Zig
License
MIT
Published by
Community
Author
mattneel
Last verified
Oct 2026

mattneel/typesafe.zig

User repository on GitHub

View on GitHub

An idiomatic Zig client for the TypeSafe AI API

Forks
1
Last pushed
Updated Sep 2026

Repo stats from the GitHub API, cached Oct 2026.

About this project

Zig client for TypeSafe's System One API and its Jev model. Ask typed Noul, Choice and Score questions about your application's state in one request, and get back a struct of answers whose types come from your questions at compile time. This is an unofficial community client. It is not an official TypeSafe SDK, and it is not affiliated with or endorsed by TypeSafe. The client returns judgments as data. Thresholds and policy stay in your code.

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

Highlights

  • A misspelled question id, an option missing from your enum, or a Score with one level is a compile error, not a runtime surprise.
  • client.ask returns typesafe.Result(@TypeOf(questions)), so answers.answers.field names and types are all inferred.
  • Standard library only — std.http, std.json, std.Io — with no C dependencies, so it cross-compiles like any Zig code.
  • State, instructions, criteria and score levels accept JSON structure from std.json, including runtime strings and RawJson.

Watch out

Unofficial and unaffiliated with TypeSafe, at v0.1.0, and it needs Zig 0.16.0 or later, which is a tight coupling to a language still shipping breaking changes — the sample even uses the newer std.process.Init entry point. Memory is manual: everything pointing into the result's arena, meaning model, request_id, body and a Score answer's legend, is freed by deinit, while Noul and Choice answers and the Score numbers and enum are plain values you copy out first. Values are known at run time but the shape must not be — ids, enum options and level count are compile-time, and dynamic questions are the separate path for even less. Validation before sending catches invalid UTF-8, NaN or infinite floats, bad RawJson, nesting past 256 levels, a state that is not a string, object or array, an empty Noul and a null Score level, naming the offending path, with one deliberate exception: any type with its own jsonStringify is written unchecked. Option order is part of what the model reads, so keep an enum's declaration order stable across calls whose answers you compare. Copy reviewed against the repository README on 2026-10-04, not from running it.

Questions about this entry

Short answers drawn from the linked project or page.

More Jev resources like this

45GitHub stars
Go SDK plus a pipeline-friendly CLI for typed decisions, covering single questions, batched question maps, retries, and line-oriented filtering over stdin.
Jev Repos & SDKs#community#jevbest#catalog-import
16GitHub stars
Swift library and CLI for asking Jev typed Choice, Noul, and Score questions from Apple platforms, with answers returned alongside calibrated probabilities in one parallel request.
Jev Repos & SDKs#community#jevbest#catalog-import
9GitHub stars
Go SDK for the TypeSafe API that asks typed Noul, Choice, and Score questions about a state and returns probability distributions with confidence and typed accessors.
Jev Repos & SDKs#community#jevbest#catalog-import
8GitHub stars
Zod 4 companion that adds Jev meaning checks to shape checks: one parseAsync call sends every semantic rule as noul questions in a single request and turns probabilities into ordinary Zod issues.
Jev Repos & SDKs#community#jevbest#catalog-import
8GitHub stars
Early-alpha Haskell DSL for building Jev question packets as expressions with inferred types, exact request rendering, and exhaustive typed answer handlers.
Jev Repos & SDKs#community#jevbest#catalog-import
11GitHub stars
Scala 3 client for Jev that sends one state with typed noul, choice, and score questions over your own sttp backend. Answers come back typed with probabilities, usable from Future, blocking Identity, cats-effect, ZIO, Monix, and Pekko.
Jev Repos & SDKs#community#jevbest#catalog-import

From the Jev guides

Original write-ups on what this entry is for.

Closed weights have not stopped the ecosystem from rebuilding the shape in the open. API-compatible servers, retrained heads on small models, and inference-time tricks that skip generation entirely.
Jev Repos & SDKs#open-models#research#local
Read article
Back to all resources

From the Jev community

Posts from builders shipping with Jev right now.

Follow @typesafeai