CoreAIKit

System One, on device

A System One call is a typed decision: a text (the state), a question with a fixed set of answers, and each answer’s probability back. Nothing is generated. Three shapes cover it — choice (which of these), score (where on this ordered scale), noul (does this hold, as a probability) — and a request asks several questions of one state at once.

This page is the map of what CoreAIKit does with that on a Mac or an iPhone, with the numbers and where they came from.

The call

Swift, one line per shape (import CoreAIOps):

let a = try await CoreAI.decide(
    text,
    ["reply":  .noul("Does the speaker want a response from the assistant?"),
     "topic":  .choice("What is the message about?", ["billing", "delivery", "other"]),
     "urgent": .score("How urgent is it?", levels: ["can wait", "this week", "today"])])
a["reply"]?.noul      // P(yes)
a["topic"]?.choice    // "delivery"
a["urgent"]?.score    // expected level, 0…2

Anything else, over HTTP, in the hosted API’s own forms:

cd Examples/Decide && swift run -c release decide-cli serve      # http://127.0.0.1:8090/v1/systemone
curl -s http://127.0.0.1:8090/v1/systemone -H 'Content-Type: application/json' -d '{
  "state": "Help! My payouts have been failing for 3 days.", "model": "minicpm5-2b",
  "questions": {"is_urgent": {"type": "noul", "instructions": "Does this convey urgency?"},
                "queue": {"type": "choice", "instructions": "Which queue?",
                          "criteria": {"billing": "invoices, payments, refunds", "technical": "bugs, outages", "other": "everything else"}}}}'

A client library written for the hosted endpoint is pointed at this one by its base URL (system-one on PyPI: HTTPConfig(base_url="http://127.0.0.1:8090", model="minicpm5-2b"); clients that read TYPESAFE_BASE_URL or SYSTEM_ONE_BASE_URL: set it) and nothing else changes. The request and answer forms, and the one declared difference (16 options per choice, not 255), are in Examples/Decide/README.md.

What it costs

  Mac (M4 Max, macOS 27.0) iPhone 17 Pro (iOS 27.0)
One decision after the state is read (MiniCPM5 2B int8) 33–65 ms 63–95 ms
Reading a 565-token contract once, then 12 answers 316 ms + 532 ms 508 ms + 1,134 ms
Twenty tickets × three columns, 60 decisions 3,963 ms 7,420 ms
A /v1/systemone request, 2 questions on a 59-token state, end to end 204 ms

Measured 2026-09-22/23 on the runs in Examples/Decide/README.md, which says what each number is and what else was running.

What it gets right, and what it does not

minicpm5-2b is the default because its int8 decisions track its own full-precision readout: 141/144 argmax agreement on SemIf’s authored fixture, mean |Δp| 0.02, family-balanced accuracy 0.681 against 0.686 published. The 4-bit qwen3-0.6b does not (59/144) and is documented as speed-only. decider-0.8b, a model trained for these questions, is token-identical to its author’s readout on the 43 fixture rows the kit can list.

The shape of the question decides more than the model. On MiniCPM5 2B, measured on the screens’ samples:

What runs

Ten whole uses, one action and the complete result, from the same sources on the Mac and the iPhone (Examples/Decide):

Use What you do → what you get
Autofill copy an email → every field of a checkout form fills at once
Checklist open a contract → a list of verdicts to your questions
Sorter open a folder → what needs you first, then everything filed; Move files does it
Search a query and passages → ranked by one decision each
Speech gate speak → only the utterances meant for the assistant pass
Drive press Drive → the model drives a car, one lane choice per tick
Columns open a CSV → the columns you asked for, every row; sort, save
Command guard an agent’s command log and a policy in plain words → run / ask / refuse (also a PreToolUse hook)
Context an agent transcript’s tool results → the unrelated ones dropped, tokens counted
Typing type → tone, intent and an emoji at every pause

Clips of each on the Mac and on the iPhone are in coreai-assets kit/decide.

Where the pieces are