Axion AI.

AnyLanguageModel 1.0: one Swift import now spans Apple's system model, MLX, llama.cpp, and OpenAI, Anthropic and Gemini APIs

Hugging Face's drop-in layer over Apple's Foundation Models hits 1.0 with tool calling and guided generation on every provider. Qwen3.8 27B at 4 bits is about 16 GB; Gemma 4 E2B is about 3.4 GB.

By Axion AI Desk · · Source: Hugging Face Blog

Typographic card

The same session code then works with the system model, with open-weight models through llama.cpp, MLX, and Core ML, and with the hosted providers below.

What shipped

Hugging Face has released AnyLanguageModel 1.0, together with swift-huggingface 1.0 and swift-xet 1.0, a year after introducing the library (Hugging Face blog, 20 October 2026). The pitch is unchanged: write against Apple's Foundation Models API, then choose the model and provider. Migration begins by swapping one import, from FoundationModels to AnyLanguageModel.

What is actually new in a year

The post lists tool calling and guided generation working with every provider, including nested Generable types and arrays of them, plus image prompts using Foundation Models 27 syntax. On OS 27 the library accepts any model that conforms to Foundation Models' LanguageModel protocol, including Core AI models. Hosted support now covers OpenAI's Chat Completions and Responses APIs, Open Responses endpoints, Anthropic's Messages API with adaptive thinking and effort options, Google's Gemini API, Ollama, Private Cloud Compute on OS 27, and Hugging Face Inference Providers or any OpenAI-compatible endpoint such as OpenRouter through a custom base URL.

Small details matter for production. API keys now come from a closure, so an app can fetch short-lived tokens from its own server rather than shipping a string. Reasoning blocks are dropped automatically when you switch to a provider that cannot replay them. The library also runs on Linux, so the same code can run server-side.

The sizing table developers will want

Hugging Face names three open-weight starting points. Gemma 4 E2B from Google is about 3.4 GB in GGUF at Q4_0. LFM2.5 2.6B from Liquid AI is about 1.7 GB at Q4_K_M. Qwen3.8 27B from Alibaba for MLX is about 16 GB at 4 bits. The post says the first two fit on an iPhone and the third runs on a Mac with 32 GB or more. It adds a joke worth keeping as a reality check: GLM-5.3 from Z.ai takes about 1.5 TB in BF16, so most developers will reach it through Inference Providers.

What to be careful about

This is a vendor announcement. The post makes no performance or latency claims, and there are no benchmark numbers to verify; its value is API surface. "Drop-in" depends on how much of Foundation Models your code touches, and the post points to per-package migration notes for upgrades. Several features are tied to OS 27 and Foundation Models 27, so check your deployment target. Finally, the "coming soon" line, models that decide and models that listen, is a stated roadmap, not a shipped feature.

Axion take

For Apple-platform teams the strategic value is optionality: prototype on the system model, move heavy tasks to a hosted model, and keep one code path. The risk worth testing is behavioural drift, since the same prompt will not give the same tool-call quality across a 1.7 GB local model and a hosted frontier model.

Comprehensive take

If you ship on Apple platforms and already use Foundation Models, add AnyLanguageModel behind one feature and A/B a local and a hosted model there before committing. If you target pre-OS 27 only, check feature availability first.

Use cases

  • Local-first with cloud fallback

    Run a small GGUF or MLX model on-device and route harder requests to a hosted provider with the same session code.

  • Open models without infrastructure

    Point the OpenAI-compatible client at the Hugging Face router to try models too large for the device, using an HF token.

  • Server-side Swift

    The library runs on Linux, so one codebase can serve both an app and a backend.

Specs

ReleasesAnyLanguageModel 1.0, swift-huggingface 1.0, swift-xet 1.0 source
Gemma 4 E2B (GGUF)about 3.4 GB at Q4_0 source
LFM2.5 2.6B (GGUF)about 1.7 GB at Q4_K_M source
Qwen3.8 27B (MLX)about 16 GB at 4 bits; Mac with 32 GB or more source
GLM-5.3 (BF16)about 1.5 TB source

Insights

  • Axion reading: provider-neutral Swift APIs lower switching costs, which favours open-weight and hosted vendors over a single bundled system model.
  • Axion note: no benchmarks were published; sizes and compatibility are the vendor's own statements.

Community

Share (0): XRedditLinkedinEmail

Comments

No comments yet.

Log in or register to like or comment.