---
title: "init(model:completionHandler:)"
framework: vision
role: symbol
role_heading: Initializer
path: "vision/vncoremlrequest/init(model:completionhandler:)"
---

# init(model:completionHandler:)

Creates a model container to use with an image analysis request based on the model you provide, with an optional completion handler.

## Declaration

```swift
init(model: VNCoreMLModel, completionHandler: VNRequestCompletionHandler? = nil)
```

## Parameters

- `model`: The doc://com.apple.documentation/documentation/CoreML model on which to base the Vision request.
- `completionHandler`: An optional block of code to execute after model initialization.

## Discussion

Discussion Initialization can fail if the Core ML model you provide isn’t supported in Vision, such as if the model doesn’t accept an image as input.

## See Also

### Initializing with a Core ML Model

- [init(model:)](vision/vncoremlrequest/init(model:).md)
- [model](vision/vncoremlrequest/model.md)
- [VNCoreMLModel](vision/vncoremlmodel.md)
