coreml

Integrates Core ML models into iOS apps with Swift APIs and MLModelConfiguration.

Updated May 10, 2026
One-click install
npx skills add https://github.com/FelixRauch/medat-figuren --skill coreml-felixrauch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coreml
Source: https://github.com/FelixRauch/medat-figuren/tree/main/.agents/skills/coreml
Command: npx skills add https://github.com/FelixRauch/medat-figuren --skill coreml-felixrauch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves the challenge of integrating Core ML models into iOS apps efficiently, reliably, and with good on-device performance so predictions run fast without blocking the UI.

Core Features & Use Cases

  • On-device model loading and reuse: Load .mlmodelc / .mlpackage using MLModelConfiguration, avoid repeated model instantiation, and support async loading.
  • Compute unit optimization: Configure CPU/GPU/Neural Engine usage via MLModelConfiguration and verify dispatch with MLComputePlan.
  • End-to-end prediction patterns: Run predictions with typed auto-generated model classes, MLFeatureProvider/MLDictionaryFeatureProvider, Vision integration, batch inference, and stateful inference using MLState (iOS 18+).
  • Pre/post-processing support: Handle image preprocessing with CVPixelBuffer, use Vision to manage resizing/orientation, and work with MLTensor / MLMultiArray for numeric pipelines.

Quick Start

Load a Core ML model from your app bundle with an MLModelConfiguration that selects appropriate compute units, then run an async prediction using the model’s typed input/output class (or MLDictionaryFeatureProvider) for your input data.

Frequently Asked Questions about coreml

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Core ML inference on iOS without blocking the UI?

To run Core ML inference without blocking the UI, load your model using MLModelConfiguration and execute predictions asynchronously. This ensures fast on-device machine learning processing while keeping the main thread responsive.

How do I configure CPU, GPU, and Neural Engine usage for Core ML predictions?

Configure CPU, GPU, and Neural Engine dispatch by setting compute units in MLModelConfiguration. You can verify the actual hardware allocation and optimize performance using MLComputePlan profiling before running predictions.

What is the best way to handle image preprocessing for Core ML models in Swift?

The best way to handle image preprocessing for Core ML is using CVPixelBuffer alongside the Vision framework. Vision manages resizing and orientation, ensuring inputs correctly match your model's expected feature provider format.

Can I run batched Core ML predictions and manage stateful inference?

Yes, you can run batched Core ML predictions and manage stateful inference using MLState on iOS 18+. This supports multi-model pipeline scenarios and handles typed inputs efficiently using auto-generated Swift classes.

How do I handle MLMultiArray and MLTensor data in numeric Core ML pipelines?

Handle MLMultiArray and MLTensor data in numeric Core ML pipelines by passing them directly through MLFeatureProvider or MLDictionaryFeatureProvider. This ensures correct typed data handling for model inputs and outputs.

Why should I avoid repeated instantiation when loading .mlmodelc files?

Avoiding repeated instantiation when loading .mlmodelc files prevents unnecessary memory overhead and latency. Reusing a single model instance with MLModelConfiguration enables efficient on-device loading and sustained prediction throughput.