litert-community/TinyLlama-1.1B-Chat-v1.0

🤗 On Hugging Facetext-generationapache-2.017 GBotherHF checksums availableupdated today
Magnet

litert-community/TinyLlama-1.1B-Chat-v1.0

This model provides a few variants of

TinyLlama/TinyLlama-1.1B-Chat-v1.0 that are ready for

deployment on Android using the

LiteRT (fka TFLite) stack and

MediaPipe LLM Inference API.

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.*

![Open In Colab](https://colab.research.google.com/#fileId=https://huggingface.co/litert-community/TinyLlama-1.1B-Chat-v1.0/blob/main/notebook.ipynb)

Android

  • Download and install

the apk.

  • Follow the instructions in the app.

To build the demo app from source, please follow the

instructions

from the GitHub repository.

Performance

Android

Note that all benchmark stats are from a Samsung S24 Ultra with

1280 KV cache size with multiple prefill signatures enabled.

Backend

Prefill (tokens/sec)

Decode (tokens/sec)

Time-to-first-token (sec)

Memory (RSS in MB)

Model size (MB)

fp32 (baseline)

cpu

51.14 tk/s

9.23 tk/s

9.25 s

6,155 MB

4,208 MB

dynamic_int8

cpu

156.10 tk/s

26.34 tk/s

3.80 s

2,359 MB

1,095 MB

  • Model Size: measured by the size of the .tflite flatbuffer (serialization

format for LiteRT models)

  • Memory: indicator of peak RAM usage
  • The inference on CPU is accelerated via the LiteRT

XNNPACK delegate with 4 threads

  • Benchmark is done assuming XNNPACK cache is enabled
  • dynamic_int8: quantized model with int8 weights and float activations.