Contents

AIModel

A specialized model for running inference on a device.

Declaration

struct AIModel

Mentioned in

Overview

An AIModel represents a specialized .aimodel asset, optimized for the current device’s hardware. You create one by loading the asset from disk:

let model = try await AIModel(contentsOf: modelURL)

Use functionDescriptor(for:) to inspect a function’s inputs and outputs, then load an InferenceFunction to run inference.

Topics

Creating a model

Loading inference functions

Specializing a model

Instance Properties

Type Properties

See Also

Essentials