coremltools
Community Tools for Core ML
What it is and what it does
coremltools is a Python package for working with Apple's Core ML format (.mlmodel), the standard for machine learning models on iOS, iPadOS, watchOS, macOS, and tvOS. It lets you convert trained models from popular ML frameworks into Core ML format, write models directly to .mlmodel using a simple API, and verify conversions by making predictions through the Core ML framework on supported platforms.
The package depends on numpy, protobuf, sympy, tqdm, packaging, attrs, cattrs, and pyaml to handle model serialization, computation, and data transformation. It is actively maintained, supports Python 3.7–3.13, and has pre-built wheels for macOS and Linux, making installation straightforward on most development machines. Core ML models can then be directly integrated into Xcode projects for deployment on Apple devices.
Use it for:
- Convert a trained TensorFlow or PyTorch model to Core ML format for deployment in an iOS app.
- Export a scikit-learn decision tree or random forest to .mlmodel for use in a macOS application.
- Examine and validate a Core ML model's structure and metadata before shipping it to production.
- Test model predictions on macOS or iOS using the Core ML framework to verify conversion accuracy.
- Build a pipeline to automatically convert and package ML models for distribution via Xcode.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts trained machine learning models from popular frameworks into Apple's Core ML format (.mlmodel) and provides tools to examine, test, and make predictions with Core ML models.
Yes, if you are developing machine learning features for Apple platforms (iOS, macOS, watchOS, tvOS). coremltools is the standard tool for converting models to Core ML format and is actively maintained with no known vulnerabilities. Install friction is moderate due to multiple dependencies, but pre-built wheels are available for common platforms. Not relevant if you are not targeting Apple devices.
Install
coremltools on PyPI
pip
pip install coremltoolsuv
uv add coremltoolspoetry
poetry add coremltoolsInstalling coremltools
Before you install
Medium install friction: pre-built wheels available for Python 3.7–3.13 on macOS (x86_64 and arm64) and Linux (x86_64), but 8 runtime dependencies (numpy, protobuf, sympy, tqdm, packaging, attrs, cattrs, pyaml) may require compilation or system libraries on some platforms. Active maintenance with recent commits.
License in practice
BSD 3-Clause license (permissive): you can use, modify, and distribute coremltools freely in commercial and open-source projects, provided you include the license notice and disclaimer.
Quickstart
pip install coremltools
import coremltools
# Convert a model (e.g., from a trained framework) to Core ML format
ml_model = coremltools.converters.convert(trained_model)
ml_model.save('model.mlmodel')
Conversion and prediction features require a trained model from a supported framework (e.g., TensorFlow, PyTorch, scikit-learn); prediction on Core ML models requires macOS, iOS, or compatible Apple platform.
Verify before relying
- Which machine learning frameworks are supported for conversion (e.g., TensorFlow, PyTorch, scikit-learn, XGBoost).
- Whether prediction functionality works on Linux or only on Apple platforms.
- Specific version constraints or compatibility notes for numpy, protobuf, or other runtime dependencies.
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 8 — numpy, protobuf, sympy, tqdm, packaging, attrs, cattrs, pyaml |
| Maintenance | actively maintained — 277 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,900,491/month — #3,443 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: coremltools-9.0-cp310-none-macosx_10_15_x86_64.whl; coremltools-9.0-cp310-none-macosx_11_0_arm64.whl; coremltools-9.0-cp310-none-manylinux1_x86_64.whl; coremltools-9.0-cp311-none-macosx_10_15_x86_64.whl; coremltools-9.0-cp311-none-macosx_11_0_arm64.whl; coremltools-9.0-cp311-none-manylinux1_x86_64.whl; coremltools-9.0-cp312-none-macosx_10_15_x86_64.whl; coremltools-9.0-cp312-none-macosx_11_0_arm64.whl; coremltools-9.0-cp312-none-manylinux1_x86_64.whl; coremltools-9.0-cp313-none-macosx_10_15_x86_64.whl; coremltools-9.0-cp313-none-macosx_11_0_arm64.whl; coremltools-9.0-cp313-none-manylinux1_x86_64.whl; coremltools-9.0-cp37-none-macosx_10_15_x86_64.whl; coremltools-9.0-cp37-none-manylinux1_x86_64.whl; coremltools-9.0-cp38-none-macosx_10_15_x86_64.whl; coremltools-9.0-cp38-none-macosx_11_0_arm64.whl; coremltools-9.0-cp38-none-manylinux1_x86_64.whl; coremltools-9.0-cp39-none-macosx_10_15_x86_64.whl; coremltools-9.0-cp39-none-macosx_11_0_arm64.whl; coremltools-9.0-cp39-none-manylinux1_x86_64.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
pyobjc-framework-CoreMLProvides Python bindings to Apple's CoreML…
permissive · top 5,000 on PyPI
onnxmltoolsConverts machine learning models from multiple…
permissive · top 5,000 on PyPI
azureml-train-coreProvides estimator classes for training machine…
unclear · top 15,000 on PyPI
treeliteTreelite serializes and exchanges decision tree…
permissive · top 15,000 on PyPI
keynote-parserUnpack, edit, and re-pack Apple Keynote .key…
permissive · top 15,000 on PyPI
ai-edge-litert-nightlyLiteRT is a runtime for running trained machine…
permissive · top 15,000 on PyPI
pytabkitPyTabKit provides scikit-learn interfaces to…
permissive · top 15,000 on PyPI
tensorflow-decision-forestsTrains and deploys decision forest models…
permissive · top 15,000 on PyPI
azureml-coreProvides core APIs and utilities for managing…
unclear · top 5,000 on PyPI
interpret-coreTrains interpretable machine learning models…
unclear · top 5,000 on PyPI