Views
No views yet
coreai-torch (LLMs: coreai.llm.export) into .aimodel bundles that run on the GPU or the Neural Engine, e.g. Qwen3-8B 4-bit decodes at 94 tok/s on an M4 Max GPU, MLX 90 under the same protocol (apple-silicon-llm-bench, macOS 27 beta, 2026-06)..aimodel bundles from Apple's official
coreai-models export recipe — unmodified,
with the exact environment, hashes, and measured performance published.uv run coreai.llm.export mistral-7b-instruct-v0.3import CoreAIOps; no session, no model plumbing, downloads on first use):let tldr = try await CoreAI.summarize(text, options: .model("mistral-7b-v0.3"))1git clone https://github.com/john-rocky/coreai-kit
2open coreai-kit/Examples/ChatDemo/ChatDemo.xcodeproj
3# → Run, then pick "Mistral 7B v0.3" in the model picker
4
5# agents / headless (macOS):
6cd coreai-kit/Examples/ChatDemo
7swift run chat-cli --model mistral-7b-v0.3 --prompt "What can you do, offline?"1import CoreAIKit
2
3let chat = try await ChatSession(catalog: "mistral-7b-v0.3")
4let reply = try await chat.respond(to: prompt)
5// reply: the answer, generated fully on-deviceExamples/ChatDemo/Sources/QuickStart.swift
— this exact code as one typed function, no UI; the CLI is an argument shell over it, and
the GUI drives the same ChatSession across turns for its transcript.
Multi-turn? Hold the ChatSession and call respond(to:) per turn — it keeps the
conversation history; streamResponse(to:) yields tokens as they decode.https://github.com/john-rocky/coreai-kit → product CoreAIKitdownloadProgress callback).aimodel is a build artifact, not a pure function of the recipe — the
same export command produced a 2.2× slower artifact across the macOS 26 → 27β
boundary (forensics).
Hosted artifacts + hashes are the reproducible ground truth; every bundle here
is exactly the one measured in
apple-silicon-llm-bench.| Bundle | Contents | SHA-256 (main.mlirb) |
|---|---|---|
macos/ | macOS dynamic, int4 | 81c422124f0ccbf7e5e325a846e77656a4efeef0fc70bf0c5e1dfeb48de7581e |
llm-benchmark, greedy)| Bundle | Protocol | Decode tok/s | Prefill | Load (warm) | Peak RSS |
|---|---|---|---|---|---|
| macos | M4 Max, 512p/1024g | 101.7 | 976 | 0.56 s | 8.3 GB |
consolidated.safetensors); this bundle skips all that.coreai-core 1.0.0b1 · coreai-torch 0.4.0 · coreai-opt 0.2.0 · torch 2.9.0b1cb71b (export code identical to upstream 0c1055f)1# CLI (from a coreai-models checkout)
2swift run -c release llm-runner --model <downloaded-bundle-dir> --prompt "Hello"
3swift run -c release llm-benchmark --model <downloaded-bundle-dir>xcrun coreai-build compile <ir>.aimodel --platform iOS --preferred-compute neural-engine --architecture h18p
(h18p = iPhone 17 Pro), then set metadata.json assets.main to the .aimodelc.