pi-typesafe
Pi extension with a consented, key-managed TypeSafe client, a batched typesafe_evaluate tool, a playground and an extension API.
Overview
pi-typesafe brings Jev into Pi as shared infrastructure. It provides a typesafe_evaluate tool that hands small structured judgments (classify, triage, compare, score) to Jev in one batched call; a terminal playground (/typesafe test, /typesafe playground) that runs requests without touching the model's context; and a typed API so other extensions, such as pi-warden, share one client, key store and login prompt and can report whether Jev was reachable and what it cost.
You log in with /typesafe login (hidden input, verified against the API and stored with owner-only permissions), test with a sample request, and enable the tool for a session only after confirming a data notice. TYPESAFE_API_KEY in the environment takes precedence for CI or scripts. It explains Choice, Score and Noul, runs all questions in parallel, and has an offline-testable transport and CI. It requires Pi 0.85+ and Node 22.19+, is MIT licensed, and is independent of TypeSafe and the Pi authors.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Choice | Which team should handle this? | billing · technical · other |
| Score | Where on this rubric does it sit? | — |
| Yes / no | Is this statement true? | yes · no |
How it works
- /typesafe login to store a verified key.
- /typesafe enable after confirming the data notice.
- Agent calls typesafe_evaluate with batched questions.
- Other extensions reuse the shared client and key.
Strengths
- One key store for multiple extensions.
- Explicit consent before the agent can send data.
- Offline-testable transport.
Caveats
- Usage billed to your TypeSafe account.
- Requires Pi 0.85+.
Getting started
pi install npm:pi-typesafe, then /typesafe login, /typesafe test and /typesafe enable.At a glance
- Type
- Plugin
- Status
- beta
- Language
- TypeScript
- Runtime
- Pi extension
- Has code
- yes
- Has tests
- yes
- License
- MIT
Use cases and integrations
How curated lists describe it
Pi extension: one consented, key-managed TypeSafe client, batched `typesafe_evaluate`, offline-testable transport.
AnotiaWang/awesome-decision-modelsA Pi Jev extension providing a decision tool, terminal playground commands and an API for other extensions.
logicrw/awesome-jev-projects
Frequently asked questions
Why a shared client?
So extensions like pi-warden don't each ask for a key and can report reachability and cost.
Can the agent use it immediately?
Only after /typesafe enable and confirming the data notice.
Where is the key stored?
In ~/.pi/agent/pi-typesafe/auth.json with owner-only permissions, unless the environment variable is set.
Related projects
Ax, a DSPy-style multi-language LLM framework, listed with a native TypeSafe provider for Boolean, Choice, Score and raw Jev questions.
PluginproductionTypeScriptEffect TypeScript library whose @effect/ai-typesafe package maps classify, probability and rating operations to Jev questions.
ProjectproductionTypeScriptPHP monorepo whose Polyglot module adds a TypeSafe driver for typed Noul, Choice and Score decisions alongside LLM inference.
ProjectproductionPHPElixir library for unified LLM calls across providers, with an evaluate interface that calls Jev via TypeSafe or OpenRouter.
ProjectproductionElixirSelf-hosted multi-tenant AI agent platform listed as including optional TypeSafe client tools for classification, scoring and yes/no.
LibraryproductionPythonProvider-agnostic TypeScript AI SDK; per list sources, an @tanstack/ai-typesafe adapter exposes Jev decisions through decide().
ServiceproductionTypeScript