Jev directory
CommunityJev Repos & SDKs
@cmaintz/jev-core
Zero-dependency TypeScript client for TypeSafe AI's Jev, providing typed questions in and typed answers out over the TypeSafe API or Cloudflare Workers AI. Shared client behind the jev-tools packages; unofficial and not affiliated with TypeSafe AI.
- Reading time
- 2 min
- Published by
- Community
- Added
- Oct 2026
Highlights
- ESM only, requires Node 22 or newer, and has no runtime dependencies.
- Ships TypeSafeProvider and CloudflareProvider with response validation via parseJevResponse.
- providerFromEnv returns null when JEV_API_KEY is unset, allowing fail-open behavior.
- Includes withCache, withRateLimit, RateLimiter, and validateQuestions helpers.
- postJson retries 429 and 529 with exponential backoff, defaulting to 4 attempts.
Questions about this entry
Short answers drawn from the linked project or page.
Install it with npm install @cmaintz/jev-core. It is ESM only, requires Node 22 or newer because it uses the global fetch, and has no runtime dependencies.
It ships TypeSafeProvider for the TypeSafe API (default model jev-latest) and CloudflareProvider for Cloudflare Workers AI (default model typesafe/jev). Both validate responses with parseJevResponse.
It reads JEV_API_KEY, JEV_PROVIDER, JEV_MODEL, CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN, TYPESAFE_AI_BASE_URL, and JEV_TIMEOUT_MS. Empty strings count as unset, and it returns null when no key is configured.
parseJevResponse throws if there is no answers object and drops any answer that is missing, has the wrong type, names an unknown choice, or has a non-finite or out-of-range number. Callers see those as no answer and can fail safe.
Yes. withCache serves identical requests from a TTL cache (60 seconds, 1000 entries by default) and only caches successful responses. withRateLimit wraps a provider with a RateLimiter, for example 600 requests per minute.
The default model jev-latest tracks TypeSafe's recommended model, so answers can change without a new package release. Set model or JEV_MODEL to a pinned version such as jev-1.13.0 for reproducible results.
No. The package is unofficial and not affiliated with TypeSafe AI. It is the shared client behind the jev-tools packages such as @cmaintz/jev-guard, jev-triage, and @cmaintz/jev-sort.
From the Jev guides
Original write-ups on what this entry is for.
From the Jev AI model community
Posts from builders shipping with Jev right now.