schmidt-sebastian's picture
Add files using upload-large-folder tool
b124628 verified
metadata
license: llama3.2
base_model: meta-llama/Llama-3.2-1B-Instruct
pipeline_tag: text-generation
tags:
  - chat
extra_gated_heading: Access Llama-3.2-1B-Instruct on Hugging Face
extra_gated_prompt: >-
  To access Llama-3.2-1B-Instruct on Hugging Face, you are required to review
  and agree to the llama3.2 license. To do this, please ensure you are logged in
  to Hugging Face and click below. Requests are processed immediately.
extra_gated_button_content: Acknowledge licensed

litert-community/Llama-3.2-1B-Instruct

This model provides a few variants of meta-llama/Llama-3.2-1B-Instruct 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

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.30 tk/s

7.38 tk/s

10.58 s

6,464 MB

4,726 MB

dynamic_int8 cpu

185.24 tk/s

22.55 tk/s

4.40 s

2,949 MB

1,229 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.