Hy-MT2 Open-Source Translation Models: Selection and Local Deployment Guide
This guide explains how to choose among Hy-MT2-1.8B, Hy-MT2-7B, and Hy-MT2-30B-A3B for offline, online, and high-complexity translation workloads. It covers the trade-offs between closed-source and open-source translation models, hardware and VRAM estimation, dependency and version preparation, launching models with Xinference, calling an OpenAI-compatible API, troubleshooting common startup failures, and running a quality self-test on your own corpus. The goal is to help teams select a model size based on latency, cost, deployment constraints, and measured translation quality rather than specifications alone.
The short answer first: for phones, tablets, or offline scenarios, start with 1.8B; for general online translation and enterprise services with latency requirements, try 7B first; for complex writing styles and professional documents, evaluate 30B-A3B, but reserve enough VRAM. The final choice should be based on tests with your own corpus.
Between closed-source and open-source models, there is another option
Translation model selection used to focus mainly on translation quality. Developers now also need to consider response speed, invocation cost, and deployment method. Closed-source cloud models can deliver high quality, but core text must be processed by a third-party platform, API costs grow with usage, and vendor lock-in is possible. Traditional small open-source models can run offline and keep data local, but their capacity is limited. Translation quality often becomes unstable with long, complex sentences, specialized terminology, and culturally nuanced words.
The Hy-MT2 series of open-source models attempts to fill this gap. According to the original description, its design approach is to have the model produce the translation directly in a single inference pass without relying on multiple rounds of self-correction. This helps reduce latency, but translation quality still depends on training methods and model scale. Whether it reaches the level described in the original material should be judged after testing on your own corpus.
How to choose among the three specifications
Hy-MT2 offers three specifications, covering scenarios from mobile devices to cloud servers.
| Specification | Architecture | Key characteristics | Recommended use cases |
|---|---|---|---|
| Hy-MT2-1.8B | Dense | Small footprint; the original description says about 440 MB after some quantization | Phones, tablets, offline translation, real-time speech translation |
| Hy-MT2-7B | Dense | A balance between quality and inference cost | General online translation, enterprise applications with some latency requirements |
| Hy-MT2-30B-A3B | Mixture of Experts (MoE) | 30B total parameters, about 3B activated per inference | Complex writing styles, professional documents, core engine for higher-layer services |
The 30B-A3B naming needs clarification. It is a mixture-of-experts model that activates only about 3B parameters per inference, so the compute per inference is close to that of a smaller model. However, the weights of all experts usually still need to be loaded into memory or VRAM, so hardware requirements should be estimated at the 30B scale. Quantization or CPU offload can reduce VRAM usage, but may come with speed or quality trade-offs that need to be measured.
Check the following items one by one during selection:
- Whether the device has enough memory or VRAM, with headroom left for the inference process.
- Whether the business can accept network calls, or whether it must run offline.
- What the minimum acceptable translation quality is, and whether it can be verified with your own test set.
- What the latency ceiling is for a single request.
- Whether the model license allows your intended use. Before commercial use, check the model license, model card, and responsibility boundaries for generated output.
Preparation before startup
The runtime environment needs an NVIDIA GPU with CUDA support or an Apple Silicon chip, with PyTorch installed in advance.
Xinference and Transformers are updated frequently. Install the versions specified in the official documentation rather than defaulting to the latest release. Version mismatches are a common cause of failures. After installation, run the following command to confirm the versions:
pip install "xinference==<version specified in the official documentation>" "transformers==<version specified in the official documentation>"python -c "import torch, transformers, xinference; print(torch.__version__, transformers.__version__, xinference.__version__)"
Model identifiers should also follow the official model page. This article uses <official model ID> as a placeholder. Replace it with the actual identifier shown on the page; do not copy the example name directly. Some models require accepting a license agreement in the model repository or configuring an access token before the weights can be downloaded. Store access tokens in environment variables; do not hard-code them in scripts or commit them to a code repository.
VRAM estimation
File size does not equal runtime memory usage. The original description says the 1.8B version is about 440 MB under some quantization scheme, but it does not state the quantization bit width. That number is the size of the weight file, not the runtime VRAM usage.
A rough estimation method is: the number of parameters multiplied by the number of bytes per parameter, plus the inference framework, KV cache, and runtime overhead. At FP16 precision, each parameter takes about 2 bytes, so 30B weights require about 60 GB. At 4-bit quantization, each parameter takes about 0.5 bytes, so 30B weights require about 15 GB, and actual usage will be higher. This is only an order-of-magnitude estimate; use official releases and your own measurements for real values.
Startup workflow
Step 1: Install dependencies. Run pip install according to the version requirements in the previous section.
Step 2: Launch the model:
xinference launch --model-name <official model ID>
Some Xinference versions also require specifying the model format, parameter scale, or quantization method. Use the official documentation for the exact parameters.
Step 3: Confirm that the service has registered the model. The default Xinference port is usually 9997; use the port shown in the startup log:
curl http://localhost:9997/v1/models
Normally, the response is JSON, and the data list contains the ID of the model just launched. If the list is empty or does not contain the target ID, the model was not registered successfully. Use the troubleshooting checklist below.
API invocation
Xinference provides an OpenAI-compatible interface. The following request sends a translation task. The prompt format should follow the instructions on the official model page; the example is only for verifying whether the API is reachable:
curl http://localhost:9997/v1/chat/completions \-H "Content-Type: application/json" \-d '{"model": "<official model ID>","messages": [{"role": "user", "content": "Translate the following sentence into Chinese: The meeting today has been postponed to next Tuesday."}],"temperature": 0}'
In the returned JSON, the choices[0].message.content field contains the model output, and the usage field gives the number of input and output tokens. If you only want to extract the translated text, use the following command:
curl -s http://localhost:9997/v1/chat/completions \-H "Content-Type: application/json" \-d '{"model": "<official model ID>", "messages": [{"role": "user", "content": "Translate the following sentence into Chinese: The meeting today has been postponed to next Tuesday."}], "temperature": 0}' \| python -c "import sys, json; print(json.load(sys.stdin)['choices'][0]['message']['content'])"
If authentication is enabled for the service, include -H "Authorization: Bearer $API_KEY" in the request. Read the key from an environment variable; do not write it directly into the command.
Troubleshooting startup failures
Checking in the following order usually helps locate the problem quickly.
- Model not registered.
/v1/modelsreturns an empty list or does not contain the target ID. Check whether the model ID in the launch command matches the official page, and inspect the error messages in the startup log. - Download failure or 401/403 response. This is usually caused by an unaccepted license agreement or an invalid access token. First confirm the agreement status in the model repository, then check whether the token has expired or lacks permissions.
- Insufficient VRAM, with
CUDA out of memoryin the log. Use a smaller specification, switch to a quantized version, or reduce batch size and context length. NVIDIA users can runnvidia-smito check VRAM usage; Apple Silicon users can check memory pressure in Activity Monitor. - Version mismatch. Errors often mention a missing function, attribute, or parameter. Reinstall the specified versions according to the official documentation, and run the version check command above.
- Port unreachable. Confirm that the service process is still running, the port matches the log, and the firewall is not blocking it. Verify step by step with
curl http://localhost:<port>/v1/models.
Quality self-test
Specifications and parameter tables can only help narrow the range. Final translation quality should be judged with your own corpus.
A suggested self-test process:
- Sample a batch from real business data, covering everyday short sentences, long complex sentences, specialized terminology, and culturally nuanced words. The number of samples in each category can depend on business volume; a few hundred samples are usually enough to reveal clear differences.
- Translate the same batch with each candidate specification, and record the time for each item, including time to first token and total time.
- Have humans score accuracy, fluency, and terminology consistency. Do not rely only on model self-evaluation, because models tend to rate their own translations too highly.
- Record VRAM or memory usage in the same table and compare it with device constraints.
- Compare quality, latency, and resource usage together. A specification is suitable for formal deployment only when all three fall within the business’s acceptable range.
After completing this test, model selection has a basis. The chosen specification can be 1.8B, 7B, or 30B-A3B; the key question is whether it passes acceptance on your samples.
