---
title: "load(_:configuration:completionHandler:)"
framework: coreml
role: symbol
role_heading: Type Method
path: "coreml/mlmodel/load(_:configuration:completionhandler:)"
---

# load(_:configuration:completionHandler:)

Construct a model asynchronously from a compiled model asset.

## Declaration

```swift
class func load(_ asset: MLModelAsset, configuration: MLModelConfiguration, completionHandler handler: @escaping @Sendable (MLModel?, (any Error)?) -> Void)
```

```swift
class func load(asset: MLModelAsset, configuration: MLModelConfiguration) async throws -> MLModel
```

## Parameters

- `asset`: The compiled model asset derived from in-memory or on-disk Core ML model.
- `configuration`: The model configuration that holds options for loading the model.
- `handler`: The completion handler invoked when the load completes. A valid doc://com.apple.coreml/documentation/CoreML/MLModel returns on success, or an error if failure.

## See Also

### Loading a model

- [load(contentsOf:configuration:)](coreml/mlmodel/load(contentsof:configuration:).md)
- [load(contentsOf:configuration:completionHandler:)](coreml/mlmodel/load(contentsof:configuration:completionhandler:).md)
- [init(contentsOf:)](coreml/mlmodel/init(contentsof:).md)
- [init(contentsOf:configuration:)](coreml/mlmodel/init(contentsof:configuration:).md)
- [init(contentsOfURL:)](coreml/mlmodel/init(contentsofurl:).md)
- [init(contentsOfURL:configuration:)](coreml/mlmodel/init(contentsofurl:configuration:).md)
