AI that lives on your iPhone.
Good for notes, writing, questions, and image help. Private by design, on device, and honest about what local AI does best.
What it's good for · Screenshots · Structure · Runtime Selection · Optional Gemma Bundle · Build
This repo contains the iOS app, landing page, and brand assets.
On eligible iPhones running iOS 26 or newer with Apple Intelligence available, Yemma uses SystemLanguageModel.default for zero-download text chat. Gemma 4 is an explicit optional 4.2 GB download for text and image chat, and the local choice for older or Apple Intelligence-ineligible devices. Yemma never downloads Gemma automatically. There is no cloud inference, no account, and no telemetry.
- Quick rewrites and everyday writing help
- Personal notes and thinking out loud
- Everyday questions answered on-device
- Image explanations and visual help
- Offline use — planes, commutes, anywhere without signal
- Low-friction, no-account AI when you just need a hand
Yemma is not trying to replace frontier cloud models. Where you need deep reasoning, broad world knowledge, or giant workflows, cloud AI is still better. Where you want something local, private, and always available, Yemma is a good fit.
- Streaming chat with markdown rendering, image attachments, and conversation history
- Zero-download text chat through Apple Foundation Models on eligible iOS 26+ Apple Intelligence devices
- Explicit optional Gemma 4 download (~4.2 GB) for text and image inference via
MLXVLM - Resumable background Gemma download and strict local bundle validation
- Configurable response style, temperature, and response limits
- Light / Dark / System appearance modes
- Built-in diagnostics, debug probes, and simulator mock mode
|
|
|
| Advanced controls Temperature, context window, flash attention, response length. |
Debug probes Markdown and renderer test scenarios. |
Diagnostics Event log, copyable logs, runtime metadata. |
ContentView.swift— root state machine (onboarding vs chat)LLMService.swift— runtime selection, generation, streaming, and MLX lifecycleAppleFoundationModelRuntime.swift— iOS 26 availability, Apple transcript shaping, and snapshot streamingMLXModelSupport.swift— model directory validation and Gemma 4 asset contract checksModelDownloader.swift— optional Gemma download, resume, cleanup, and local validationConversationStore.swift— chat history persistenceChatMessage.swift— app-owned message, user, and attachment value typesYemmaPromptPlanner.swift— prompt shaping for the chat experienceGemma4SmokeAutomation.swift— smoke checks for the shipped model pathChatSidebarView.swift/AdvancedSettingsView.swift— preferences, runtime tuning, diagnostics, and debug probesDebugInferenceScenario.swift— debug prompt and renderer scenariosAppearance.swift— theme systemwebsite/— landing page and brand assets
- Simulator: deterministic mock replies; neither real runtime is invoked.
- Eligible iOS 26+ Apple Intelligence device: Apple Foundation Models is the zero-download initial runtime for text chat.
- iOS 17-25 or Apple Intelligence-ineligible device: Gemma 4 is the initial runtime choice, but its 4.2 GB download begins only when the user starts setup.
- Images: choose the optional Gemma 4 runtime. Yemma's Apple runtime is text-only.
- Apple Intelligence off, model not ready, or unsupported language: Yemma explains the unavailable state and lets the user enable Apple Intelligence or explicitly choose Gemma.
Both runtimes operate on device. Real inference requires a physical iPhone; Simulator builds keep using mock replies.
Yemma originally ran Gemma 4 through two separate GGUF assets: a text model plus a standalone mmproj vision projector. The current MLX integration replaces that with one Swift-native multimodal bundle and one runtime container.
The important distinction is that MLX Swift already provided the general model-loading, tokenizer, and VLM infrastructure. The missing work was Gemma 4 support on the Swift side, plus Yemma-specific integration around download, validation, prompt shaping, and runtime lifecycle.
Validated upstream baseline:
mlx-swift-lmat3.31.3for Gemma 4 model, processor, and parity fixesmlx-swift-examplesat31b6cf6for app-side smoke validation and request-shaping patterns
How the optional Gemma integration works:
Yemma4.xcodeprojdeclaresMLX,MLXLMCommon,MLXVLM,Hub, andTokenizers, so the runtime stays inside Swift instead of bridging throughllama.cppor Objective-C++ vision code.- After the user selects Gemma and starts setup,
ModelDownloaderpullsmlx-community/gemma-4-e2b-it-4bitusing*.safetensors,*.json, and*.jinjapatterns instead of downloading a text GGUF and a secondmmprojfile. ModelDirectoryValidatorproves the downloaded bundle is structurally usable by checking required metadata files, processor config, tokenizer files, weight shards, and safetensors index references before the app accepts setup as complete.Gemma4MLXSupportenforces the Gemma 4 multimodal asset contract in Swift by cross-checking processor and model values like soft-token budgets, patch size, and pooling kernel size. It also normalizes a known compatibility gap when a bundle is missing a top-levelpad_token_id.LLMServiceconverts each conversation turn into structuredChat.MessageandUserInputvalues with optional image URLs, then callscontext.processor.prepare(input:)so MLX performs the image and text preprocessing directly inside the same runtime path as inference.- The current implementation uses
VLMModelFactory.shared._load(...)to load the entire Gemma 4 VLM from one local directory, so text generation and image understanding live in oneModelContainerinstead of separate GGUF and projector runtimes. - Yemma still adds app-side stability logic around the MLX runtime, including prompt shaping, smoke checks, and output filtering for noisy hidden-channel and control-token responses.
What that buys us:
- no standalone
mmprojdownload - no Objective-C++ multimodal bridge
- one optional model bundle to download, validate, load, unload, and delete
- one Swift runtime path for both text-only and image-assisted turns
- Download source:
mlx-community/gemma-4-e2b-it-4bit - Approximate first-download size:
4.2 GB - Downloaded file classes: safetensors weights, tokenizer/config JSON, processor config, and chat template files
- Runtime contract:
config.json,tokenizer.json,tokenizer_config.json,processor_config.jsonorpreprocessor_config.json, plus one or more readable.safetensorsweight files and any referenced safetensors index entries
Yemma does not download this bundle automatically. After the user chooses Gemma and completes setup, Yemma can load, unload, and run it entirely on device.
- Open
Yemma4.xcodeproj; it is the sole build graph and owns the pinned SwiftPM dependencies. - Use Xcode 26 or newer with an iOS 26 SDK. The deployment target remains iOS 17 and the app and test targets currently compile in Swift 5 language mode.
- Run
./scripts/local_validation.shfor simulator tests plus an unsigned Release compile for a generic iOS device. - Run on a physical iPhone for real Apple Foundation Models or Gemma inference.
- Use
./scripts/sim_run.shonly when you also want to install and launch the mocked simulator app. - Use
./scripts/device_startup_probe.shwhen you need a clean first-launch timing probe on an already installed device build.
Lint (optional, not a build dependency): with SwiftLint installed, run swiftlint lint --config .swiftlint.yml --quiet.
App Store Connect deployment via asc-cli.
MIT. See LICENSE.


