Views
No views yet
.llamafile runtimes for local TranslateGemma text translation, image translation, and official messages-json inference..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 |
.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.-m; just run the packaged file directly.1hf download xzhih/translategemma-4b-it-llamafile translategemma-4b-it.Q8_0.mmproj-Q8_0.llamafile --local-dir .
2TEXT_RUNTIME="./translategemma-4b-it.Q4_K_M.llamafile"
3chmod +x "$TEXT_RUNTIME"1TEXT_RUNTIME="./translategemma-4b-it.Q4_K_M.llamafile"
2sh "$TEXT_RUNTIME" --translate-text "Hello, world." --source-lang en --target-lang zh-CN
3sh "$TEXT_RUNTIME" --translate-text "Settings > General" --source-lang en --target-lang zh-CN \
4 --translation-instruction "Use Mainland China UI wording. Keep product names in English."1TEXT_RUNTIME="./translategemma-4b-it.Q4_K_M.llamafile"
2sh "$TEXT_RUNTIME" --translate-messages-json "$(cat <<'JSON'
3[
4 {
5 "role": "user",
6 "content": [
7 {
8 "type": "text",
9 "source_lang_code": "en",
10 "target_lang_code": "zh-CN",
11 "text": "Hello, world."
12 }
13 ]
14 }
15]
16JSON
17)"1TEXT_RUNTIME="./translategemma-4b-it.Q4_K_M.llamafile"
2sh "$TEXT_RUNTIME" --server --host 127.0.0.1 --port 80801curl http://127.0.0.1:8080/health
2curl http://127.0.0.1:8080/v1/models
3curl http://127.0.0.1:8080/v1/translate \
4 -H 'Content-Type: application/json' \
5 -d "$(cat <<'JSON'
6{
7 "text": "Settings > General",
8 "source_lang": "en",
9 "target_lang": "zh-CN",
10 "translation_instruction": "Use Mainland China UI wording. Keep product names in English."
11}
12JSON
13)"
14
15curl http://127.0.0.1:8080/v1/translate/messages \
16 -H 'Content-Type: application/json' \
17 -d "$(cat <<'JSON'
18{
19 "messages": [
20 {
21 "role": "user",
22 "content": [
23 {
24 "type": "text",
25 "source_lang_code": "en",
26 "target_lang_code": "zh-CN",
27 "text": "Hello, world."
28 }
29 ]
30 }
31 ],
32 "translation_instruction": "Keep product names in English."
33}
34JSON
35)"1VISION_RUNTIME="./translategemma-4b-it.Q8_0.mmproj-Q8_0.llamafile"
2sh "$VISION_RUNTIME" --translate-image ./IMG_8477.PNG --source-lang en --target-lang zh-CN \
3 --translation-instruction "Use Mainland China mobile app terminology."--translate-messages-json, image entries must use the official type: "image" shape and a local file path or data URI in url.1VISION_RUNTIME="./translategemma-4b-it.Q8_0.mmproj-Q8_0.llamafile"
2sh "$VISION_RUNTIME" --translate-messages-json "$(cat <<'JSON'
3[
4 {
5 "role": "user",
6 "content": [
7 {
8 "type": "image",
9 "source_lang_code": "en",
10 "target_lang_code": "zh-CN",
11 "url": "./IMG_8477.PNG"
12 }
13 ]
14 }
15]
16JSON
17)".llamafile with an embedded mmproj-Q8_0 projector. This is the recommended image translation runtime in the current SKU set.