One call from a Keras model to a phone: LiteRT export
Built the LiteRT export path in Keras and KerasHub: a trained model to a phone-ready file in one call, on TensorFlow and PyTorch.
- Performance and inference
- Dec 2025 – Jul 2026
- Merged
- 1 min read
One call turns a trained Keras or KerasHub model into a .tflite file a phone can run, first for the TensorFlow
backend and then for models trained on PyTorch. I wrote the keras.io guide for it.
Problem
Keras had no single call that produced a LiteRT file for a phone: conversion went through separate TensorFlow tooling, and models trained on the PyTorch backend had no Keras path at all.
Approach
model.export("model.tflite", format="litert")in Keras (keras#21674, merged December 2025), and the same for KerasHub models (keras-hub#2405, January 2026).- The same call for models trained on the PyTorch backend (keras#22758, May 2026).
- Fixes to the KerasHub layers that blocked export, one model family at a time.
- The keras.io guide, Exporting Keras models to LiteRT, merged July 2026.
Results
The export path is merged in Keras and KerasHub and documented on keras.io. An Android app of mine walks the whole path, from one export call to models running on a phone with no server.
What did not work
A one-call export of KerasHub LLMs to LiteRT-LM bundles was built and proposed upstream, but not merged.
More in performance and inference
- Keras on PyTorch: compiled generation 11.6x fasterJul 2026 – Oct 2026
Traced why Keras on PyTorch ran about 9x slower than plain PyTorch, and merged the fixes upstream, one root cause each. · Google · Merged
- GLM-5.3-Flash on one GPU2 Sep 2026
Served a 181 GiB mixture-of-experts LLM from one 96 GiB GPU and took decoding from 10.8 to 15.0 tokens/s shipped, 16.5 at peak. · Independent · Published
- End-to-end UI tests for XProfAug 2026 – now
Wrote the end-to-end UI test suite for XProf, the open-source ML profiler, with 107 browser tests and a side-by-side check of two builds. · Google · Shipped
- Llama 3.1 in KerasHub, and Gemma 3 fixesApr 2025 – Jul 2026
Implemented Llama 3.1 in KerasHub and fixed Gemma 3 bugs, including a preprocessor crash across Gemma 3, 3n and 4. · Google · Merged