Daily · Article 01 · 5 min read
- Open source
- Hugging Face
Hugging Face releases a library for connecting multiple AI models
Announced October 20 · official sources rechecked October 21
Summary
Hugging Face released AnyLanguageModel 1.0, a library for Swift developers, on October 20. It lets an app send requests to on-device models and hosted AI services the same way, but developers still choose the model and cover any hosted service's fees themselves.
Say you're building an app that summarizes notes. The input box looks the same to the user, but the connection code a developer writes depends on whether the AI runs on the phone or on someone else's server. AnyLanguageModel puts that connection code into one shape.
Key facts
Hugging Face, which runs a platform for sharing AI models, released AnyLanguageModel 1.0, a library for Swift developers, on October 20. It is built around Apple Foundation Models, Apple's framework that lets apps use the system model built into Apple devices. AnyLanguageModel keeps that API and lets the app choose which model and provider to use. It is a tool for connecting models to apps, not a new AI model. Developer announcement
On-device models run through llama.cpp, MLX or Core ML, all three runtimes that execute open models directly on the device. Hosted models are reached through APIs such as OpenAI, Anthropic and Google Gemini. The repository's code is released under the Apache 2.0 license. Repository License

1. What the app, the library and the model each do
A user types a note into the app; the app sends it to a model and shows the summary that comes back. The developer writes the code in between that sends the request and receives the answer. A library is a bundle of tools developers reuse when writing that code, and Swift is the programming language mainly used for Apple-device apps.
AnyLanguageModel doesn't include a model. The developer picks which model to attach and sets up whatever that model needs, whether device requirements or a hosted service's terms.
%% What to decide before attaching a model · editorial summary
flowchart TD
A["The result you need · e.g. a note summary"] --> B["Where it computes · on the device or on a server"]
B --> C["That route's requirements · model files, API key, fees"]
C --> D["Compare results on real notes"]The cat asks Q&A
- The researcher
If I add this to my notes app, does a summarizing AI come with it?
Pocket NotebookYou pick and attach the model separately. The library handles the connection between your app and the model; the summary comes from the model you attach.
- The researcher
If I'm not a developer, does this news matter to me?
Pocket NotebookYou won't install it yourself. Users just enter a note and get a summary; this release is for developers building apps in Swift.
2. A common API for making requests
An API is an agreement for how programs exchange requests and responses. When each provider has its own agreement, an app needs separate connection code for each one. AnyLanguageModel keeps the app's requests in the Foundation Models API and lets the developer swap the model behind it. The repository says an app already built on Foundation Models can move over by changing a single import line. Repository
The cat asks Q&A
- The researcher
If I switch models, how much of my code do I have to change?
Pocket NotebookThe part that sends requests and receives answers stays almost the same. If you use features whose support varies by model, like image input, run the app once with the new model. Repository
3. Compute on the device, or ask a server?
Local execution means the model computes on the user's device; a hosted model means the app sends the request over the network to a provider's server. An app installed on a phone can still have its answers computed on a server.
| Consideration | On-device model | Hosted model |
|---|---|---|
| Model computation | User's device | Provider's server |
| What to prepare | Supported hardware, memory, model files | Network, API key, service terms |
| Costs | Device resources, app distribution and upkeep | Provider fees and request volume |
| Data route | That computation stays on the device | Data you send travels to the provider's server |
The cat asks Q&A
- The researcher
If I use an on-device model, does my note stay on the phone?
Pocket NotebookThe summary is computed on the device. Other features, like downloading the model or searching the web, can still use the network, so you can't assume the whole app runs offline.
- The researcher
Is local faster and cheaper, then?
Pocket NotebookIt depends on the model's size and the device. You skip hosted request fees, but you spend storage, memory and battery.
4. When the summary drops “Thursday”
Say you feed the same note, “Meeting Friday at 3 p.m.; share material by Thursday,” to two models. The shared API keeps the connection code the same, but where you look when something goes wrong depends on the symptom.
| Symptom | Where to look |
|---|---|
| No answer from an on-device model | Model files, device support, memory |
| No answer from a hosted model | Network, API key, service status |
| An answer arrives, but “Thursday” is missing | Compare both models' summaries of the same note |
If an answer comes back, the connection works. But if the summary drops “Thursday,” the job the user handed over has failed, and only running real notes through it will show that. According to the repository, guided generation, which returns answers in a fixed format, also works with every provider. What it fixes is the format, so whether the content in each field is right still comes down to testing with real inputs. Repository
The cat asks Q&A
- The researcher
How do I find out which model summarizes my notes better?
Pocket NotebookTry them. Feed a few real notes to both models and see whether dates and deadlines survive. The library makes swapping models easy; it doesn't pick the better one for you.
5. License, fees and API keys
The repository's code is released under the Apache 2.0 license. That license covers the terms for using the library code; the license of a downloaded model and the fees for a hosted API are set by each provider. License
| Item | Terms to read |
|---|---|
| Library code | Apache 2.0 license and notice requirements |
| Downloaded model | That model's license and supported environment |
| Hosted API | The provider's prices, usage and data-processing terms |
If you use a hosted API, managing the API key is also on the developer. The repository says not to hard-code keys into the app, because a distributed app can be reverse-engineered to pull them out. Instead it describes two approaches with their trade-offs: users supply their own keys, or requests go through the developer's own server. Credential guidance
The cat asks Q&A
- The researcher
If keys can't go in the app, how do I test while I'm building it?
Pocket NotebookThe repository says environment variables are fine during development and testing. Switch to user-supplied keys or your own server before you ship.
To close
What to take away
AnyLanguageModel is a connection tool that lets Swift apps call on-device and hosted models the same way. Swapping models takes less code. Which model to use, how to handle fees and API keys, and whether the summaries are any good are still the developer's calls, made with real inputs.
If local AI is new to you, last week's explainer starts with how models run on the device.
Sources
- Developer announcementhuggingface.co
- Repositorygithub.com
- Licensegithub.com
- Credential guidancegithub.com