← Back
Hugging Face Blog

AnyLanguageModel 1.0: One Year of Local Models on Apple Platforms

•5 min read•
#deployment
Level:Intermediate
For:AI Engineers
✦TL;DR

** AnyLanguageModel 1.0 unifies local and hosted LLM inference on Apple platforms via the Foundation Models API, adding tool calling, guided generation, and image support across all providers. The release ships with swift‑huggingface 1.0 and swift‑xet 1.0 for accelerated model downloads, and expands hosted support to OpenAI, Anthropic, Private Cloud Compute, and Hugging Face‑compatible endpoints. Notable model downloads include Gemma 4 E2B (3.4 GB, Q4_0), LFM2.5 2.6B (1.7 GB, Q4_K_M), and Qwen3.8 27B (16 GB, 4‑bit) that run on iPhone and Mac respectively, enabling engineers to start with small on‑device models and fall back to larger remote models with identical session code. **KeyTakeaways:** - AnyLanguageModel now supports tool calling and guided generation with every provider, including nested @Generable types.

⚡ Key Takeaways

  • AnyLanguageModel now supports tool calling and guided generation with every provider, including nested @Generable types.
  • Image attachment uses Foundation Models 27 syntax and works on iOS, macOS, and visionOS 27.
  • Hosted providers (OpenAI, Anthropic, Private Cloud Compute, Hugging Face Inference, OpenRouter) receive the same features as local models, including streaming tool calls and token usage reporting.
  • API keys are supplied via a closure, allowing short‑lived token retrieval from a server or proxy.
  • The framework runs on Linux, enabling identical code paths for server‑side inference.
💡 Why It Matters

** Engineers can now write a single Swift session that seamlessly swaps between on‑device and cloud LLMs, reducing integration overhead while leveraging the latest model capabilities for both latency‑critical and compute‑heavy tasks.

✅ Practical Steps

  1. Replace your import with `import AnyLanguageModel` to enable the unified API.
  2. Use the same session code to switch between system, llama.cpp, MLX, Core ML, or any hosted provider (e.g., OpenAI Chat Completions).
  3. Provide API keys via a closure (as shown in the README) to fetch short‑lived tokens from your backend.

Want the full story? Read the original article.

Read on Hugging Face Blog ↗

More like this

New in AWS Quick: More capable flows, an updated web experience, and agents that work together

AWS ML Blog•#agents

Three insights you may have missed from theCUBE’s coverage of the Dell Technologies New York Symposium

SiliconANGLE AI•#deployment

Welcome Inkling 2 Mini, Cutting-edge Performance for your Local Setup

Hugging Face Blog•#llm

NVIDIA and Microsoft Expand Accelerated Computing From Azure to Windows PCs

NVIDIA Blog•#compute

EXPLORE AI NEWS

Daily hand-picked stories on LLMs, RAG, agents and production AI — curated for engineers who ship.

BROWSE NEWS

GET THE WEEKLY DIGEST

Join engineers getting the Monday signal-over-noise AI breakdown. No spam, unsubscribe anytime.

LEARN AI ENGINEERING

Curated courses, research papers, repos and tutorials built for engineers leveling up in AI.

START LEARNING