--- license: apache-2.0 base_model: Qwen/Qwen2.5-1.5B-Instruct pipeline_tag: text-generation library_name: litert-lm tags: - chat --- # litert-community/Qwen2.5-1.5B-Instruct This model provides a few variants of [Qwen/Qwen2.5-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct) that are ready for deployment on Android using the [LiteRT (fka TFLite) stack](https://ai.google.dev/edge/litert), [MediaPipe LLM Inference API](https://ai.google.dev/edge/mediapipe/solutions/genai/llm_inference) (in maintenance-only mode) and [LiteRT-LM](https://github.com/google-ai-edge/LiteRT-LM). ## Use the models ### Colab *Disclaimer: The target deployment surface for the LiteRT models is Android/iOS/Web and the stack has been optimized for performance on these targets. Trying out the system in Colab is an easier way to familiarize yourself with the LiteRT stack, with the caveat that the performance (memory and latency) on Colab could be much worse than on a local device.* [](https://colab.research.google.com/#fileId=https://huggingface.co/litert-community/Qwen2.5-1.5B-Instruct/blob/main/notebook.ipynb) ### Android #### Edge Gallery App * Download or build the [app](https://github.com/google-ai-edge/gallery?tab=readme-ov-file#-get-started-in-minutes) from GitHub. * Install the [app](https://play.google.com/store/apps/details?id=com.google.ai.edge.gallery&pli=1) from Google Play. * Follow the instructions in the app. #### LiteRT-LM in your own app Add `com.google.ai.edge.litertlm:litertlm-android` to your app as shown in the [LiteRT-LM Kotlin guide](https://ai.google.dev/edge/litert-lm/android), and load `Qwen2.5-1.5B-Instruct_multi-prefill-seq_q8_ekv4096.litertlm` from this repository. This file needs LiteRT-LM 0.18.0 or newer. ### iOS * See the [LLM Inference guide for iOS](https://ai.google.dev/edge/mediapipe/solutions/genai/llm_inference/ios) (MediaPipe, in maintenance-only mode). The iOS sample app this section linked was removed from mediapipe-samples. For sample apps, see [google-ai-edge/litert-samples](https://github.com/google-ai-edge/litert-samples). ## Performance ### Android Note that all benchmark stats are from a Samsung S25 Ultra and multiple prefill signatures enabled.
| Backend | Quantization scheme | Context length | Prefill (tokens/sec) | Decode (tokens/sec) | Time-to-first-token (sec) | Model size (MB) | Peak RSS Memory (MB) | GPU Memory (RSS in MB) | |
|---|---|---|---|---|---|---|---|---|---|
CPU |
fp32 (baseline) |
1280 |
49.50 |
10 tk/s |
21.25 s |
6182 MB |
6254 MB |
N/A |
|
CPU |
dynamic_int8 |
1280 |
297.58 |
34.25 tk/s |
3.71 s |
1598 MB |
1997 MB |
N/A |
|
CPU |
dynamic_int8 |
4096 |
162.72 tk/s |
26.06 tk/s |
6.57 s |
1598 MB |
2216 MB |
N/A |
|
GPU |
dynamic_int8 |
1280 |
1667.75 tk/s |
30.88 tk/s |
3.63 s |
1598 MB |
1846 MB |
1505 MB |
|
GPU |
dynamic_int8 |
4096 |
933.45 tk/s |
27.30 tk/s |
4.77 s |
1598 MB |
1869 MB |
1505 MB |