Designs private on-device AI for Apple platforms with Foundation Models (including iOS 27 LanguageModel providers, Private Cloud Compute, multimodal prompts, Dynamic Profiles), Core AI, Core ML, MLX Swift, or llama.cpp. Use for local LLM runtime selection, Apple Intelligence chat or tool use, Apple Silicon inference, model conversion/compression, or backend comparison; route Core ML prediction code to coreml.
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Architect and deploy private on-device machine learning and LLMs on Apple Silicon. Covers framework selection between Apple Foundation Models, Core ML, MLX Swift, and llama.cpp, plus model optimization and quantization.
Scope Boundary: Swift-side Core ML inference and model caching live in
coreml. This skill owns backend selection, architecture, model conversion, and LLM runtimes.
| Framework | Best For | Pros | Constraints |
|---|---|---|---|
Apple Foundation Models (iOS 26+; iOS 27 adds images, Private Cloud Compute, custom LanguageModel) | Text generation, structured output, tool calling | Zero app download footprint, native system UI integration | Requires Apple Intelligence eligible device |
| Core AI (iOS 27+) | Running your own models in Swift; LLMs through a Foundation Models session | Memory-safe Swift API, specialization cache, Neural Engine/GPU/CPU selection | iOS 27 only; background Neural Engine needs an entitlement |
| Core ML | Computer vision, audio, classification, custom transformer models | Best Neural Engine offload, lowest power consumption | Fixed compute graph; slower autoregressive text generation |
| MLX Swift | Custom open-weights LLMs/VLMs (Llama, Mistral, Gemma) | Full control over model architecture and generation parameters | Consumes user storage and unified RAM (high memory pressure) |
| llama.cpp | Cross-platform C++ runtime, CPU fallback | Broadest quantization support (GGUF), battle-tested | Higher power usage than Neural Engine pipelines |
Leverage system-provided generative models on iOS 26+ without bundling model weights:
import FoundationModels
let session = LanguageModelSession()
let response = try await session.respond(to: "Summarize today's highlights in 3 bullet points.")
print(response.text)Use @Generable to extract structured data directly from model prompts.
iOS 27 keeps the same LanguageModelSession API but lets you swap the model: SystemLanguageModel, PrivateCloudComputeLanguageModel (server model, managed entitlement, quota), CoreAILanguageModel (your own exported weights), or any custom LanguageModel. It also adds image Attachment prompts and DynamicProfile for switching model, tools, and instructions mid-session. Gate with #available(iOS 27, *). Details: Foundation Models in iOS 27.
Convert PyTorch and Hugging Face models using Python coremltools:
import coremltools as ct
import torch
model = MyPyTorchModel().eval()
traced = torch.jit.trace(model, torch.randn(1, 3, 224, 224))
mlmodel = ct.convert(
traced,
inputs=[ct.TensorType(name="input", shape=(1, 3, 224, 224))],
compute_units=ct.ComputeUnit.ALL
)
mlmodel.save("Model.mlpackage")Run open-source LLMs leveraging Apple Silicon unified memory:
import MLXLLM
let model = try await LLMModelFactory.shared.load(modelName: "mlx-community/Llama-3.2-3B-Instruct-4bit")
let output = try await model.generate(prompt: "Explain relativity in simple terms.")coremltools.optimize.coreml to reduce memory bandwidth bottlenecks.#available(iOS 27, *) and keep the iOS 26 path.MLComputePlan or Instruments@Generable, tool calling, prompt designLanguageModel protocol, Private Cloud Compute, multimodal, Dynamic Profiles, Core AI in a sessionthienqo/ios-skills
6bf8b62
Canonical home
since May 23, 2026
Also appears in
on Oct 29, 2026
since May 28, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.