how to use this with Google 's litertlm on Android

#2
by mekabe - opened

I am using com.google.ai.edge.litertlm with my Android projects for local AI.
But they use litertlm files. This is a tflite file model. Does it work directly with litertlm ?
if not why is it here on litert-community ?
thanks.

LiteRT Community (FKA TFLite) org

Good question β€” this one is not a LiteRT-LM model, so it won't load with com.google.ai.edge.litertlm. .litertlm bundles are for LiteRT-LM's LLM pipeline; Bonsai Image is a text-to-image diffusion pipeline shipped as three plain .tflite graphs (Qwen3 text encoder, DiT, VAE decoder) that you run directly with the LiteRT runtime (CompiledModel / Interpreter API), with your app driving the diffusion loop. The litert-community org hosts models for the LiteRT runtime in general, not only LiteRT-LM bundles β€” that's why it lives here.

If you want to run it on Android, there's a complete Kotlin demo app showing the whole pipeline (on-device Qwen3 tokenizer, the three graphs, the FlowMatch-Euler loop, memory-safe sequential loading): https://github.com/john-rocky/hf-to-litertlm/tree/main/bonsai_image_work/device/BonsaiAppAndroid β€” and the official samples repo has the Python host sample plus iOS/macOS apps under https://github.com/google-ai-edge/litert-samples/tree/main/samples/litert/image_generation. One honest caveat on speed: a 4-step 512Γ—512 image takes about 7 minutes on a Pixel 8a (vs ~62 s on an iPhone 17 Pro), so on today's mid-range Android hardware treat it as a proof-of-run rather than an interactive experience.

Sign up or log in to comment