The sample applications demonstrate how to integrate ANEMLL models into iOS and macOS applications. These apps provide a chat interface similar to popular LLM applications but running completely on-device using the Apple Neural Engine.
./anemll-chatbot/- iOS/macOS developers looking to integrate on-device LLMs
- Developers wanting to understand ANE model integration
- Anyone interested in building privacy-focused AI applications
- SwiftUI-based chat interface
- Supports both iOS and macOS platforms
- On-device inference using Apple Neural Engine
- Conversation history management
- Model download and management
- Progress indicators for long responses
- Token usage statistics
- Xcode 15.0 or later
- iOS 18.0 / macOS 15.0 or later
- For macOS: M1 chip or newer
- For iOS: A14 Bionic or newer (iPhone 12 and later)
- Minimum 4GB of free storage space for models
Note
Older 8-core iOS ANE devices may experience compatibility issues.
- 1B models: Compatible with most supported devices
- 3B models: Requires device with 8GB RAM
- 8B DeepSeek models: Only compatible with iPad Pro 16GB variants
- Memory Management: The application cannot pre-determine if a model will fit in device memory. On iOS/iPadOS devices, the operating system may terminate applications that sustain high memory usage, which could manifest as an app crash.
- Download Issues: If model downloads fail, you can use either the "Resume Download" option to continue from the last successful point, or "Force-Redownload" to start fresh.
- CoreML cache.
cd ./anemll-chatbot/
open anemll-chatbot.xcodeproj Important
Remember to change the Xcode Team and Bundle ID if you're building the project yourself. Selecf iOS or My Mac target device and compile for macOS we use MacCatalyst build target target : anemll-chatbot
The app supports several ways to use models:
- Default Model: App automatically downloads a 1B parameter model on first launch
- Custom HuggingFace Models: Add custom models via HuggingFace URL
- Local Models: Copy MLModels directly to your device using the Files app (iOS)
To switch between models:
- Select the desired model from the model list
- Click "Load Model" to load it into memory
- Select your target iOS device or simulator
- Choose the "anemll-chatbot" scheme
- Build and run (⌘R)
- Select "My Mac" as the target
- Choose the "anemll-chatbot" scheme and My Mac (MacCatalys)
- Build and run (⌘R)
- Download our TestFlight app for quick testing: TestFlight Link
- The app comes with a default 1B parameter model
- Additional models can be downloaded from our Hugging Face repository
- Custom models can be added via HuggingFace URLs
Note
This is an early beta release. We are actively working on:
- Improving quantization for reference models
- Fixing known issues
- Enhancing model conversion scripts
You can use your own models in two ways:
- Upload unzipped MLModels to HuggingFace then add Custom Model in the App useing repo's URL
- Copy models directly to your device using the Files app (iOS)
- Follow the instructions in prepare_hf.md to prepare your model for inference. For iOS deployment, make sure to use the
--iosflag when converting the model.
- Modify
ChatView.swiftto customize the chat interface - Adjust model parameters in
InferenceEngine.swift - Configure model download options in
ModelManager.swift
- iOS devices are limited to 1GB per chunk, so we need to split model in chunks
- Initial model loading may take a few seconds
For issues and questions:
- Create an issue on GitHub
- Contact us at realanemll@gmail.com
- Follow updates on @anemll