coreml
Core ML is Apple's machine learning framework for deploying trained models on Apple devices — iPhones, iPads, Macs, Apple Watch, and Apple TV — enabling efficient on-device inference that leverages the Apple Neural Engine (ANE), GPU, and CPU with automatic hardware selection for optimal performance and energy efficiency. Core ML provides a complete deployment pipeline: model conversion (converting trained models from PyTorch, TensorFlow, ONNX, and other frameworks to the .mlmodel or .mlpackage format using coremltools), on-device optimization (compressing models through quantization, palettization, and pruning to fit device constraints), hardware acceleration (automatically dispatching operations to the most efficient compute unit — ANE for neural network operations, GPU for parallel computation, CPU for unsupported operations), and privacy preservation (all inference runs locally without sending data to servers). Core ML model conversion using coremltools supports: PyTorch models (via TorchScript or direct export), TensorFlow/Keras models, ONNX models, scikit-learn models, and XGBoost models. The framework handles common model types: image classification and detection, natural language processing, sound analysis, pose estimation, depth estimation, and generative models. Core ML integrates with Apple's larger ML ecosystem: Vision framework (image analysis APIs), Natural Language framework (text processing), Speech framework (speech recognition), and Create ML (training simple models directly on Mac). Performance optimizations include: model compilation (ahead-of-time compilation for faster loading), batch prediction support, flexible input shapes, custom operators (for operations not natively supported), and model encryption (protecting proprietary models on user devices). The Apple Neural Engine, present in A-series and M-series chips, provides dedicated hardware for neural network inference with high throughput and energy efficiency — performing up to 15.8 trillion operations per second on M2 chips. Core ML enables applications like real-time photo enhancement, on-device translation, intelligent text prediction, and augmented reality without network connectivity.