Offline AI chat agent for iPhone, iPad, and Mac. Runs MLX language models on-device with tool calling support.
- Apple Silicon Mac (M1 or later)
- macOS 15+ / iOS 18+
- Xcode 16+ with Swift 6.0
- ~3 GB free disk space for model download
swift build
swift run PongChatopen Package.swiftSelect the PongChat scheme, pick a destination (My Mac or an Apple Silicon iOS device), and hit Run (Cmd+R).
Note: MLX requires Apple Silicon — the iOS Simulator is not supported. Use a physical device or build for macOS.
On first run the app downloads the default model (~2.5 GB) from Hugging Face. This is cached locally so subsequent launches are instant. An internet connection is only needed for this initial download — after that, inference runs fully offline.
Built-in model options (all under 6B parameters, 4-bit quantized):
| Model | Size | Tool Calling | Best For |
|---|---|---|---|
| Qwen 3.5 4B (default) | ~2.5 GB | Yes | iPad / Mac |
| Qwen 3 0.6B | ~400 MB | Yes | iPhone |
| Llama 3.2 3B | ~1.8 GB | Yes | General use |
| Llama 3.2 1B | ~800 MB | No | Simple chat |
| Phi 3.5 Mini | ~2.2 GB | No | Reasoning |
When tool calling is enabled, the agent can:
- Web search — opens a search in Safari
- Open URL — opens any URL in the browser
- Calendar — read today's events (requires permission)
- Reminders — create reminders (requires permission)
- Files — list and read files in the Documents directory
- Shortcuts — run Siri Shortcuts by name
- Location — get current location (requires permission)
- Time — get current date and time
- Weather — get weather for a location (simulated)
- Math — add two numbers
PongChat/
├── PongChatApp.swift # App entry point
├── Models/
│ ├── ChatMessage.swift # Message data model
│ └── ToolDefinitions.swift # Tool I/O types
├── ViewModels/
│ ├── LLMEvaluator.swift # Chat engine + agent loop
│ └── DeviceStat.swift # GPU memory monitoring
├── Views/
│ ├── ContentView.swift # Root view
│ ├── ChatView.swift # Chat message list
│ ├── MessageBubble.swift # Liquid Glass message bubbles
│ ├── InputBar.swift # Text input with glass effect
│ ├── SettingsView.swift # Generation parameters
│ └── ModelPickerView.swift # Model selection
└── Services/
├── ToolExecutor.swift # Tool schema + dispatch
├── DeviceTools.swift # On-device tool implementations
└── ToolCallParser.swift # Qwen <tool_call> XML parser
Built on Apple MLX Swift and the LLMEval example.