Downloads · 30 days
0
litert-community/codegemma-7b-it-int4-litertlm
codegemma-7b-it-int4-litertlm is a text generation model from litert-community. Use it when you need the model to write or continue text. It is set up for litert. The card lists the license as gemma.
This repository contains Google's CodeGemma 7B Instruction-Tuned (google/codegemma-7b-it) quantized to INT4 and exported into the .litertlm model bundle format for on-device deployment on Android using Google's LiteRT…
Downloads · 30 days
0
Access
Public
Updated Aug 16, 2026
Repo size
31.5 GB
Likes
1
Public
Click a slice to open those files.
.litertlm4.7 GB · 100%
From the Hugging Face model README
This repository contains Google's CodeGemma 7B Instruction-Tuned (google/codegemma-7b-it) quantized to INT4 and exported into the .litertlm model bundle format for on-device deployment on Android using Google's LiteRT runtime (formerly TensorFlow Lite / AI Edge Torch).
GemmaForCausalLM)google/codegemma-7b-itdynamic_wi4_afp32)litert-torch (litert_torch.generative.export_hf).litertlm (Unified model flatbuffer + tokenizer + prompt templates)| Parameter | Value |
|---|---|
| Parameters | 7.0 Billion |
| Hidden Size | 3072 |
| Num Layers | 28 |
| Num Heads | 16 |
| Vocab Size | 256,000 |
| Prefill Seq Len | 256 |
| Max KV Cache Len | 512 |
| Quantization | INT4 (dynamic_wi4_afp32) |
| File Size | ~3.85 GB |
Place the downloaded .litertlm file inside your Android app's assets/ directory or internal storage directory.
build.gradle.kts)dependencies {
implementation("com.google.ai.edge.litert:litert-lm:1.0.0")
}
import com.google.ai.edge.litert.lm.LiteRtLmEngine
import com.google.ai.edge.litert.lm.ModelOptions
import java.io.File
fun runCodeGemma(context: Context, userPrompt: String): String {
val modelFile = File(context.filesDir, "codegemma-7b-it-int4.litertlm")
val options = ModelOptions.builder()
.setModelPath(modelFile.absolutePath)
.build()
val engine = LiteRtLmEngine.create(options)
// CodeGemma instruction format is automatically handled by the .litertlm bundle metadata
val response = engine.generate(userPrompt)
engine.close()
return response
}
The .litertlm bundle automatically packages the official CodeGemma chat template:
<bos><start_of_turn>user
Write a Kotlin function to check prime numbers.<end_of_turn>
<start_of_turn>model
If you use this model in your research or applications, please cite the official Google CodeGemma paper and Hugging Face repository:
@article{codegemma2024,
title={CodeGemma: Open Code Models},
author={Google CodeGemma Team},
year={2024}
}
Converted using Google LiteRT Torch (litert-torch).