---
title: "init(for:)"
framework: vision
role: symbol
role_heading: Initializer
path: "vision/vncoremlmodel/init(for:)"
---

# init(for:)

Creates a model container to use with a Core ML request.

## Declaration

```swift
convenience init(for model: MLModel) throws
```

## Parameters

- `model`: The model to create the model container from.

## Discussion

Discussion This method may fail if the framework doesn’t support the Core ML model. For example, a model that doesn’t accept an image as any of its inputs will yield an VNErrorCode.invalidModel error.
