git404hub

what is coremltools fr?

apple/coremltools — explained in plain English

Analysis updated 2026-05-18

5,271PythonAudience · developerComplexity · 3/5LicenseSetup · moderate

tl;dr

Apple's official Python library for converting AI models trained in PyTorch, TensorFlow, or scikit-learn into Core ML format so they run on-device in iPhone, iPad, and Mac apps without a server.

vibe map

mindmap
  root((repo))
    What it does
      Convert models to Core ML
      Optimize for Apple hardware
      Verify model accuracy
    Supported Inputs
      PyTorch
      TensorFlow 1 and 2
      scikit-learn
      XGBoost and LibSVM
    Apple Targets
      iPhone and iPad
      Mac apps
      Neural Engine
    Use Cases
      On-device inference
      Private AI features
      Offline model serving
    Workflow
      pip install
      Convert model
      Bring into Xcode

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Convert a trained PyTorch image classifier to run fully offline on an iPhone without sending data to a server.

VIBE 2

Optimize an existing Core ML model to run faster on the iPhone Neural Engine.

VIBE 3

Verify that a converted Core ML model produces the same predictions as the original PyTorch model.

VIBE 4

Add on-device AI to a Mac app by converting a scikit-learn or XGBoost model to Core ML format.

what's the stack?

PythonPyTorchTensorFlowCore MLscikit-learnXGBoost

how it stacks up fr

apple/coremltoolskarpathy/build-nanogptfacebookresearch/sapiens
Stars5,2715,3055,393
LanguagePythonPythonPython
Last pushed2024-08-132026-05-26
MaintenanceStaleMaintained
Setup difficultymoderatemoderatehard
Complexity3/53/54/5
Audiencedeveloperdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · moderate time til it works · 30min

Requires Xcode and an Apple developer account to deploy converted models to iOS or macOS apps.

Use freely for any purpose including commercial apps under Apple's BSD-style license, as long as you keep the copyright notice.

in plain english

This is Apple's official Python library for converting machine learning models into the Core ML format, which is the format Apple devices use to run AI models in apps. If you have trained a model using a popular framework like PyTorch, TensorFlow, scikit-learn, or XGBoost, you can use this library to convert it into a form that an iPhone, iPad, or Mac application can use directly. Core ML is Apple's system for running on-device AI. Instead of sending data to a remote server for processing, Core ML runs the model locally on the device using its CPU, GPU, or Neural Engine. This keeps user data private, reduces power consumption, and avoids the need for a network connection. Beyond conversion, the library also lets you read, edit, and optimize existing Core ML model files, and verify that a converted model produces correct results. Once you have a converted model, you bring it into Xcode, Apple's app development tool, to integrate it into your application. The library supports converting from TensorFlow 1 and 2, PyTorch, scikit-learn, XGBoost, and LibSVM. Installation is through pip, the standard Python package tool. The project is maintained by Apple and includes guides, API documentation, and a specification for the Core ML file format.

prompts (copy fr)

prompt 1
Convert my PyTorch image classification model to Core ML format using coremltools. Here is my model definition: [paste code].
prompt 2
I have a TensorFlow 2 text classification model. Walk me through converting it to Core ML with coremltools so I can use it in an iOS app.
prompt 3
How do I verify that my coremltools-converted model gives the same predictions as my original PyTorch model before shipping it?
prompt 4
I want to run a Core ML model on the iPhone Neural Engine for maximum speed. What optimizations should I apply with coremltools?
prompt 5
After converting my model with coremltools, how do I load and test the .mlmodel file in Xcode?

Frequently asked questions

what is coremltools fr?

Apple's official Python library for converting AI models trained in PyTorch, TensorFlow, or scikit-learn into Core ML format so they run on-device in iPhone, iPad, and Mac apps without a server.

What language is coremltools written in?

Mainly Python. The stack also includes Python, PyTorch, TensorFlow.

What license does coremltools use?

Use freely for any purpose including commercial apps under Apple's BSD-style license, as long as you keep the copyright notice.

How hard is coremltools to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is coremltools for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.