<!--
{
  "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/MLModelConfiguration",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core ML"
    ],
    "preciseIdentifier" : "c:objc(cs)MLModelConfiguration"
  },
  "title" : "MLModelConfiguration"
}
-->

# MLModelConfiguration

The settings for creating or updating a machine learning model.

```
class MLModelConfiguration
```

## Overview

Use a model configuration to:

- Set or override model parameters.
- Designate which device the model uses to make predictions, such as a GPU.
- Restrict the model to use a specific computational device category, such as a CPU.

You typically use a model configuration instance to configure an [`MLModel`](/documentation/CoreML/MLModel) instance as you create it with [`init(contentsOf:configuration:)`](/documentation/CoreML/MLModel/init(contentsOf:configuration:)) or create an [`MLUpdateTask`](/documentation/CoreML/MLUpdateTask). See [Personalizing a Model with On-Device Updates](/documentation/CoreML/personalizing-a-model-with-on-device-updates).

Configure your model parameters by setting values for each relevant [`MLParameterKey`](/documentation/CoreML/MLParameterKey) in the [`parameters`](/documentation/CoreML/MLModelConfiguration/parameters) property.

## Topics

### Configuring model parameters

[`functionName`](/documentation/CoreML/MLModelConfiguration/functionName)

Function name that `MLModel` will use.

[`modelDisplayName`](/documentation/CoreML/MLModelConfiguration/modelDisplayName)

A human readable name of a model for display purposes.

[`parameters`](/documentation/CoreML/MLModelConfiguration/parameters)

A dictionary of configuration settings your app can override when loading a model.

[`MLParameterKey`](/documentation/CoreML/MLParameterKey)

The keys for the parameter dictionary in a model configuration or a model update context.

### Configuring GPU usage

[`preferredMetalDevice`](/documentation/CoreML/MLModelConfiguration/preferredMetalDevice)

The metal device you prefer this model use to make predictions (inference) and update the model.

[`allowLowPrecisionAccumulationOnGPU`](/documentation/CoreML/MLModelConfiguration/allowLowPrecisionAccumulationOnGPU)

A Boolean value that determines whether to allow low-precision accumulation on a GPU.

### Allowing access to processing units

[`computeUnits`](/documentation/CoreML/MLModelConfiguration/computeUnits)

The processing unit or units the model uses to make predictions.

[`MLComputeUnits`](/documentation/CoreML/MLComputeUnits)

The set of processing-unit configurations the model can use to make predictions.

### Getting optimization hints

[`optimizationHints`](/documentation/CoreML/MLModelConfiguration/optimizationHints-1oq0g)

A group of hints for CoreML to optimize

[`optimizationHints`](/documentation/CoreML/MLModelConfiguration/optimizationHints-81u6f)

A group of hints for CoreML to optimize



---

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)