Skip to content

typesafe_sdk_ex

Elixir SDK for TypeSafe based on the official JavaScript SDK, built on Req, with status-mapped error structs.

Librarybeta

Overview

typesafe_sdk_ex is an Elixir client for TypeSafe based on the official JavaScript SDK and built on the Req HTTP library. TypeSafe.new reads the key and optional base URL, default model and log level from options or TYPESAFE_* environment variables, and system_one sends state with questions built by noul, choice and score helpers. list_models lists available models.

Its error handling is detailed: non-2xx responses map to specific structs (BadRequest, Authentication, PermissionDenied, NotFound, UnprocessableEntity, RateLimit with retry_after_ms, InternalServer including 529, Connection and Timeout), while configuration and question-validation problems use a generic error. The README also documents logging, telemetry and connection pool behavior. Each client has its own log level, and typed helpers build questions so request shapes are validated before sending.

What the decision model decides

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

How it works

  1. Create a client with TypeSafe.new.
  2. Build questions with the helpers.
  3. Call system_one and read answers from the response map.
  4. Handle status-mapped errors.

Strengths

  • Detailed, status-specific error structs.
  • Logging, telemetry and pool controls.
  • Based on the official JS SDK.

Caveats

  • Responses are maps rather than typed structs.
  • Community SDK; requires a key.

Getting started

{:ok, client} = TypeSafe.new() with TYPESAFE_API_KEY set

At a glance

Type
Library
Status
beta
Language
Elixir
Runtime
library
Has code
yes

Use cases and integrations

How curated lists describe it

Frequently asked questions

Which HTTP library does it use?

Req.

How are rate limits reported?

As TypeSafe.Error.RateLimit with retry_after_ms.

What is it based on?

The official TypeSafe JavaScript SDK.

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