iOS
Deploy your On-device AI application to Xcode
NPU Acceleration, Simplified.
Leveraging the Neural Engine on iOS often requires deep knowledge of CoreML, Metal Performance Shaders, and low-level buffer management.
ZETIC.MLange abstracts this entire stack. We provide a unified Swift interface that handles the compilation, optimization, and execution on the Neural Engine automatically. No manual graph bridging required.
Prerequisites
Before you begin, make sure you have:
- Model Key: Prepare using the Web Dashboard (SaaS) or CLI method
- Personal Key: Prepare using the Web Dashboard (SaaS) method
Step-by-step Guide
Add ZeticMLange Package to Project
We use Swift Package Manager (SPM) to automatically resolve and link the binary dependencies required for NPU acceleration.
- Click File → Add Package Dependencies in Xcode
- Search for
https://github.com/zetic-ai/ZeticMLangeiOS.git - Click Add Package
Select Target for ZeticMLange Package
Link the ZeticMLange library to your specific application target. This injects the Unified HAL runtime into your app bundle.
- Select target in the Add to Target column
- Click Add Package
Initialize and Run ZeticMLangeModel
Initialize the model to trigger the Zero-Copy Model Loader, which maps your model directly to NPU memory.
// (1) Load Zetic MLange model
// This handles model download (if needed) and NPU context creation
let model = try ZeticMLangeModel(personalKey: PERSONAL_KEY, name: PROJECT_NAME, version: VERSION)
// (2) Prepare model inputs
// Ensure input shapes match your model's requirement (e.g., Float32 arrays)
let inputs: [Tensor] = [] // Prepare your inputs
// (3) Run Inference
// Executes the fully automated hardware graph.
// No manual delegate configuration or memory syncing required.
let outputs = try model.run(inputs)Sample Application
Please refer to MLange iOS sample app repository for complete sample applications and more details.