Downloads · 30 days
224
24% of all-time downloads
soniqo/FunctionGemma-270M-LiteRT-LM
FunctionGemma-270M-LiteRT-LM is a text generation model from soniqo. Use it when you need the model to write or continue text. It is set up for litert-lm. The card lists the license as gemma.
LiteRT-LM exports of google/functiongemma-270m-it for on-device function calling, plus a separately loadable Control LoRA adapter. The original stock model.litertlm remains unchanged.
Downloads · 30 days
224
24% of all-time downloads
All-time downloads
947
Public
Repo size
634 MB
Likes
0
Public
Click a slice to open those files.
.litertlm625 MB · 99%
From the Hugging Face model README
LiteRT-LM exports of
google/functiongemma-270m-it
for on-device function calling, plus a separately loadable Control LoRA adapter.
The original stock model.litertlm remains unchanged.
| File | Bytes | Purpose |
|---|---|---|
model.litertlm | 297,212,528 | Original standalone FunctionGemma dynamic-INT8 export. |
model-lora16-android.litertlm | 327,438,928 | Reusable Android/Kotlin 0.14 dynamic-INT8 base. Its default signatures are the rank-16 LoRA graphs, so an adapter is required. |
control-r4-rank16.tflite | 9,502,720 | Control command adapter, loaded separately at runtime. |
config.json | — | Export contract, artifact hashes, and benchmark metadata. |
The LoRA-enabled base includes 128, 512, and 1024-token prefill graphs, a 1024-token KV cache, the tokenizer, and the FunctionGemma chat template. Base weights use dynamic INT8 quantization with FP32 activations for CPU/XNNPACK.
The adapter routes a compact offline phone-control surface:
call_contact, dial_number, find_contact, find_music, play_music,
stop_music, set_volume, and list_capabilities.
It was trained as an attention-only rank-8 MLX LoRA on all 18 layers, targeting
Q/K/V/O projections with scale 20. LiteRT-LM 0.14 CPU accepts ranks 16 and 32,
so the export losslessly pads rank 8 to rank 16: the additional A columns and B
rows are exactly zero. The adapter contains 144 external, 64-KiB-aligned FP32
tensor buffers and lora_rank=16 metadata.
Use the compact prompt format that matches training:
<start_of_turn>developer
You are a model that can do function calling with the following functions
Available functions: call_contact, dial_number, find_contact, find_music, play_music, set_volume, list_capabilities.
Music state: idle.<end_of_turn>
<start_of_turn>user
set volume to five<end_of_turn>
<start_of_turn>model
Add stop_music to the available-function line only while music is playing.
The adapter is not intended for the full declaration prompt used by the stock
bundle.
LiteRT-LM 0.14's Kotlin EngineConfig does not expose the engine LoRA-rank
setting used by the C and Python APIs. Therefore Kotlin applications should use
the adapter-required model-lora16-android.litertlm compatibility bundle and
pass the adapter to each conversation:
val engine = Engine(
EngineConfig(
modelPath = "/data/local/tmp/model-lora16-android.litertlm",
backend = Backend.CPU(),
),
)
engine.initialize()
val conversation = engine.createConversation(
ConversationConfig(
samplerConfig = SamplerConfig(topK = 1, topP = 1.0, temperature = 0.0),
loraConfig = LoraConfig(
loraPath = "/data/local/tmp/control-r4-rank16.tflite",
),
),
)
Greedy decoding is recommended for deterministic tool syntax. Released Kotlin 0.14.0 also lacks a per-conversation output-token cap; close each one-shot conversation after the command completes.
The release candidate uses training checkpoint step 400.
| Runtime | Held-out routing | Action arguments exact | Latency |
|---|---|---|---|
| MLX FP32/BF16 base + rank-8 adapter | 130/136 (95.6%) | 114/119 (95.8%) | — |
| Android 35 arm64 emulator, 4 GB RAM, LiteRT-LM 0.14 CPU/XNNPACK | 120/136 (88.2%) | 109/119 (91.6%) | mean 208 ms, p50 202 ms, p95 284 ms, max 294 ms |
The Android engine loaded in 641 ms with an existing XNNPACK cache. Latency is generation-only after engine initialization. The 136-example held-out set contains action, no-action, and music-state cases. Dynamic INT8 loses routing accuracy relative to MLX, so applications should confirm high-impact actions such as dialing and should validate the model against their own command set.
| Artifact | SHA-256 |
|---|---|
model-lora16-android.litertlm | 54c3243fb68128b1f0bd2483f8bb3c252b427a68cb469a99920584b3760d0b9d |
control-r4-rank16.tflite | 1d83b9908c7ca2af6a1fddf6bf61580588f4ec5de3d3ab68639646b4023f34c8 |
| Source step-400 MLX adapter | 825b5581f0e6e561e752408ee804a8f4e93a0b8b77e201195ab447b7fd519501 |
| Source FunctionGemma weights | af4f8a7c4c5eb82291759fd828720c7bcfcb92a5274556d13dde3caccf5f427b |
The source model revision is
google/functiongemma-270m-it@39eccb091651513a5dfb56892d3714c1b5b8276c.
Function calls use:
<start_function_call>call:name{arg:<escape>value<escape>}<end_function_call>
The stock model supports ordinary FunctionGemma declarations and tool-response turns. The Control adapter is designed for one command and one tool call per fresh conversation; multi-step chaining and long multi-turn slot filling were not evaluated.