StandardsAboutContact
The Weights
AnyLanguageModel 1.0: A Portability Layer, Not a Speedup

AnyLanguageModel 1.0: A Portability Layer, Not a Speedup

Hugging Face's Swift library swaps Apple's on-device model for local or hosted ones with one import. Local backends still cannot force a tool call.

AnyLanguageModel 1.0 is a credible portability layer, not a performance upgrade: it lets Swift apps swap Apple's Foundation Models for MLX, llama.cpp, Core ML or hosted APIs by changing one import. Its own repo admits local backends cannot force tool calls, so agentic workloads need testing before migration.

The Weights Desk · 3 min read

Hugging Face announced AnyLanguageModel 1.0 on October 20, 2026, a year after the first release. The Swift library mirrors Apple's Foundation Models API, so an app can move between the system model, local runtimes and hosted providers by changing one import. It is a useful abstraction. It does not make any of those models better, and its repository lists gaps that matter for production use.

What the library actually changes

The change is at the API layer, not the model layer. Per Hugging Face, existing session code stays the same after swapping the FoundationModels import for AnyLanguageModel. Local backends are the system model, llama.cpp, MLX and Core ML. Hosted ones include OpenAI, Anthropic, Google Gemini, Ollama and any OpenAI-compatible endpoint. The announcement says it also runs on Linux. That removes lock-in to one provider. It does not verify that any provider's output is good enough.

Where the abstraction leaks

The repository documents that Ollama, MLX, llama.cpp and Core ML cannot force a model to call a tool, so a required tool-calling setting behaves like an allowed one. It also says tool-call and reasoning support varies by provider, and that generation tests are skipped in CI. A one-line import swap can therefore change agent behavior silently. Teams should run their own tool-use evaluations on each backend before switching.

Device limits decide which models are practical

The announcement's own model list shows the ceiling. A Gemma 4 E2B GGUF at about 3.4 GB and an LFM2.5 2.6B GGUF at about 1.7 GB fit an iPhone, Hugging Face says. A Qwen3.8 27B MLX build at about 16 GB needs a Mac with 32 GB or more of memory. GLM-5.3, at roughly 1.5 TB in BF16, is offered only through hosted Inference Providers. The announcement gives no quality benchmarks for these models, so the claim that they are good enough is unverified.

Build and OS friction

Adoption has costs the announcement does not dwell on. The repository requires Swift 6.3 or later, makes the CoreML, MLX and Llama backends opt-in traits with none enabled by default, and warns that enabling them can break SwiftPM dependency resolution. Private Cloud Compute, dynamic instructions and image input with the system model need OS 27. Extensions beyond Apple's API do not compile against Foundation Models on OS 26, so migrating back is not free.

Verdict: who should use it

Signal for Swift teams that want to compare on-device and hosted models behind one interface, and for server-side Swift on Linux. Noise for anyone treating it as evidence that small local models match hosted ones; the announcement offers no benchmark showing that. Do not adopt it for agent workflows that need guaranteed tool calls on local backends until you have tested each one yourself. Keep API keys out of shipped apps, as the repo advises.

What does AnyLanguageModel 1.0 do?
It is a Swift package that mirrors Apple's Foundation Models API. Apps can route the same session code to local backends (MLX, llama.cpp, Core ML) or hosted ones (OpenAI, Anthropic, Gemini, Ollama) by changing an import.
What is the main reliability caveat?
The repository says Ollama, MLX, llama.cpp and Core ML cannot force a model to call a tool, so a 'required' setting behaves like 'allowed'. Agent flows that depend on guaranteed tool calls need testing per backend.
Does it need special build settings?
Local backends are opt-in package traits (CoreML, MLX, Llama), and none are on by default. The repo warns that enabling them can cause SwiftPM dependency resolution failures and documents a workaround.
  1. AnyLanguageModel 1.0: One Year of Local Models on Apple Platforms — Hugging Face
  2. AnyLanguageModel repository (README) — GitHub