---
title: "init(resolvingBookmark:)"
framework: coreai
role: symbol
role_heading: Initializer
path: "coreai/aimodel/init(resolvingbookmark:)"
---

# init(resolvingBookmark:)

Create an AIModel  by resolving bookmark data pointing to its specialized asset in a cache

## Declaration

```swift
init?(resolvingBookmark bookmark: Data) throws
```

## Parameters

- `bookmark`: Data previously obtained from AIModel.bookmarkData.

## Return Value

Return Value If the bookmark data can be resolved, the resulting AIModel pins and references the cache entry as the model that generated the bookmark data. If it cannot be resolved due to the specialized asset entry no longer being present nil is returned.

## Discussion

Discussion Resolving bookmark data involves checking it is a valid bookmark, validating the associated cache and cache entry it references exists, and returning a AIModel constructed with that specialized asset contained within that entry. If any of these steps fail, nil is returned note: If the bookmark data is malformed due to not being sourced from AIModel.bookmarkData an error is thrown

## See Also

### Creating a model

- [init(contentsOf:options:)](coreai/aimodel/init(contentsof:options:).md)
