Contents

AIModelAsset

An unspecialized source model asset.

Declaration

struct AIModelAsset

Overview

Use a model asset to inspect a model’s structure and metadata without specializing it for a specific device. This lets you query model information without performing specialization, which is an expensive operation. You create a model asset by providing the URL of an .aimodel bundle on disk:

let asset = try AIModelAsset(contentsOf: modelURL)
guard let summary = try asset.summary(includingStatistics: true) else { return }

Unlike AIModel, a model asset can’t perform inference. Instead, use it to query model information such as function signatures, input and output descriptions, compute and storage types, and author-provided metadata.

Topics

Loading an asset

Inspecting an asset

Modifying an asset

Supporting types

See Also

Essentials