Repository navigation
Releases: schappim/coreml-cli
Releases · schappim/coreml-cli
Release list
v1.1.0
Core ML CLI v1.1.0
coreml serve — run a model as a local HTTP API
The model is compiled and loaded once at startup and stays warm, so requests skip the model-loading cost that a fresh coreml predict pays every time. That makes a Core ML model callable from any language, not just the shell.
coreml serve MobileNetV2.mlmodelcurl -X POST -H 'Content-Type: image/jpeg' --data-binary @photo.jpg \
'http://127.0.0.1:8080/v1/predict?top=3'GET /health·GET /v1/info·POST /v1/predict- Input as raw bytes, a
multipart/form-dataupload (curl -F file=@photo.jpg), or JSON - Multi-input models are reachable for the first time.
coreml predictfeeds one file to the model, so a model with several inputs could not be driven from the CLI at all. Now:curl -X POST -H 'Content-Type: application/json' \ -d '{"inputs": {"sepal_length": 5.1, "sepal_width": 3.5, "petal_length": 1.4, "petal_width": 0.2}}' \ http://127.0.0.1:8080/v1/predict
?top=Ntrims classifier dictionaries and adds an orderedrankedarray, since JSON objects carry no ordering- Binds loopback by default.
--api-key,--cors,--allowed-host,--concurrency,--max-body-mbfor anything wider - The startup banner prints a
curlline matching your model's own input type, so the first request is a copy-paste
Fixed
- Image prediction was ~6x slower than it needed to be. A
CIContextwas built for every prediction; creating one sets up a GPU pipeline and cost far more than the render it was made for. 40 images throughcoreml batchwent from 2905 ms to 465 ms. Affectspredictandbatch, not justserve. coreml meta set --outputcould delete the model it was editing. The destination was removed before the source was copied into it, with nothing checking the two were different, so an--outputnaming the source erased it. Now refused, and the clone is staged and swapped in only after the write succeeds.- Multi-array outputs were truncated at 100 elements, so JSON results from embedding models silently lost data.
- A JSON tensor that did not match the model's input shape was silently truncated or left partly uninitialised, producing garbage predictions. Now an error naming both counts. Non-numeric values in a tensor are rejected rather than dropped.
Changed
swift-argument-parser1.7.1 → 1.8.2- CI and Dependabot configured for the repository
- Test suite grown from 105 to 212 tests
Requirements
- macOS 13.0 or later
- Apple Silicon or Intel Mac (the binary is universal)
Installation
Homebrew
brew tap schappim/coreml-cli
brew install coreml-cliManual
tar -xzf coreml-1.1.0-macos.tar.gz
sudo cp coreml /usr/local/bin/v1.0.0
Core ML CLI v1.0.0
A native command-line interface for working with Apple Core ML models on macOS.
Features
- inspect - View model structure, inputs/outputs, and metadata
- predict - Run inference on images, text, or JSON data
- batch - Process multiple files with concurrent execution
- benchmark - Measure inference latency and throughput
- compile - Convert .mlmodel to optimized .mlmodelc format
- meta - View and manage model metadata
Requirements
- macOS 13.0 or later
- Apple Silicon or Intel Mac
Installation
Homebrew (recommended)
brew tap schappim/coreml-cli
brew install coreml-cliManual
Download coreml-1.0.0-macos.tar.gz, extract, and copy to your PATH:
tar -xzf coreml-1.0.0-macos.tar.gz
sudo cp coreml /usr/local/bin/Quick Start
coreml inspect MobileNetV2.mlmodel
coreml predict MobileNetV2.mlmodel --input photo.jpg
coreml benchmark MobileNetV2.mlmodel --input sample.jpg