Large Language Models On-Device with MediaPipe and TensorFlow Lite- Google Developers Blog
Mar 7, 2024Mark Sherwood, Juhyun Lee

Summary
Introduces the experimental MediaPipe LLM Inference API for running Large Language Models (LLMs) fully on-device across web, Android, and iOS. Details the steps for integration, including model conversion to TensorFlow Lite Flatbuffer and SDK usage. Highlights supported LLMs (Gemma, Phi 2, Falcon, Stable LM) and provides performance benchmarks (Time to First Token, Decode Speed). Discusses performance optimizations such as weight sharing, optimized fully connected ops (I8MM instructions), balancing compute and memory, custom operators for GPU acceleration, pseudo-dynamism in attention blocks, and optimizations for specific models like Gemma 2B (int4 quantization).
More from the Coral Edge AI Platform trail
- ML Drift: Next-Gen GPU AI/ML Inference at the Edge- Google Developers Blog
- Bring multimodal semantic search to the edge with EmbeddingGemma 2- Google Developers Blog
- EmbeddingGemma 2: The Developer Guide- Google Developers Blog
- Mastering Edge AI on Raspberry Pi with LiteRT and Gemma- Google Developers Blog
- LiteRT.js, Google's high performance Web AI Inference- Google Developers Blog