Back to discover
NewsBuild with AI

AnyLanguageModel 1.0 gives Swift apps a shared interface for local and hosted AI

Hugging Face presents version 1.0 of its Foundation Models-compatible library, allowing developers to choose different models through familiar Swift session code.

Conceptual AI illustration of interchangeable geometric modules beside a shared adapter connected to a ceramic cloud and an unbranded desktop device.
CurioFuse · AI-generated illustration

The announcement describes a common programming interface: the app can use the system model, local models through llama.cpp, MLX or Core ML, or a hosted provider. Hosted inference also accommodates models too large for the device. When switching providers, the library leaves reasoning blocks out of requests if the destination cannot replay them.

The documentation requires Swift 6.3 or later, with Xcode 26.4 or later. Optional package features for local engines are disabled by default. It warns against embedding provider credentials in an app. Its deployment options include users supplying their own keys, stored in Keychain, or requests going through an authenticated server that keeps provider keys and issues short-lived, limited-scope client tokens. The server option adds infrastructure, operating costs and an extra network hop; those responsibilities remain with the application operator.

Existing apps face compatibility changes in the release notes. JSONValue, the type representing JSON data, now belongs to this library instead of being an alias for JSONSchema's type; values crossing that boundary require conversion. Generated enumerations whose alternatives carry data also change representation: each alternative becomes an object naming its case and carrying typed properties. Earlier generated content will not decode under this representation. Version 1.0 additionally requires swift-huggingface 1.0. These changes affect data exchange and previously generated content, alongside the package dependency update.

Sources(3)

Sources & standardsReport a correction