Europe 2026
Running LLMs on your iPhone: 40 tok/s Gemma 4 with MLX — Adrien Grondin, Locally AI
Overview
This talk demonstrates how to run large language models, specifically Gemma 4, on an iPhone using the MLX framework. It highlights the efficiency and speed achievable with on-device AI, enabling applications to run locally without an internet connection. The presentation covers the tools and resources needed to integrate these models into iOS and macOS applications, emphasizing the growing ecosystem and ease of implementation.
Who should watch
- AI engineers interested in on-device LLM deployment.
- Mobile developers looking to integrate AI capabilities into iOS/macOS apps.
- Builders exploring efficient LLM inference on consumer hardware.
- Anyone curious about running powerful AI models locally on their iPhone.
Key takeaways
- MLX is an Apple-developed framework optimized for Apple Silicon, enabling efficient on-device LLM execution on iPhones, iPads, and Macs.
- The MLX Swift LM repository provides a straightforward API for integrating LLMs into iOS and macOS applications, with models runnable in under 10 minutes.
- Google's Gemma 4 model, particularly quantized versions like 4-bit or 8-bit, can achieve speeds of up to 40 tokens per second on recent iPhones.
- Hugging Face hosts a community repository for MLX, offering a wide variety of quantized model weights, often available shortly after official releases.
- Quantization is crucial for on-device performance; 4-bit to 8-bit quantization is recommended, with lower bit counts potentially impacting model quality.
- Smaller models, like those with 300-350 parameters, are highly efficient and can be used for automation tasks via shortcuts.
- The Locally AI app, developed by the speaker, showcases on-device LLM capabilities on iPhone and has been acquired by LM Studio.
- MLX Swift LM supports tool calling, enhancing the utility of on-device models for interacting with external systems.
Notable quotes
*MLX is a framework made by Apple that is optimized for Apple Silicon.*
*In less than 10 minutes, you can have an iOS app with a model that is running on your device.*
*4-bit is the lower I would go. And 8-bit is the higher I would go if you're using really small models.*
Unofficial community note. Prefer the recording for nuance.