AnyLanguageModel 1.0 brings local and cloud models to Apple apps
Hugging Face released AnyLanguageModel 1.0, a Swift drop-in for Apple's Foundation Models API that runs local MLX, llama.cpp and Core ML models or hosted APIs with the same session code.

A year after first introducing it, Hugging Face has released AnyLanguageModel 1.0, alongside 1.0 versions of swift-huggingface and swift-xet. The library is meant for Apple developers who like the shape of Apple's Foundation Models framework but want to pick which model and provider their app actually uses.
Same API, any model
The core idea has not changed. You swap the import of FoundationModels for AnyLanguageModel, and the same session code works with Apple's system model, with open-weight models through llama.cpp, MLX and Core ML, or with hosted services. Over the past year the team added tool calling and guided generation for every provider, including nested Generable types, plus image input using the Foundation Models 27 syntax. On Apple's OS 27 releases, the library also works with any model that conforms to Foundation Models' LanguageModel protocol, including Core AI models.
The companion packages, swift-huggingface and swift-xet, speed up model downloads from the Hugging Face Hub inside Swift apps.
Hosted providers too
Cloud support grew a lot. AnyLanguageModel now speaks OpenAI's Chat Completions and Responses APIs, Open Responses, Anthropic's Messages API with adaptive thinking and effort settings, Google's Gemini API, Ollama, Apple's Private Cloud Compute on OS 27, and Hugging Face Inference Providers, with other OpenAI-compatible endpoints such as OpenRouter available through a custom base URL. Hosted models get the same guided generation, streaming tool calls and token usage reporting as local ones. Reasoning blocks are kept in the transcript and dropped automatically if you switch to a provider that cannot replay them.
API keys are now supplied by a closure rather than a fixed string, so an app can fetch short-lived tokens from its own server. The library also runs on Linux, letting the same code work server-side.
Small models that fit
Hugging Face highlights how capable small open models have become: Gemma 4 E2B at about 3.4 GB and LFM2.5 2.6B at about 1.7 GB fit on an iPhone, while a 4-bit Qwen3.8 27B runs on a Mac with 32 GB of memory or more. Next on the roadmap are models that decide and models that listen.
Why it matters for builders
If you ship on iOS or macOS, AnyLanguageModel lets you write your AI features once and decide later whether they run on-device for privacy and cost, or in the cloud for harder tasks, without maintaining several SDKs. The token-closure pattern is also a sensible default for keeping provider keys out of your app bundle.
Source: Hugging Face. This article is PickAI’s own summary and analysis based on the original reporting, prepared with AI assistance under our editorial policy.