Instructions to use litert-community/Bonsai-Image-ternary-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use litert-community/Bonsai-Image-ternary-4B with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
how to use this with Google 's litertlm on Android
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.
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.