https://github.com/blundell/gemma3minimalstarter
Get started with the new Gemma 3 model for on-device inference. Giving you the simplest steps to get started with AI on Android.
https://github.com/blundell/gemma3minimalstarter
ai androiddev gemma3 mediapipe
Last synced: 4 months ago
JSON representation
Get started with the new Gemma 3 model for on-device inference. Giving you the simplest steps to get started with AI on Android.
- Host: GitHub
- URL: https://github.com/blundell/gemma3minimalstarter
- Owner: blundell
- Created: 2025-03-12T15:00:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-12T21:45:34.000Z (over 1 year ago)
- Last Synced: 2025-12-28T21:27:44.431Z (6 months ago)
- Topics: ai, androiddev, gemma3, mediapipe
- Language: Kotlin
- Homepage: https://blog.blundellapps.co.uk/get-started-with-gemma-3-llm-on-android-now/
- Size: 275 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Minimal Gemma 3 example

This example shows "ask a question get an answer" for its demo.
But Gemma3 is so much more than that, and you would typically get responses "behind the scenes" rather than use it as a chatbot. (And such
the latency in this gif (of an emulator) becomes more irrelevant.)
For a full fledged example see:
- https://ai.google.dev/edge/mediapipe/solutions/genai/llm_inference/android
- https://github.com/google-ai-edge/mediapipe-samples/blob/main/examples/llm_inference/android
As well as writing the code, you need to get a token from hugging face for downloading the Gemma 3 Model (or any model)
- Get a token: https://huggingface.co/settings/tokens
- Download url: https://huggingface.co/litert-community/Gemma3-1B-IT/resolve/main/gemma3-1b-it-int4.task?download=true
This app expects you to have `huggingface.token = 1234abcd` in your root `local.properties` file.
You may encounter an error like this if using an old version of MediaPipe:
```
// tflite com.blundell.tut.gemma3 E Didn't find op for builtin opcode 'STABLEHLO_COMPOSITE' version '1'.
An older version of this builtin might be supported.
Are you using an old TFLite binary with a newer model?
```
It means your `implementation("com.google.mediapipe:tasks-genai:0.10.22")` is out of date.