Hugging Face Releases AnyLanguageModel 1.0, a Drop-in Replacement for Apple's Foundation Models
Hugging Face has released AnyLanguageModel 1.0, a framework designed as a drop-in replacement for Apple's Foundation Models API, allowing developers to choose the model and inference provider used by their apps. The 1.0 release also includes swift-huggingface 1.0 and swift-xet 1.0, which bring accelerated model downloads from the Hugging Face Hub to Swift apps.
The framework supports both local and hosted inference. Local models can run through llama.cpp, MLX, and Core ML, while hosted options include OpenAI's Chat Completions and Responses APIs, Anthropic's Messages API, Google's Gemini API, Ollama, Private Cloud Compute on OS 27, and Hugging Face Inference Providers. Developers can switch between system models, open-weight models, and hosted services without changing session code; reasoning blocks that cannot be replayed are automatically omitted when switching providers. Tool calling and guided generation work across all providers, and image support lets prompts include images using Foundation Models 27 syntax.
AnyLanguageModel was first introduced in November 2025, after feedback from developers interested in local models but concerned about the complexity of supporting multiple inference providers. The 1.0 version also runs on Linux, so the same code can be used on servers. API keys are now provided via closures, allowing apps to fetch short-lived tokens from their own servers.


