<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreML",
  "identifier" : "/documentation/CoreML/MLCustomModel",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Core ML"
    ],
    "preciseIdentifier" : "c:objc(pl)MLCustomModel"
  },
  "title" : "MLCustomModel"
}
-->

# MLCustomModel

An interface that defines the behavior of a custom model.

```
protocol MLCustomModel
```

## Overview

To integrate your custom model with Core ML, adopt the [`MLCustomModel`](/documentation/CoreML/MLCustomModel) protocol in the implementation of your custom model. If you use a Swift class for your custom implementation, make it accessible to Core ML by using the `@objc(`*name*`)` attribute.

```swift
@objc(MyCustomModel)
class MyCustomModel: NSObject, MLCustomModel {
  ...
}
```

This defines the Objective-C name for the class, which Core ML needs to access your custom class’s implementation.

## Topics

### Creating the model

[`init(modelDescription:parameters:)`](/documentation/CoreML/MLCustomModel/init(modelDescription:parameters:))

Creates a custom model with the given description and parameters.

### Making predictions

[`prediction(from:options:)`](/documentation/CoreML/MLCustomModel/prediction(from:options:))

Predicts output values from the given input features.

[`predictions(from:options:)`](/documentation/CoreML/MLCustomModel/predictions(from:options:))

Predicts output values from the given batch of input features.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)