Skip to content

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.

ServicebetaApache-2.0

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

TypeQuestionAnswers
Yes / noBool fields of a @Generable type answered as calibrated probabilities—
ChoiceEnum fields answered as choices (e.g. ticket priority tier)—
ScoreOrdered fields answered as scores(inferred)—

How it works

  1. Define @Generable types for the decision
  2. Choose a backend (on-device Laya, laya-serve, Clef, OpenAI or Jev)
  3. Evaluate against app state through Foundation Models APIs
  4. 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-models
  • A lightweight, native Swift 6 bridge integrating TypeSafe AI.

    wh000wh000/awesome-jev-live
  • A lightweight, native Swift 6 bridge integrating TypeSafe AI's Jev System One decision model into Apple's Foundation Models framework.

    hellogumbo/awesome-jev
  • Swift 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.

    LibrarybetaTypeScript
  • n8n Jev Classification node that branches items by category with a Needs Review branch, plus parallel and batched requests.

    ProjectbetaTypeScript
  • Open System One-style playground: send state plus typed choice, score and noul questions to any of four backends via a UI or API.

    ProjectprototypeTypeScript
  • Typed, 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.

    ProjectprototypeTypeScript
  • Rails-native gem that defines Jev decisions as classes with typed results, confidence thresholds, guardrails, a router and test helpers.

    LibrarybetaRuby