hy-mt
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@hy-mtTranslate 'Hello, how are you?' to Japanese"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
HY-MT Translation Service
π All-in-One Docker deployment for Tencent HunyuanMT 1.5 translation model with Web UI, REST API, and MCP Server support.
β¨ Features
π 38 Languages Support - Chinese, English, Japanese, Korean, French, German, Spanish, and 31 more
π¨ Modern Web UI - Dark/Light theme toggle, drag & drop file upload, real-time progress display
β‘ Streaming Translation - Server-Sent Events (SSE) for real-time output, perfect for long texts
π§ Full Parameter Control - Temperature, Top-P, Top-K, repetition penalty adjustable
π Terminology Intervention - Custom term mapping for domain-specific translations
π€ MCP Server - Model Context Protocol support for AI assistants (Claude, etc.)
π³ One-Click Deployment - All-in-One Docker image with all models pre-downloaded
π Smart GPU Management - Auto GPU selection, idle timeout, memory release
π Multi-Model Support - Switch between 4 models (1.8B/7B, base/FP8) via UI or API
Related MCP server: DeepL MCP Server
π― Model Selection Guide
Model | VRAM | Speed | Quality | Recommendation |
HY-MT 7B | 16GB | ββββ | βββββ | π Best Choice - Highest quality, fast speed |
HY-MT 1.8B | 6GB | βββββ | ββββ | Good for limited VRAM |
HY-MT 1.8B FP8 | 4GB | βββ | ββββ | For VRAM < 6GB |
HY-MT 7B FP8 | 10GB | ββ | βββββ | 7B quality with less VRAM |
π‘ Tip: If you have 16GB+ VRAM, use HY-MT 7B for best results. FP8 models save memory but are slower due to runtime decompression.
πΈ Screenshot
π Quick Start
Docker Run (Recommended)
# One command to start (uses 7B model by default)
docker run -d --gpus all \
-p 8021:8021 \
-v ./models:/app/models \
--name hy-mt \
neosun/hy-mt:latest
# Access Web UI
open http://localhost:8021The Docker image (~43GB) includes all 4 models pre-downloaded. No external downloads needed!
Docker Compose
Create docker-compose.yml:
services:
hy-mt:
image: neosun/hy-mt:latest
container_name: hy-mt
ports:
- "8021:8021"
environment:
- MODEL_NAME=tencent/HY-MT1.5-7B # Recommended for 16GB+ VRAM
- GPU_IDLE_TIMEOUT=300
- HF_ENDPOINT=https://huggingface.co # Use https://hf-mirror.com for China
volumes:
- ./models:/app/models
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stoppeddocker compose up -dπ Requirements
Requirement | Minimum | Recommended |
GPU | NVIDIA GPU with 6GB+ VRAM | 16GB+ VRAM (for 7B model) |
CUDA | 11.8+ | 12.4+ |
Docker | 20.10+ | 24.0+ |
nvidia-docker | Required | - |
Verify GPU Support
# Check NVIDIA driver
nvidia-smi
# Check Docker GPU support
docker run --rm --gpus all nvidia/cuda:12.4.1-base-ubuntu22.04 nvidia-smiπ Performance Benchmark
Tested on NVIDIA L40S GPU, translating English to Chinese:
Model | Short (61 chars) | Medium (530 chars) | Long (1.8K chars) | Extra Long (4.2K chars) |
HY-MT 7B | 0.4s | 4.4s | 17.7s | 43.0s |
HY-MT 1.8B | 0.4s | 3.6s | 14.0s | 32.3s |
HY-MT 1.8B FP8 | 1.1s | 10.8s | 38.1s | 92.9s |
HY-MT 7B FP8 | 2.9s | 28.5s | 115.6s | 274.1s |
β οΈ Why are FP8 models slower?
This is counter-intuitive but technically correct:
Comparison | Speed Change | Reason |
1.8B FP8 vs 1.8B | 2.7x slower | Runtime decompression overhead |
7B FP8 vs 7B | 6.4x slower | More parameters = more decompression |
FP8 quantization is designed to save VRAM, not to speed up inference. The model is stored in 8-bit format but needs to be decompressed to 16-bit for GPU computation at runtime. This decompression happens for every token generation.
When to use FP8:
β When VRAM is limited (< 16GB for 7B, < 6GB for 1.8B)
β Not for speed optimization
β Not for batch processing (speed loss accumulates)
See Benchmark Report for detailed analysis.
π Key Optimization: Chunk Size
Critical finding: Smaller chunk size = Better translation quality
Chunk Size | Quality | Notes |
500 chars | β Poor | Mixed languages in output |
300 chars | β οΈ Fair | Some untranslated residue |
150 chars | β Excellent | Complete, accurate translation |
The service uses MAX_CHUNK_LENGTH=150 by default for optimal quality.
Why? HY-MT model tends to "slack off" on long inputs, only translating part of the content. Shorter chunks force the model to fully translate each segment.
See Optimization Guide for details.
βοΈ Configuration
Environment Variables
Variable | Default | Description |
| 8021 | Service port |
| tencent/HY-MT1.5-7B | HuggingFace model name |
| ./models | Local model cache path |
| 300 | Auto-release GPU after idle (seconds) |
| auto | GPU ID (empty = auto select) |
| HuggingFace mirror URL |
Using .env File
# Copy example config
cp .env.example .env
# Edit as needed
vim .envπ API Usage
Basic Translation
curl -X POST "http://localhost:8021/api/translate" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello, how are you?",
"target_lang": "zh"
}'Response:
{
"status": "success",
"result": "δ½ ε₯½οΌδ½ ε₯½εοΌ",
"elapsed_ms": 358,
"model": "tencent/HY-MT1.5-7B",
"chunks": 1
}Streaming Translation (SSE)
curl -N "http://localhost:8021/api/translate" \
-H "Content-Type: application/json" \
-d '{
"text": "Long article to translate...",
"target_lang": "en",
"stream": true
}'With Terminology Intervention
curl -X POST "http://localhost:8021/api/translate" \
-H "Content-Type: application/json" \
-d '{
"text": "Apple released iPhone 16",
"target_lang": "zh",
"terms": {"Apple": "θΉζε
¬εΈ", "iPhone": "θΉζζζΊ"}
}'Output: θΉζε
¬εΈεεΈδΊθΉζζζΊ16
File Upload Translation
curl "http://localhost:8021/api/translate/file" \
-F "file=@document.txt" \
-F "target_lang=zh" \
-F "stream=true"Switch Model
curl -X POST "http://localhost:8021/api/models/switch" \
-H "Content-Type: application/json" \
-d '{"model": "tencent/HY-MT1.5-1.8B"}'π API Endpoints
Endpoint | Method | Description |
| GET | Web UI |
| POST | Translate text (supports streaming) |
| POST | Upload and translate file |
| POST | Batch translation |
| POST | Streaming translation (SSE) |
| GET | List supported languages |
| GET | List available models |
| POST | Switch translation model |
| GET | GPU status and memory info |
| POST | Release GPU memory |
| GET | Service configuration |
| GET | Health check |
| GET | Swagger API documentation |
π Supported Languages
Language | Code | Language | Code | Language | Code |
Chinese | zh | English | en | Japanese | ja |
Korean | ko | French | fr | German | de |
Spanish | es | Portuguese | pt | Russian | ru |
Arabic | ar | Thai | th | Vietnamese | vi |
Italian | it | Dutch | nl | Polish | pl |
Turkish | tr | Indonesian | id | Malay | ms |
Hindi | hi | Traditional Chinese | zh-Hant | Cantonese | yue |
And 17 more languages. See /api/languages for full list.
π οΈ Tech Stack
Model: Tencent HY-MT1.5 (1.8B & 7B)
Backend: FastAPI + Uvicorn
Frontend: Vanilla JS with Dark/Light Mode
Container: NVIDIA CUDA 12.4 base image
Streaming: Server-Sent Events (SSE)
MCP: Model Context Protocol for AI integration
π Project Structure
hy-mt/
βββ app_fastapi.py # Main FastAPI application
βββ mcp_server.py # MCP Server for AI assistants
βββ benchmark.py # Performance benchmark script
βββ templates/
β βββ index.html # Web UI (Dark/Light theme)
βββ docs/
β βββ BENCHMARK_REPORT.md # Performance test report
β βββ OPTIMIZATION_GUIDE.md # Long text optimization guide
β βββ QUICK_REFERENCE.md # API quick reference
βββ Dockerfile # All-in-One Docker build
βββ docker-compose.yml # Docker Compose config
βββ start.sh # Quick start script
βββ test_api.sh # API test script
βββ .env.example # Environment config templateπ§ Advanced Usage
Manual Start (Development)
# Clone repository
git clone https://github.com/neosun100/hy-mt.git
cd hy-mt
# Install dependencies
pip install torch transformers accelerate fastapi uvicorn
# Run
python -m uvicorn app_fastapi:app --host 0.0.0.0 --port 8021MCP Server Integration
For AI assistants like Claude Desktop, add to MCP config:
{
"mcpServers": {
"hy-mt": {
"command": "python",
"args": ["/path/to/hy-mt/mcp_server.py"],
"env": {
"HY_MT_API": "http://localhost:8021"
}
}
}
}Available MCP tools:
translate- Translate textlist_languages- Get supported languageslist_models- Get available modelsswitch_model- Switch translation model
See MCP_GUIDE.md for details.
π Troubleshooting
Issue | Solution |
Model download slow | Set |
GPU out of memory | Use quantized model: |
Container won't start | Check |
Translation incomplete | Already optimized with chunk size 150 |
Container shows unhealthy | Wait 1-2 minutes for model loading |
π Changelog
v2.0.1 (2026-01-03)
π Default model changed to HY-MT 7B (best quality & speed)
π©Ί Added Docker HEALTHCHECK for container health monitoring
π¦ Container status now shows
(healthy)when ready
v2.0.0 (2026-01-03) - True All-in-One
π― All 4 models pre-downloaded in Docker image - No external downloads needed!
π¦ Image size: ~43GB (includes all models)
π Recommended: HY-MT 7B for best quality and speed
π Added performance benchmark report
π§ Added
benchmark.pyfor reproducible testing
v1.2.0 (2026-01-03)
π Multi-model support (4 models: 1.8B, 1.8B-FP8, 7B, 7B-FP8)
π Model switching via UI and API
π MCP Server: added
list_modelsandswitch_modeltoolsπ Fixed model name display in translation response
v1.0.0 (2026-01-03)
π Initial release
β¨ All-in-One Docker image
β‘ Streaming translation with SSE
π¨ Dark/Light theme Web UI
π§ Long text optimization (chunk size 150)
π€ MCP Server support
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/AmazingFeature)Commit your changes (
git commit -m 'Add some AmazingFeature')Push to the branch (
git push origin feature/AmazingFeature)Open a Pull Request
π License
This project is based on Tencent HunyuanMT. See License.txt for details.
π Acknowledgments
Tencent Hunyuan - Original HY-MT model
HuggingFace - Model hosting
β Star History
π± Follow Us
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/neosun100/hy-mt'
If you have feedback or need assistance with the MCP directory API, please join our Discord server