An interactive demo of google/madlad400-3b-mt, Google's T5-based machine-translation model trained on ~1 trillion tokens spanning more than 450 languages. The source language is auto-detected โ just pick the target.
One-click examples, beam search / temperature controls, right-to-left output for
Arabic, Hebrew, Persian & Urdu, plus a /translate API and MCP server.
Every language present in the released checkpoint (of 418 audited in the MADLAD-400 paper), with 20 common ones pinned to the top.
3B-parameter T5 in bfloat16, streamed onto an NVIDIA GPU per request โ no server costs for visitors.
Output boxes automatically flip direction for right-to-left scripts such as Arabic and Dhivehi.
A documented /translate Gradio API endpoint and a built-in MCP server for agents.
Each request is prefixed with the target-language token (<2xx>):
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
import torch
model = AutoModelForSeq2SeqLM.from_pretrained(
"google/madlad400-3b-mt", dtype=torch.bfloat16
).to("cuda")
tokenizer = AutoTokenizer.from_pretrained("google/madlad400-3b-mt")
ids = tokenizer('<2pt> I love pizza!', return_tensors="pt").to("cuda")
print(tokenizer.decode(model.generate(**ids, max_new_tokens=256)[0],
skip_special_tokens=True))
# โ Eu adoro pizza!
app.py, languages.py, requirements.txt).