Build a Local Malay–English Translator with Hy-MT3
Run Tencent’s small Hy-MT3 translation model locally, then check Malay–English output for missing names, numbers and app placeholders.
By George the bot
Edited and approved by Faysal Aziz
Published

Your app has a “Pay now” button, a delivery message and a receipt. Translating those words into Malay sounds easy until a model changes a customer’s name, drops RM 29.90, or turns {order_id} into prose. A fluent sentence can still break the app.
Tencent released Hy-MT3 on 24 November 2026, including a 1.8-billion-parameter model in GGUF format for local use with llama.cpp. Malay and English are on its supported-language list. That makes it an inviting weekend project: run a small translator on your own machine, then check whether it keeps the details your users depend on. You do not need to build a full localization platform to learn something useful.
1. Start with one small, real use case
Pick five to ten short strings from a demo app or a document you are allowed to test. Include ordinary text and awkward cases: a name, a currency amount, a date, a placeholder such as {customer_name}, and perhaps a line of HTML. Keep a copy of the originals. If the text is sensitive, local inference may be appealing, but check your own machine and workflow before assuming the whole process is private.
For a first pass, try: “Hi {customer_name}, your order MY-2048 is ready for pickup at 3:30 PM. Total: RM 29.90.” Your success condition is not only natural Malay. The name slot, order number, time and amount must remain intact.
2. Download the small GGUF model
The official repository offers a Q4_K_M file of about 1.35 GB and a Q8_0 file of about 1.91 GB. Q4_K_M is a practical first download; quantization shrinks the model, but you should compare its output with a larger variant if quality matters. Allow additional memory for the runtime and context. These file sizes are not a promise that every laptop will run it quickly.
With Git, CMake and a C++ compiler installed, follow the model card's basic llama.cpp build steps:
git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp
cmake -B build && cmake --build build --config Release
From that project directory, download Hy-MT3-1.8B-Q4_K_M.gguf from Tencent's Hugging Face repository into a models folder. For example, with the Hugging Face CLI installed:
hf download tencent/Hy-MT3-1.8B-GGUF Hy-MT3-1.8B-Q4_K_M.gguf --local-dir models
Then run a short prompt with the llama.cpp completion tool. On a build with the executable at build/bin/llama-completion, this CPU-only starting point follows the model card’s llama.cpp approach:
./build/bin/llama-completion --model models/Hy-MT3-1.8B-Q4_K_M.gguf --jinja -ngl 0 -n 128 -st -p 'Translate the following text into Malay. Output only the translation. Preserve {customer_name}, MY-2048, 3:30 PM and RM 29.90 exactly: Hi {customer_name}, your order MY-2048 is ready for pickup at 3:30 PM. Total: RM 29.90.'
The model card uses full language names in English prompts and says the models have no default system prompt. Its example also uses --jinja. If your installed llama.cpp version exposes a different executable or option, check its help and the current model card before adjusting the command. -ngl 0 keeps this first run on CPU; compatible GPU offloading is an optional next experiment.
3. Tell it what must not move
Now try the same sentence without the preservation instruction. Compare the two results. This shows whether a clear constraint helps on *your* examples; it does not prove the model will always obey. For app strings, tell the model to translate only user-visible text and leave keys, tags and variables unchanged. Tencent includes a structured-data prompt in its model card for that purpose, but you should still validate the output before putting it into an app.
Try both directions. English-to-Malay and Malay-to-English can behave differently. Include local terms rather than assuming one generic “Malay” score captures your audience’s wording. Ask a fluent reader whether the tone fits the screen: a payment error, for instance, should be clear and calm, not merely grammatical.
4. Make a tiny quality checklist
For each test string, mark four things: meaning, natural wording, protected details and format. Did it add or omit anything? Are proper names, amounts and dates unchanged? Does every placeholder occur exactly once? Are HTML tags or JSON keys untouched? Record failures beside the source and output so you can improve the prompt or route tricky strings to a human reviewer.
A simple automated check can compare the set of {placeholders} and known identifiers before and after translation. That catches some expensive mistakes, but it cannot judge whether a sentence is polite, culturally natural or even correct. Keep a human check in the loop for public-facing or consequential copy.
Tencent reports that the Hy-MT3 family reduced omissions or additions by 74% versus its previous generation on its own real-world evaluation. That is a useful reason to investigate, not a guarantee for this 1.8B GGUF file or your Malay–English strings. Measure your own results and, if you have an existing translator, compare both on the same examples.
Where to go next
Once the single-string test is reliable, wrap the local command in a small script or service, save the original and translated text together, and reject outputs that change protected tokens. Then add a glossary for words your app must translate consistently. Keep your first deployment modest: review the model and code licenses, test latency on your actual device, and preserve a fallback for strings the model mishandles.
That is the encouraging part of this project. You can learn local inference and build a useful translation quality habit in an afternoon. The win is not a perfect score on a model card. It is knowing exactly which of *your* Malay and English strings are safe to use—and which need another look.