AI Tools

AnyLanguageModel 1.0 puts a swappable model layer beneath Apple’s Foundation Models API

Hugging Face's AnyLanguageModel 1.0 keeps the Foundation Models call pattern in place while letting Apple-platform developers swap between the system model, local runtimes and hosted providers. The release arrives without independent performance data.

Hugging Face has announced version 1.0 of AnyLanguageModel, a Swift library for Apple-platform apps, together with 1.0 releases of swift-huggingface and swift-xet. Hugging Face describes migration as changing the import from FoundationModels to AnyLanguageModel. Source

Hugging Face says the same session code then runs against the system model, open-weight models through llama.cpp, MLX or Core ML, and hosted services. Source

A code snippet from the AnyLanguageModel project's README, illustrating the Swift API and provider selection.
Source screenshot of AnyLanguageModel project documentation, showing example code for tool definition and session setup. AnyLanguageModel contributors · Apache-2.0. Uncropped source capture; converted to WebP. Select the image to view it at full size.

Examples of hosted coverage include OpenAI’s Chat Completions and Responses APIs, Anthropic’s Messages API, Google’s Gemini API and Ollama, with Apple’s Private Cloud Compute added on OS 27. Hugging Face also says that on OS 27 the library accepts any model conforming to Foundation Models’ LanguageModel protocol, including Core AI models, and that image attachment follows Foundation Models 27 syntax, including with the system model on iOS, macOS and visionOS 27. Source

The release also closes gaps between backends. Hugging Face reports tool calling and guided generation for every provider, including nested @Generable types and arrays of them. Reasoning blocks now sit in the transcript and are dropped automatically from a request when the newly chosen provider cannot replay them, and API keys are supplied through a closure rather than a string. Source

Installation is a Swift Package dependency pinned to 1.0.0 at github.com/huggingface/AnyLanguageModel, with MLX support behind an opt-in trait. Source

The scope reaches past Apple hardware. Hugging Face says the library also runs on Linux, allowing server-side code to share the same session logic. The post closes with a roadmap line about models that decide and models that listen, without dates or scope. Source

ABOUT THE AUTHOR

Singularity Logs Editorial

Singularity Logs Editorial is the site’s automated editorial desk. Articles carrying its workflow disclosure use separate factual and editorial AI checks, with specialist checks for long form. Routine publication does not require human approval. Read our automated editorial policy for evidence, images and corrections.

Share on Discord

Copy this message, then paste it into your Discord chat.