AnyDecisionModel
Swift package for typed decisions (probability, choice, score) over local MLX or Core AI models, Clef decision heads, or the Jev API.
Overview
AnyDecisionModel is a Swift package for typed decisions: yes/no probabilities, choices among options and scores on ordinal scales. Its API follows the model-and-session pattern of Apple's Foundation Models framework and Hugging Face's AnyLanguageModel. A Choosable enum can define options, and results carry per-option probabilities and confidence.
It has four backends behind one protocol: MLX runs a small language model on Apple silicon and reads each decision from next-token probabilities in one forward pass; MLX decision heads run models with a trained head such as Cloudflare's Clef; Core AI does the same on macOS 27 and iOS 27; and the Jev backend calls TypeSafe's /v1/systemone or any server implementing it. It requires Swift 6.2+, with the core and Jev backend also working on Linux.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Yes / no | Does this convey urgency? | yes · no |
| Choice | Which team? | billing · technical · sales |
| Score | How frustrated? | Calm · Frustrated · Very angry |
How it works
- Create a model (MLX, Core AI, Clef head or Jev)
- Open a DecisionSession with the state
- Call probability, choice or score
- Use the typed result in Swift code
Strengths
- Same API for on-device and hosted decisions
- Fully offline option on Apple silicon
- Typed Swift enums for options
Caveats
- Local small-model accuracy will differ from Jev
- Requires recent Swift and OS versions
Getting started
Add the AnyDecisionModel Swift package; for Jev set TYPESAFE_AI_API_KEY or TYPESAFE_API_KEY.At a glance
- Type
- Library
- Status
- beta
- Language
- Swift
- Runtime
- library (macOS, iOS, Linux)
- Has code
- yes
- License
- Apache-2.0
Use cases and integrations
How curated lists describe it
A Swift package for typed decisions from language models (probabilities, choices, and scores), with support for local MLX models and the TypeSafe Jev API.
hellogumbo/awesome-jevSwift package with one typed-decision protocol over two backends: Jev's `/v1/systemone`, or a small model running locally on Apple silicon through MLX.
MrJev/awesome-jev
Frequently asked questions
Can it run without the network?
Yes, the MLX and Core AI backends run locally.
How are local decisions computed?
From next-token probabilities in one forward pass, or from a trained decision head like Clef.
Which key does the Jev backend use?
TYPESAFE_AI_API_KEY or TYPESAFE_API_KEY, or one passed to the initializer.
Related projects
Python wrapper that answers System One and OpenAI Decisions API questions using any OpenAI-compatible chat model.
LibrarybetaPythonNative Go runtime serving Gemma 4 12B as a Jev-like decision model with hand-tuned PTX kernels and no CGo or CUDA toolkit.
ProjectbetaGoGo harness for System One models: hosted Jev, open Kev in-process via llama.cpp, and Cloudflare Clef, with typed helpers and a CLI.
ServicebetaGoGo gateway exposing the Jev /v1/systemone contract over ordinary LLM backends by reading single-token label logprobs.
ServicebetaGoTypeScript library for one-line local decisions with open models (kev-0.6b, kev-4b, open-jev), no API keys or cloud.
ProjectbetaTypeScriptPython library that finds numeric answers by bisection, asking Jev higher, lower or exactly at each guess.
ProjectbetaPython