Guozhen AIGlobal AI field notes and model intelligence

Realtime AI News

AnyLanguageModel 1.0 brings Apple's on-device and hosted models under one Swift API

Hugging Face shipped AnyLanguageModel 1.0 alongside 1.0 releases of swift-huggingface and swift-xet. The Swift library preserves Apple's Foundation Models API while letting an app switch between on-device models and hosted providers, including OpenAI, Anthropic and Gemini, without rewriting its session code.

Published
AnyLanguageModel 1.0 发布:一套 Swift API 同时接入苹果端侧模型与云端服务
Image source: huggingface.co

Hugging Face published AnyLanguageModel 1.0 on October 20, alongside 1.0 releases of swift-huggingface and swift-xet. The Swift library first appeared last November as a drop-in replacement for Apple's Foundation Models framework, built so developers could keep one API and still choose which model or provider their app talks to.

The upgrade path is deliberately small: developers swap import FoundationModels for import AnyLanguageModel, and existing session code keeps working. The same session can now point at the on-device system model, at open-weight models running through llama.cpp, MLX or Core ML, or at a hosted provider. Local and hosted inference stop being an either-or choice.

Features added over the past year sit in three places. Tool calling works with every provider, and guided generation covers all of them too, including nested @Generable types and arrays of them. Image support follows Foundation Models 27 syntax, including with the system model on iOS, macOS and visionOS 27. On OS 27, any model that conforms to the LanguageModel protocol can be plugged in, Core AI models included.

Hosted support now covers OpenAI's Chat Completions and Responses APIs, Open Responses, Anthropic's Messages API with adaptive thinking and effort options, Google's Gemini API, Ollama, Private Cloud Compute on OS 27, and OpenAI-compatible endpoints such as Hugging Face Inference Providers and OpenRouter through a custom base URL.

Hosted providers inherit the same features as local ones: guided generation, streamed tool calling, and token usage on responses. Reasoning is now part of the transcript, and blocks are dropped automatically when a new provider cannot replay them. API keys come from a closure rather than a hard-coded string, so apps can fetch short-lived tokens, and the library also runs on Linux so server-side code can share the same session logic.

The blog's open-weight examples show how far small models have come. Gemma 4 E2B ships in GGUF at roughly 3.4 GB with Q4_0 quantization, LFM2.5 2.6B at about 1.7 GB, both small enough for an iPhone; Qwen3.8 27B for MLX needs about 16 GB and a Mac with 32 GB of memory; GLM-5.3 from Z.ai would take roughly 1.5 TB in BF16, so most teams will reach it through Inference Providers.

Upgrading means pointing a Swift Package dependency at 1.0.0 and opting into the MLX trait, with migration notes published for all three projects. The post closes by saying models that decide and models that listen are coming next, a hint that the same API is meant to cover more than text.

For Apple developers the significance is not any single feature but the collapse of model choice into a parameter: one session object can sit in front of a small on-device model or a hosted model far too large for the device. That is what makes provider strategy something an app can change late.

Why it matters

Model choice becomes a configuration detail rather than an architecture decision, and Hugging Face's distribution reaches directly into iOS and macOS apps.

Hugging FaceAppleOpen Source
Back to realtime news

Nearby Updates

All

10/20, 07:56

【今日主题前瞻】大厂密集发布Agent产品,智能体赛道竞争白热化 市场测评 市场 中金在线

【今日主题前瞻】大厂密集发布Agent产品,智能体赛道竞争白热化 市场测评 市场 中金在线. 【今日主题前瞻】大厂密集发布Agent产品,智能体赛道竞争白热化 市场测评 市场 中金在线

10/20, 07:39

Anthropic and Nscale reportedly near a second $45B compute deal

Anthropic and AI infrastructure provider Nscale are reportedly close to announcing another $45 billion compute deal, roughly a month after signing one of the same size. Bloomberg's sources caution that talks are ongoing and the terms could still change.

10/20, 07:04

AI Agent Cuts Centalion's Trade Finance Amendment Time by 80%

An AI agent deployed in Centalion's trade finance amendment process has cut handling time by 80%, according to PYMNTS. The result points to agents moving from pilots into document-heavy back-office work, where throughput rather than text generation is the metric that matters.

10/20, 09:04

DeepSeek 新模型登顶开源模型榜首;国内 55% 算力用于视频和短剧?豆包发言人辟谣;微信发起公众号小说改编微短剧激励|极客早知道 极客公园

DeepSeek 新模型登顶开源模型榜首;国内 55% 算力用于视频和短剧?豆包发言人辟谣;微信发起公众号小说改编微短剧激励|极客早知道 极客公园. DeepSeek 新模型登顶开源模型榜首;国内 55% 算力用于视频和短剧?豆包发言人辟谣;微信发起公众号小说改编微短剧激励|极客早知道 极客公园