Swiftpack.co -  mlfairy/mlfairy as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Improve your CoreML models with MLFairy
.package(url: "https://github.com/mlfairy/mlfairy.git", from: "0.0.4")


codebeat badge Platforms

MLFairy gives developers the tools needed to better understand their CoreML models. It gives them the ability to update and deploy their latest CoreML model. MLFairy also gives you the ability to collect predictions from your model, so you can improve your model based on real-world results from your app.


MLFairy only supports Swift Package Manager, add the following to your Package.swift

.package(name: "MLFairy", url: "https://github.com/mlfairy/mlfairy.git", from: "0.0.3"),

Or add the following URL when adding the dependencies in Xcode through File > Swift Packages > Add Package Dependencies



Downloading the latest CoreML model

After installing MLFairy, you can access an API like this:

private let TOKEN = "<get your token from your account at www.mlfairy.com>"
let model = <Generated Class from .mlmodel file>()
MLFairy.getCoreMLModel(TOKEN) { response in
	switch (response.result) {
		case .success(let model):
			guard let model = model else {
				print("Failed to get CoreML model.")
			// Assign the returned model to your existing model
			// If you want to collect predictions, you can assign your model to response.mlFairyModel
			model.model = model
		case .failure(let error):
			print("Failed to get CoreML model \(String(describing: error)).")

Automatically collect predictions

You can collect your model's predictions using MLFairy. You can do this with MLFairy.wrapCoreMLModel.

private let TOKEN = "<get your token from your account at www.mlfairy.com>"
let model = <Generated Class from .mlmodel file>()
model.model = MLFairy.wrapCoreMLModel(model.model, token: TOKEN)

Note: MLFairy.getCoreMLModel also returns an optional wrapped model if you are using MLFairy for model distribution.


MLFairy is released under an GPL-3 license. See License.txt for more information.


Stars: 0
Last commit: 4 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

Version 0.0.4
4 weeks ago
  • [NEW] First Swift Package Manager release

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API