Skip to content

ex_typesafe_ai

Unofficial Elixir client for TypeSafe with typed structs, Req-based HTTP with retries and ergonomic noul/choice/score builders.

LibrarybetaMIT

Overview

ex_typesafe_ai is an idiomatic, unofficial Elixir client for the TypeSafe API, explicitly not affiliated with or endorsed by TypeSafe. TypeSafe.new/1 returns an immutable client value that can be built once and shared across processes, with options for API key, base URL, model (default jev-latest), timeout and retries; explicit options override environment variables.

Questions are built with Question.noul, choice and score helpers, and responses come back as typed structs, for example response.choices["category"].choice. HTTP is handled by Req with retries. The quickstart classifies a support ticket into billing, technical or other. It is published on Hex. Timeout and retry counts are configurable per client, and the README points to TypeSafe's documentation for what the model can do. It is MIT licensed with HexDocs documentation.

What the decision model decides

TypeQuestionAnswers
ChoiceWhat is this ticket about?billing · technical · other

How it works

  1. Add {:ex_typesafe_ai, "~> 0.2"} to mix.exs
  2. Build a client with TypeSafe.new()
  3. Call TypeSafe.system_one(client, state, questions)
  4. Read typed structs from the response

Strengths

  • Immutable, shareable client
  • Typed response structs
  • Req-based retries

Caveats

  • Unofficial community client

Getting started

Add {:ex_typesafe_ai, "~> 0.2"} to deps, set TYPESAFE_API_KEY, then TypeSafe.system_one(TypeSafe.new(), state, questions).

At a glance

Type
Library
Status
beta
Language
Elixir
Runtime
BEAM library
Has code
yes
License
MIT

Use cases and integrations

How curated lists describe it

  • Unofficial Elixir client for the TypeSafe AI API — typed structs, Req-based…

    wh000wh000/awesome-jev-live
  • Unofficial Elixir client for the TypeSafe AI API — typed structs, Req-based HTTP with retries, and ergonomic noul/choice/score questions. Not affiliated with TypeSafe AI.

    hellogumbo/awesome-jev

Frequently asked questions

Is it official?

No, it is a community client not affiliated with TypeSafe.

How are responses returned?

As typed structs, e.g. response.choices["category"].choice.

What HTTP library does it use?

Req, with retries.

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