WhoBuilt

Running LLMs on your iPhone: 40 tok/s Gemma 4 with MLX

Apr 20, 2026· 11 min· 15K views·Watch on YouTube

Speaker

Adrien Grondin, developer of Locally AI, explains how to run Gemma 4 and other language models on iPhone with MLX during an AI Engineer talk.

Run models with MLX Swift LM

Locally AI is a native chatbot for running models on iPhone with MLX, Apple’s framework for Apple silicon. Grondin points developers to MLX Swift LM for iOS, iPadOS, and macOS apps, saying its API can get a basic on-device model app running in under 10 minutes.

Find and choose compatible weights

Grondin recommends finding compatible models in the MLX Community on Hugging Face, where he says thousands of model variants are available. Developers can pass a model ID to MLX Swift LM to download its weights. For iPhone, he recommends quantized models, generally between 4-bit and 8-bit, because lower bit counts can noticeably affect output.

Balance model size and speed

Grondin says a 4-bit Gemma 4 can reach about 40 tokens per second on the latest iPhones, and demonstrates it generating text offline. Older iPhones can run models too, though more slowly; he gives 20 tokens per second as an already useful rate. Model downloads, typically around one to three gigabytes, remain a practical constraint.

Try the app and extend its capabilities

Grondin says Locally AI had been acquired by LM Studio, which supports running local models with MLX or llama.cpp and serving them through compatible response formats. In response to a question, he says MLX Swift LM supports tool calling but not structured generation yet. App users can choose from models Grondin has checked for iPhone compatibility.

Takeaways

  • Start an iOS prototype with MLX Swift LM and a compatible Hugging Face model ID.
  • For phone deployments, compare quantized variants; Grondin recommends trying 4-bit to 8-bit models.
  • Benchmark on target devices: his latest-iPhone example reaches about 40 tokens per second, while older phones are slower.
  • Include model download size in the user experience; the cited models can require one to three gigabytes.
  • MLX Swift LM supports tool calling, but structured generation was not supported at the time of the talk.

Mentioned in this talk

Search inside this talk

What was claimed 6

Related talks