Downloads · 30 days
45
32% of all-time downloads
elcooooo/gemma-4-E2B-it-latn-arab-cyrl-1.75GB-litertlm
gemma-4-E2B-it-latn-arab-cyrl-1.75GB-litertlm is a text generation model from elcooooo. 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.
A 1.746 GB text-only LiteRT-LM build of google/gemma-4-E2B-it, produced by removing the multimodal encoders and slicing the vocabulary from 262,144 to 180,850 tokens (Latin + Arabic + Cyrillic).
Downloads · 30 days
45
32% of all-time downloads
All-time downloads
141
Public
Repo size
1.7 GB
Likes
0
Public
Click a slice to open those files.
.litertlm1.7 GB · 100%
From the Hugging Face model README
A 1.746 GB text-only LiteRT-LM build of google/gemma-4-E2B-it, produced by
removing the multimodal encoders and slicing the vocabulary from 262,144 to
180,850 tokens (Latin + Arabic + Cyrillic).
No weights were re-quantised. Every surviving parameter is bit-for-bit the value Google shipped in their quantisation-aware build. This is surgery on the published artefact, not a re-export.
| original | this build | |
|---|---|---|
| file size | 2,588,140,032 B (2.588 GB) | 1,746,183,768 B (1.746 GB) |
| vocabulary | 262,144 | 180,850 |
| sections | 12 | 5 |
| image / audio input | yes | no |
Measured by re-encoding the same sentence with the original and the sliced
tokenizer. 1.00× means every token survived; a language that inflates 3–10× is
falling back to byte-level and should be treated as unsupported.
Served (1.00× — no token inflation):
| script | verified | also covered |
|---|---|---|
| Latin | English, German, French, Spanish, Portuguese, Italian, Dutch, Polish, Turkish, Czech, Vietnamese | most Latin-script languages — Vietnamese passing is the strong signal, as it uses the deepest diacritics |
| Arabic | Arabic, Persian, Urdu | Pashto, Kurdish (Sorani), Sindhi |
| Cyrillic | Russian, Ukrainian, Bulgarian | Serbian, Belarusian, Kazakh, Macedonian |
Removed — byte-fallback only, do not use: Chinese (3.4×), Japanese (3.8×), Korean (3.6×), Hindi (10.1×), Thai (8.1×), Greek (3.9×), Hebrew (3.4×), plus Bengali, Tamil, Telugu, Gujarati, Kannada, Malayalam, Georgian, Armenian, Ethiopic, Khmer, Lao, Myanmar, Sinhala, Tibetan, and emoji.
Text in a removed script still round-trips losslessly through byte fallback — it just costs several tokens per character against embeddings the model barely trained, so quality is not meaningful there.
Scored on a 90-row word-lookup benchmark (four panels: meaning, example sentences, translation, in-context translation), single seed, greedy-ish sampling (temperature 0.1, top_k 40, top_p 0.9), CPU backend.
| build | size | score |
|---|---|---|
Google gemma-4-E2B-it.litertlm | 2.588 GB | 74.57 |
| audio + vision removed | 2.256 GB | 74.93 |
| this build (+ vocabulary sliced) | 1.746 GB | 74.91 |
All 360 of 360 panel outputs are byte-identical to the original build, and all 12 objective checks match exactly. The ±0.3 spread is judge noise on identical text, not a quality difference.
Caveat: the benchmark scores English, German and Arabic only. Russian, Persian, Vietnamese and the rest are verified by tokenizer round-trip and spot checks, not by scored rows.
Every vocabulary tensor in Google's build is quantised per row — one scale and one zero-point per token — and every row is a whole number of bytes (384 B for the 2-bit embedder and tied LM head, 128 B for each of the 35 4-bit per-layer tables). Dropping a row therefore cannot disturb any surviving row.
Verified by a bit-equality gate: for ten probe tokens (including remapped specials and the last kept id) the sliced embedder returns output identical to the original for the corresponding old id, with a negative control confirming the test distinguishes rows.
vision_encoder (224.1 MB), vision_adapter (4.7 MB), end_of_visionaudio_encoder_hw (94.1 MB), audio_adapter (9.4 MB), end_of_audiomtp_drafter — the speculative-decoding helper; on CPU it measured slower
than plain decoding, and it carries its own vocabulary tableKept verbatim: the tokenizer (pruned in place), LlmMetadata with start/stop ids
remapped, and prefill_decode's prefer_activation_type = fp16.
import litert_lm # pip install litert-lm (needs libvulkan1 even on CPU)
engine = litert_lm.Engine(
"gemma-4-E2B-it-latn-arab-cyrl-1.75GB.litertlm",
backend=litert_lm.Backend.CPU(),
max_num_tokens=2048,
)
session = engine.create_session(
max_output_tokens=256,
sampler_config=litert_lm.SamplerConfig(temperature=0.1, top_k=40, top_p=0.9),
)
session.run_prefill(["<|turn>user\nDefine the word bank in: He sat on the bank.<turn|>\n<|turn>model\n"])
print("".join(session.run_decode().texts))
Two practical notes:
libvulkan1 is required even on the CPU backend — liblitert-lm.so links it
unconditionally. Install it and ensure LD_LIBRARY_PATH reaches it..get() on a map, which that engine lacks). Render the template yourself — e.g.
with the HF tokenizer's apply_chat_template — and pass
create_session(apply_prompt_template=False).google/gemma-4-E2B-it.Gemma Terms of Use. This is a derivative of
google/gemma-4-E2B-it and use is governed by those terms, including the
Prohibited Use Policy.