Instructions to use Iman998/HexaBee-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Iman998/HexaBee-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Iman998/HexaBee-4B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Iman998/HexaBee-4B") model = AutoModelForMultimodalLM.from_pretrained("Iman998/HexaBee-4B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Iman998/HexaBee-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Iman998/HexaBee-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Iman998/HexaBee-4B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Iman998/HexaBee-4B
- SGLang
How to use Iman998/HexaBee-4B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Iman998/HexaBee-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Iman998/HexaBee-4B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Iman998/HexaBee-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Iman998/HexaBee-4B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use Iman998/HexaBee-4B with Docker Model Runner:
docker model run hf.co/Iman998/HexaBee-4B
HexaBee-4B
Six languages. One translator.
Paper: Iman Barati, Mohammadmostafa Rostamkhani, and Mohammad Badzohreh, HexaBee-4B: Six-Language Translation with Multilingual Answering and Bidirectional Supervision, arXiv:2610.16361 (2026).
Overview · Quick start · Contents · Provenance · Limitations · Release family · Research code
Overview
The final merged HexaBee-4B translator based on Gemma 3 4B IT. Adaptation combines Wikipedia continued pretraining, multilingual answering with answer-text translation, and a final fresh LoRA trained on bidirectional synthetic translations. The six evaluation languages are Persian, English, Arabic, Chinese, Hebrew and Spanish.
| Property | Value |
|---|---|
| Artifact | HexaBee-4B |
| Scope | Final merged translator |
| Checkpoint | Merged model weights |
| Format | Safetensors + processor |
| Release | Audited historical artifacts |
| Model family | HexaBee-4B / Gemma 3 |
Translation benchmark
| System | BLEU ↑ | chrF ↑ | chrF++ ↑ | TER ↓ | COMET ×100 ↑ |
|---|---|---|---|---|---|
| Gemma 3 4B IT | 40.70 | 58.91 | 57.11 | 51.40 | 85.88 |
| Gemma 3 12B IT | 50.54 | 68.70 | 66.83 | 38.89 | 88.20 |
| HexaBee-4B | 62.03 | 75.08 | 73.75 | 30.05 | 89.86 |
Equal-weight macro over 30 directions, 36,572 test items per model. Best displayed values are bold; the second distinct value is underlined. TER is lower-is-better. Synthetic references and differing archived inference templates limit comparisons. These are archived research results, not an official shared-task ranking.
Quick start
import torch
from transformers import AutoModelForImageTextToText, AutoProcessor
repo = "Iman998/HexaBee-4B"
processor = AutoProcessor.from_pretrained(repo)
model = AutoModelForImageTextToText.from_pretrained(
repo, torch_dtype=torch.bfloat16, device_map="auto"
).eval()
messages = [
{"role": "system", "content": [{"type": "text", "text": "Translate the following text from English into Persian."}]},
{"role": "user", "content": [{"type": "text", "text": "Language brings people together."}]}
]
inputs = processor.apply_chat_template(
messages, add_generation_prompt=True, tokenize=True, return_dict=True,
return_tensors="pt"
).to(model.device)
with torch.inference_mode():
output = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(processor.decode(output[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
The processor must preserve Gemma 3's system/user formatting. This short example uses a new 512-token generation budget; the archived evaluation used its own recorded inference settings.
Contents
Full two-shard Safetensors weights, Gemma 3 processor/tokenizer and chat template. No adapter merge is required for this repository.
release_manifest.json lists distributed files, sizes, and SHA-256. release_stats.json records measured artifact metadata.
Provenance
The final model was trained with a fresh rank-256 LoRA (alpha 512, dropout 0.005) on the already-merged multilingual checkpoint. The final stage retained 658,274 SFT records: 329,137 aligned pairs in both orientations. It ran one epoch with learning rate 1e-4 and cutoff 4,096. All weights are preserved; only local path metadata is normalized for publication.
This release is part of HexaBee-4B, previously labeled PCT-4B in the local evaluation audit. Both names refer to the same final translator. Renaming does not imply retraining. This repository is an artifact release, not evidence of workshop acceptance or an official shared-task ranking.
Limitations
The released checkpoint has not been evaluated for image tasks, despite retaining the Gemma 3 multimodal architecture. Intermediate checkpoints have no independent matched translation evaluation. Quality can vary by language, domain, and input length.
The complete adaptation recipe was evaluated; no matched ablation isolates the contribution of multilingual answering. Synthetic references and model-based judges limit interpretation. Long COMET inputs are truncated at the encoder limit. Use the independent evaluation repository for precise sample counts, parameters, all directions, and uncertainty estimates.
Release family
| Artifact | Repository |
|---|---|
| HexaBee-4B | Iman998/HexaBee-4B |
| HexaBee · Multilingual Base | Iman998/HexaBee-4B-Multilingual-Base |
| HexaBee · Wikipedia PT LoRA | Iman998/HexaBee-4B-PT-LoRA |
| HexaBee · Multilingual SFT LoRA | Iman998/HexaBee-4B-Multilingual-SFT-LoRA |
| HexaBee · Translation LoRA | Iman998/HexaBee-4B-Translation-LoRA |
| HexaBee · Wikipedia Foundations | Iman998/HexaBee-Wikipedia-PT |
| HexaBee · Multilingual Answering & Translation | Iman998/HexaBee-Multilingual-SFT |
| HexaBee · Bidirectional Translation | Iman998/HexaBee-Bidirectional-Translation |
| HexaBee · The Prompt Hive | Iman998/HexaBee-System-Prompts |
| HexaBee · Translation Archive | Iman998/HexaBee-Model-Outputs |
| HexaBee · Evaluation Atlas | Iman998/HexaBee-Evaluation |
Each phase, checkpoint, prompt inventory, output archive and evaluation result has its own repository and card. Model cards identify the exact adapter base; dataset cards identify the unit of a released row. Historical row counts are not counts of unique source articles.
License and attribution
See LICENSE.md. Model weights remain under Gemma terms; upstream dataset and service terms are not replaced by this repository's software license. The illustrated branding is decorative and does not encode experimental evidence.
Citation and references
Please cite Barati, Rostamkhani, and Badzohreh (2026), HexaBee-4B: Six-Language Translation with Multilingual Answering and Bidirectional Supervision. Research code.
Related methods and tools: Gemma 3, LoRA, LLaMA-Factory, SacreBLEU, COMET.
⬡ HexaBee-4B · FA · EN · AR · ZH · HE · ES
Maintained by Iman998
Cite this paper
@misc{barati2026hexabee4b,
title={HexaBee-4B: Six-Language Translation with Multilingual Answering and Bidirectional Supervision},
author={Barati, Iman and Rostamkhani, Mohammadmostafa and Badzohreh, Mohammad},
year={2026},
eprint={2610.16361},
archivePrefix={arXiv},
url={https://arxiv.org/abs/2610.16361}
}
- Downloads last month
- 5
Model tree for Iman998/HexaBee-4B
Base model
google/gemma-3-4b-pt
