Skip to content

SwiftJev

TypeSafe Jev provider for the SwiftDecision framework, returning validated probability distributions through its DecisionBackend protocol.

ProjectbetaApache-2.0

Overview

SwiftJev is the TypeSafe Jev provider for SwiftDecision. It sends typed Noul, Choice and Score prompts to the hosted System One API and returns validated probability distributions through SwiftDecision's DecisionBackend protocol, while SwiftDecision owns the typed decision APIs, policy validation, acceptance and fallback behaviour, cancellation, timeouts and traces. It is intentionally a thin adapter that does not expose raw response models.

The backend validates every prompt and response against Jev's contracts, preserves option order, rejects redirects, checks cancellation, and never includes credentials or response bodies in errors; transport is injectable for deterministic tests. For Choice, it returns the full distribution in option order, and an optional maximum probability gap can reject responses whose chosen label sits too far below the most probable option. Custom API roots and full operation URLs support compatible proxies, with an explicit key required. For iOS it recommends storing user-provided keys in the Keychain rather than shipping a shared key. An opt-in benchmark measures latency and throughput. It is Apache-2.0 licensed.

What the decision model decides

TypeQuestionAnswers
Yes / noIs the service unavailable for all customers?—
ChoiceChoice prompts with ordered options—

How it works

  1. Create a JevDecisionBackend (key from env or explicit)
  2. Pass it to a SwiftDecision DecisionEngine
  3. Ask noul, choice or score with context
  4. SwiftDecision applies acceptance policy to the validated distribution

Strengths

  • Strict contract validation
  • Safe error handling without leaking secrets
  • Proxy and gateway support

Caveats

  • Requires SwiftDecision
  • Custom endpoints need an explicit key

Getting started

Add SwiftJev and SwiftDecision packages, then DecisionEngine(backend: try SwiftJev.JevDecisionBackend()).

At a glance

Type
Project
Status
beta
Language
Swift
Runtime
Swift library (Apple platforms)
Has code
yes
Has tests
yes
License
Apache-2.0
Stars
9

Use cases and integrations

How curated lists describe it

Frequently asked questions

What is SwiftDecision?

The framework that owns typed decision APIs and policies; SwiftJev is its Jev provider.

Can it use a proxy?

Yes, via a custom API root or full operation URL with an explicit key.

How should iOS apps handle keys?

Store a user-provided key in the Keychain; do not ship a shared key.

Related projects

  • 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
  • Elixir library for unified LLM calls across providers, with an evaluate interface that calls Jev via TypeSafe or OpenRouter.

    ProjectproductionElixir
  • Self-hosted multi-tenant AI agent platform listed as including optional TypeSafe client tools for classification, scoring and yes/no.

    LibraryproductionPython
  • Provider-agnostic TypeScript AI SDK; per list sources, an @tanstack/ai-typesafe adapter exposes Jev decisions through decide().

    ServiceproductionTypeScript