---
title: "compileModel(at:completionHandler:)"
framework: coreml
role: symbol
role_heading: Type Method
path: "coreml/mlmodel/compilemodel(at:completionhandler:)"
---

# compileModel(at:completionHandler:)

Compile a model for a device.

## Declaration

```swift
class func compileModel(at url: URL, completionHandler handler: @escaping (Result<URL, any Error>) -> Void)
```

## Parameters

- `url`: The URL to the model file.
- `handler`: The completion handler the framework calls when the compilation completes.

## See Also

### Compiling a model

- [compileModel(at:)](coreml/mlmodel/compilemodel(at:).md)
