Downloads · 30 days
76
30% of all-time downloads
xzhih/translategemma-4b-it-llamafile
translategemma-4b-it-llamafile is a translation model from xzhih. Use it when you need text moved from one language to another. The card lists the license as gemma.
Packaged .llamafile runtimes for local TranslateGemma text translation, image translation, and official messages-json inference.
Downloads · 30 days
76
30% of all-time downloads
All-time downloads
253
Public
Repo size
44.1 GB
Likes
0
Public
Click a slice to open those files.
.llamafile14.7 GB · 100%
From the Hugging Face model README
Packaged .llamafile runtimes for local TranslateGemma text translation, image translation, and official messages-json inference.
This repository republishes multiple packaged TranslateGemma .llamafile runtimes in a single Hugging Face model repo.
q8_0_visiontranslategemma-4b-it.Q8_0.ggufgemmav0.10.4-devc5a778891translategemma| ID | Quantization | Modalities | Recommended | File |
|---|---|---|---|---|
| q4_k_m | Q4_K_M | text | yes | translategemma-4b-it.Q4_K_M.llamafile |
| q6_k | Q6_K | text | no | translategemma-4b-it.Q6_K.llamafile |
| q8_0 | Q8_0 | text | no | translategemma-4b-it.Q8_0.llamafile |
| q8_0_vision | Q8_0 | text, vision | yes | translategemma-4b-it.Q8_0.mmproj-Q8_0.llamafile |
Each packaged .llamafile already embeds its model. Vision SKUs also embed mmproj-Q8_0, so you should not pass -m or --mmproj when running them.
q8_0_vision is the supported image translation runtime in this SKU set.Replace the runtime paths below with any file from the runtime table above. The examples below use one packaged runtime path from this repo.
Do not pass -m; just run the packaged file directly.
hf download xzhih/translategemma-4b-it-llamafile translategemma-4b-it.Q8_0.mmproj-Q8_0.llamafile --local-dir .
TEXT_RUNTIME="./translategemma-4b-it.Q4_K_M.llamafile"
chmod +x "$TEXT_RUNTIME"
TEXT_RUNTIME="./translategemma-4b-it.Q4_K_M.llamafile"
sh "$TEXT_RUNTIME" --translate-text "Hello, world." --source-lang en --target-lang zh-CN
sh "$TEXT_RUNTIME" --translate-text "Settings > General" --source-lang en --target-lang zh-CN \
--translation-instruction "Use Mainland China UI wording. Keep product names in English."
TEXT_RUNTIME="./translategemma-4b-it.Q4_K_M.llamafile"
sh "$TEXT_RUNTIME" --translate-messages-json "$(cat <<'JSON'
[
{
"role": "user",
"content": [
{
"type": "text",
"source_lang_code": "en",
"target_lang_code": "zh-CN",
"text": "Hello, world."
}
]
}
]
JSON
)"
TEXT_RUNTIME="./translategemma-4b-it.Q4_K_M.llamafile"
sh "$TEXT_RUNTIME" --server --host 127.0.0.1 --port 8080
In another terminal:
curl http://127.0.0.1:8080/health
curl http://127.0.0.1:8080/v1/models
curl http://127.0.0.1:8080/v1/translate \
-H 'Content-Type: application/json' \
-d "$(cat <<'JSON'
{
"text": "Settings > General",
"source_lang": "en",
"target_lang": "zh-CN",
"translation_instruction": "Use Mainland China UI wording. Keep product names in English."
}
JSON
)"
curl http://127.0.0.1:8080/v1/translate/messages \
-H 'Content-Type: application/json' \
-d "$(cat <<'JSON'
{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"source_lang_code": "en",
"target_lang_code": "zh-CN",
"text": "Hello, world."
}
]
}
],
"translation_instruction": "Keep product names in English."
}
JSON
)"
VISION_RUNTIME="./translategemma-4b-it.Q8_0.mmproj-Q8_0.llamafile"
sh "$VISION_RUNTIME" --translate-image ./IMG_8477.PNG --source-lang en --target-lang zh-CN \
--translation-instruction "Use Mainland China mobile app terminology."
For --translate-messages-json, image entries must use the official type: "image" shape and a local file path or data URI in url.
VISION_RUNTIME="./translategemma-4b-it.Q8_0.mmproj-Q8_0.llamafile"
sh "$VISION_RUNTIME" --translate-messages-json "$(cat <<'JSON'
[
{
"role": "user",
"content": [
{
"type": "image",
"source_lang_code": "en",
"target_lang_code": "zh-CN",
"url": "./IMG_8477.PNG"
}
]
}
]
JSON
)"
This repository republishes the upstream model as a packaged .llamafile with an embedded mmproj-Q8_0 projector. This is the recommended image translation runtime in the current SKU set.