Downloads · 30 days
452
7% of all-time downloads
trillionlabs/Tri-1.8B-Translation
Tri-1.8B-Translation is a translation model from trillionlabs. Use it when you need text moved from one language to another. It is set up for transformers. The card lists the license as apache-2.0.
We release Tri-1.8B Translation, a lightweight multilingual translation model from Trillion Labs.
Downloads · 30 days
452
7% of all-time downloads
All-time downloads
6.5K
Public
Parameters
1.8B
7.2 GB on disk
Likes
19
Public
Click a slice to open those files.
.safetensors7.2 GB · 100%
From the Hugging Face model README
We release Tri-1.8B Translation, a lightweight multilingual translation model from Trillion Labs.
Tri-1.8B Translate is trained through pretraining and supervised fine-tuning (SFT), and was distilled from our larger Tri-21B model to preserve strong translation quality in a much smaller, deployment-friendly 1.8B parameter model. It supports all translation directions among English, Korean, Japanese, and Chinese.
<lang> tag.Translate the following {SRC_NAME} text into {TGT_NAME}:
{TEXT} <{lang_tag}>
Where {lang_tag} ∈ { en, ko, ja, zh }.
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "trillionlabs/Tri-1.8B-Translation"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
text = "안녕하세요"
messages = [
{"role": "user", "content": f"Translate the following Korean text into English:\n{text} <en>"}
]
inputs = tokenizer.apply_chat_template(
messages,
return_tensors="pt",
add_generation_prompt=True
).to(model.device)
outputs = model.generate(
inputs,
max_new_tokens=256,
do_sample=False,
pad_token_id=tokenizer.eos_token_id
)
full_output = tokenizer.decode(outputs[0], skip_special_tokens=True)
translation = tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True)
print(f"Korean: {text}")
print(f"English: {translation}")
from vllm import LLM, SamplingParams
llm = LLM(model="trillionlabs/Tri-1.8B-Translation")
sp = SamplingParams(temperature=0.3, max_tokens=512)
def translate(text, target="en"):
prompt = f"Translate into {target}:\n{text} <{target}>"
out = llm.chat([{"role": "user", "content": prompt}], sampling_params=sp)
return out[0].outputs[0].text.strip()
print(translate("안녕하세요", "en"))
import openai
client = openai.OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
def translate(text, target="en"):
prompt = f"Translate into {target}:\n{text} <{target}>"
resp = client.chat.completions.create(
model="trillionlabs/Tri-1.8B-Translation",
messages=[{"role": "user", "content": prompt}],
temperature=0.3,
max_tokens=512,
)
return resp.choices[0].message.content.strip()
print(translate("안녕하세요", "en"))
Apache-2.0 (for model weights & code). Please verify data licenses for your use.
If you use Tri-1.8B Translation, please cite:
@misc{suk2025tri18b,
title = {Tri-1.8B Translation: A Lightweight Multilingual Translation Model},
author = {Juyoung Suk and Trillion Labs},
year = {2025},
howpublished = {\url{https://huggingface.co/trillionlabs/Tri-1.8B-Translation}}
}