System One Foundation Models
Swift 6 bridge putting System One models behind Apple's Foundation Models API, with Jev, Laya (incl. on-device Core ML), Clef and OpenAI.
Overview
System One for Apple Foundation Models is a Swift 6 bridge that integrates System One decision models into Apple's Foundation Models framework (LanguageModel, LanguageModelExecutor, @Generable). Strongly typed @Generable structs and enums are evaluated against app state, with Bool mapped to noul, enums to choice and ordered values to score, and confidence and probabilities exposed in response metadata. The README cites 15-150 ms latency.
Backends include on-device Core ML Laya (322M multilingual and 421M English models on the Neural Engine and GPU with no network), self-hosted laya-serve over HTTP, Cloudflare's Clef and Clef-Flash for multimodal decisions on images and camera frames, OpenAI's Decisions API, and hosted TypeSafe Jev with retries, cancellation and confidence routing. Package traits select which backends to compile. A prominent security advisory warns never to embed cloud API keys in mobile apps and recommends on-device models, server-side use, or an authenticated proxy with App Attest. Example apps cover ticket and mail triage. It is unofficial and Apache-2.0.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Yes / no | Bool fields of a @Generable type answered as calibrated probabilities | — |
| Choice | Enum fields answered as choices (e.g. ticket priority tier) | — |
| Score | Ordered fields answered as scores(inferred) | — |
How it works
- Define @Generable types for the decision
- Choose a backend (on-device Laya, laya-serve, Clef, OpenAI or Jev)
- Evaluate against app state through Foundation Models APIs
- Route by confidence; keep cloud keys off the device
Strengths
- Works with Apple's native APIs
- Offline on-device option
- Strong guidance on key security
Caveats
- Unofficial
- Cloud backends need a proxy for mobile apps
Getting started
Add the Swift package with the needed traits and use JevFoundationModels or LayaOnDevice per the README.At a glance
- Type
- Service
- Status
- beta
- Language
- Swift
- Runtime
- Apple platforms (Foundation Models)
- Has code
- yes
- License
- Apache-2.0
Use cases and integrations
How curated lists describe it
Unofficial Swift 6 bridge mapping Apple's `@Generable` types to Noul, Choice, and Score, with hosted Jev, HTTP Laya, and on-device Core ML Laya backends plus confidence routing
AnotiaWang/awesome-decision-modelsA lightweight, native Swift 6 bridge integrating TypeSafe AI.
wh000wh000/awesome-jev-liveA lightweight, native Swift 6 bridge integrating TypeSafe AI's Jev System One decision model into Apple's Foundation Models framework.
hellogumbo/awesome-jevSwift 6 bridge that puts Jev behind Apple's Foundation Models framework, with ticket- and mail-triage example apps.
MrJev/awesome-jev
Frequently asked questions
Can it run fully on-device?
Yes, with Core ML Laya models on the Neural Engine and GPU.
Which hosted models are supported?
TypeSafe Jev, Cloudflare Clef and OpenAI's Decisions API.
Can I ship my API key in an iOS app?
No; the README warns against it and recommends a proxy or on-device models.
Related projects
Workflow DSL for existing agents that uses Jev for the steps that are decisions and calls an agent only when investigation is needed.
LibrarybetaTypeScriptn8n Jev Classification node that branches items by category with a Needs Review branch, plus parallel and batched requests.
ProjectbetaTypeScriptOpen System One-style playground: send state plus typed choice, score and noul questions to any of four backends via a UI or API.
ProjectprototypeTypeScriptTyped, budget-aware language for LLM agents compiling to Python/TypeScript, with a decide{} block for Jev-family decisions.
ProjectprototypeNudge (compiles to Python and TypeScript)Local-first typed decisions for pm-cli project items (triage, dedupe, ask, gate) via System One models, defaulting to Ollama tev1:4b.
ProjectprototypeTypeScriptRails-native gem that defines Jev decisions as classes with typed results, confidence thresholds, guardrails, a router and test helpers.
LibrarybetaRuby