4
stars
16
commits
6
linked in READMEs
Sep 7, 2026
updated
Core AI is Apple's on-device ML runtime in iOS 27 / macOS 27 and the successor to Core ML: PyTorch models are exported with Apple's 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).
On-device ×4 super-resolution with AdcSR (Adversarial Diffusion Compression, CVPR 2025) converted for Apple's Core AI stack. AdcSR compresses the one-step diffusion model OSEDiff into a small diffusion-GAN: a pruned Stable Diffusion 2.1 UNet + a half-size VAE decoder, run in one forward pass — no iterative denoising, no prompt, no noise — so it is fast and small enough to run fully on-device, including iPhone.
⚡ One line — this model is the default behind the kit's task op
(import CoreAIOps; no session, no model plumbing, downloads on first use):
let big = try await CoreAI.upscale(image)
Every op, one shape — Cookbook.
▶️ Run it (source) — the UpscaleDemo runner (pick a photo, upscale it ×4 on-device):
git clone https://github.com/john-rocky/coreai-kit
open coreai-kit/Examples/UpscaleDemo/UpscaleDemo.xcodeproj
# → Run, pick a photo — the app loads AdcSR ×4 (the catalog's superResolution entry) automatically
# agents / headless (macOS):
cd coreai-kit/Examples/UpscaleDemo
swift run upscale-cli --model adcsr-x4 --image sample_small.png --output big.png
💻 Build with it — complete; the glue is kit API, copy-paste runs:
import CoreAIKitVision
let resolver = try await SuperResolver(catalog: "adcsr-x4")
let image = try ImageFile.load(imageURL) // any image file → CGImage + EXIF orientation
let upscaled = try await resolver.upscale(image.cgImage)
// upscaled: CGImage — 4× the input's pixels
The take-home is Examples/UpscaleDemo/Sources/QuickStart.swift
— this exact code as one typed function, no UI; the CLI is an argument shell over it, and
the GUI runs the same resolver on the photo you pick.
Big photos? Inputs are tiled and feather-blended internally; maxInputSide (default 512)
caps the input first so a full-res phone photo can't produce a gigapixel result.
Integration checklist
https://github.com/john-rocky/coreai-kit → product CoreAIKitVisiondownloadProgress callback)SuperResolver after tiling (baking it per-tile blows up uniform tiles).lr [1,3,128,128] in [-1,1] (a low-resolution tile).sr [1,3,512,512] in [-1,1] (×4), with the reference's per-image color-match baked in.import CoreAIKitVision
let sr = try await SuperResolver(model: .adcsrX4) // downloads this repo on first use
let big = try await sr.upscale(cgImage) // ×4; tiles any-size input + feather-blends
SuperResolver splits any-size input into overlapping 128-px LR windows, runs each, and blends
(and caps very large inputs so the result stays a reasonable size).
This Core AI conversion inherits both. See LICENSE (Apache-2.0, AdcSR) and the SD-2.1 OpenRAIL++-M
terms.
More models in this format: Core AI Model Zoo — 75 models, each with the recipe that produced it.
Want a different model on-device? Open a request — free, open weights only; the export and its measured numbers get published publicly.
16 commits
4
stars
16
commits
6
linked in READMEs
Sep 7, 2026
updated
Core AI is Apple's on-device ML runtime in iOS 27 / macOS 27 and the successor to Core ML: PyTorch models are exported with Apple's 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).
On-device ×4 super-resolution with AdcSR (Adversarial Diffusion Compression, CVPR 2025) converted for Apple's Core AI stack. AdcSR compresses the one-step diffusion model OSEDiff into a small diffusion-GAN: a pruned Stable Diffusion 2.1 UNet + a half-size VAE decoder, run in one forward pass — no iterative denoising, no prompt, no noise — so it is fast and small enough to run fully on-device, including iPhone.
⚡ One line — this model is the default behind the kit's task op
(import CoreAIOps; no session, no model plumbing, downloads on first use):
let big = try await CoreAI.upscale(image)
Every op, one shape — Cookbook.
▶️ Run it (source) — the UpscaleDemo runner (pick a photo, upscale it ×4 on-device):
git clone https://github.com/john-rocky/coreai-kit
open coreai-kit/Examples/UpscaleDemo/UpscaleDemo.xcodeproj
# → Run, pick a photo — the app loads AdcSR ×4 (the catalog's superResolution entry) automatically
# agents / headless (macOS):
cd coreai-kit/Examples/UpscaleDemo
swift run upscale-cli --model adcsr-x4 --image sample_small.png --output big.png
💻 Build with it — complete; the glue is kit API, copy-paste runs:
import CoreAIKitVision
let resolver = try await SuperResolver(catalog: "adcsr-x4")
let image = try ImageFile.load(imageURL) // any image file → CGImage + EXIF orientation
let upscaled = try await resolver.upscale(image.cgImage)
// upscaled: CGImage — 4× the input's pixels
The take-home is Examples/UpscaleDemo/Sources/QuickStart.swift
— this exact code as one typed function, no UI; the CLI is an argument shell over it, and
the GUI runs the same resolver on the photo you pick.
Big photos? Inputs are tiled and feather-blended internally; maxInputSide (default 512)
caps the input first so a full-res phone photo can't produce a gigapixel result.
Integration checklist
https://github.com/john-rocky/coreai-kit → product CoreAIKitVisiondownloadProgress callback)SuperResolver after tiling (baking it per-tile blows up uniform tiles).lr [1,3,128,128] in [-1,1] (a low-resolution tile).sr [1,3,512,512] in [-1,1] (×4), with the reference's per-image color-match baked in.import CoreAIKitVision
let sr = try await SuperResolver(model: .adcsrX4) // downloads this repo on first use
let big = try await sr.upscale(cgImage) // ×4; tiles any-size input + feather-blends
SuperResolver splits any-size input into overlapping 128-px LR windows, runs each, and blends
(and caps very large inputs so the result stays a reasonable size).
This Core AI conversion inherits both. See LICENSE (Apache-2.0, AdcSR) and the SD-2.1 OpenRAIL++-M
terms.
More models in this format: Core AI Model Zoo — 75 models, each with the recipe that produced it.
Want a different model on-device? Open a request — free, open weights only; the export and its measured numbers get published publicly.
16 commits