---
title: "compileModel(at:)"
framework: Core ML
role: symbol
role_heading: Type Method
platforms: [iOS 16.0+, iPadOS 16.0+, Mac Catalyst 16.0+, macOS 13.0+, tvOS 16.0+, visionOS 1.0+]
path: "coreml/mlmodel/compilemodel(at:)-45ao6"
---

# compileModel(at:)

Compile a model for a device.

## Declaration

```swift
class func compileModel(at url: URL) async throws -> URL
```

## Parameters

- `url`: The URL to the model file.

## Mentioned in

Analyzing a Core ML model’s performance in Xcode

## Return Value

Return Value A URL to the compiled model directory, if successful; otherwise, nil.
