← ClaudeAtlas

shipping-a-model-in-an-ios-applisted

Put a local language model inside a native iOS or macOS app written in Swift. Covers MLX on Apple silicon, Core ML conversion, llama.cpp via a Swift wrapper, choosing between them, app binary size and memory limits, background and memory-pressure behaviour, and whether to bundle the model or download it on first run. Also covers when Apple Foundation Models is the better answer than shipping your own. Use when the project is native Swift for iOS, iPadOS or macOS and someone wants on-device or offline AI or local inference. Not for React Native or Expo projects, not for Android native Kotlin projects, not for Flutter, and not for models running on a server.
ErtasAI/open-model-skills · ★ 2 · AI & Automation · score 76
Install: claude install-skill ErtasAI/open-model-skills
# Shipping a model in an iOS app Before any of this: check whether shipping a model is even the right call. iOS 26 and later ships **Apple Foundation Models**, a roughly 3B on-device model built into the OS, reachable from Swift with no model to bundle, host, or update. For a task inside what that model can already do (summarising, rewriting, extracting structured fields, simple classification), the honest recommendation is to use it and skip everything below. Shipping a custom model is the right call when the task needs quality Apple's built-in model does not reach on its own, needs to run on hardware or an OS version Apple Intelligence does not cover, or needs to be portable to another platform. See "Or ship nothing at all" further down before starting the install steps. ## Which artifact shape this needs Two runtimes cover native Swift, and they take different artifact shapes. | You are holding | Package | What it eats | |---|---|---| | A merged Hugging Face checkpoint, converted with `mlx_lm.convert` | MLX Swift (`mlx-swift-lm`) | MLX-format safetensors | | A single `.gguf` file | LLM.swift (wraps llama.cpp) | GGUF, self-contained | **If what you are holding is a merged Hugging Face checkpoint** (`config.json` + `model*.safetensors`), it is not directly shippable into either package: MLX Swift needs it converted to MLX format first, and the GGUF path needs it converted to GGUF first. Run **inspecting-a-model-bundle** first to confirm which shape you actually have, th