What is CoreML and how does it enable offline AI on Apple devices?
CoreML is Apple machine learning framework for running models on iOS, iPadOS, macOS, watchOS, and tvOS devices. It provides optimized inference by automatically leveraging the Neural Engine, GPU, and CPU based on model characteristics and device capabilities. CoreML supports models converted from PyTorch, TensorFlow, and other frameworks via coremltools. It handles model loading, memory management, and hardware dispatch automatically. CoreML supports on-device model personalization through training layers on user data without sending it to servers. The framework integrates with Vision for image analysis, Natural Language for text processing, and Speech for audio tasks. For developers, CoreML provides a simple API that abstracts hardware complexity while delivering optimized performance. Models can be compressed using palettization, quantization, and pruning within the CoreML toolchain.