class

Fm::Adapter

Inherits Reference < Object

Represents a model adapter (fine-tuned weights) for customizing the on-device language model's behavior.

DEPRECATED: AdapterAsset was removed in macOS 26.2 SDK. Creating an adapter will raise InvalidInputError at runtime. This class is retained for backward compatibility and will be removed in a future version.

# From a file path
adapter = Fm::Adapter.new(path: "/path/to/adapter.mlpackage")

# From a bundle asset
adapter = Fm::Adapter.new(asset: "MyAdapter")

# Use with a session
session = Fm::Session.new(model, adapters: [adapter])

Constructors

new(*, path : String)

Creates an adapter from a file path.

Source
new(*, asset : String)

Creates an adapter from a bundle asset name.

Source

Instance methods

finalize
Source