A lightweight, zero-configuration neural machine translator for .NET. Supports OPUS-MT models for high-quality bilingual translation. Start small. Download what you need. Run locally.
Install
| Product | Versions |
|---|---|
| .NET |
README
LMSupply.Translator
Local neural machine translation for .NET with automatic model downloading.
Features
- Zero-config: Models download automatically from HuggingFace
- GPU Acceleration: CUDA (NVIDIA), CoreML (macOS)
- Apache-2.0 Licensed: OPUS-MT models for commercial use
- Asian Languages: Korean, Japanese, Chinese to/from English
Quick Start
using LMSupply.Translator;
// Load a translation model (Korean to English)
await using var translator = await LocalTranslator.LoadAsync("ko-en");
// Translate text
var result = await translator.TranslateAsync("์๋
ํ์ธ์, ๋ฐ๊ฐ์ต๋๋ค.");
Console.WriteLine(result.TranslatedText);
// Output: "Hello, nice to meet you."
Console.WriteLine($"{result.SourceLanguage} โ {result.TargetLanguage}");
Available Models
| Alias | Direction | Model | BLEU | Description |
|---|---|---|---|---|
default |
Ko โ En | OPUS-MT | 35.5 | Default |
ko-en |
Ko โ En | OPUS-MT | 35.5 | Korean to English |
ja-en |
Ja โ En | OPUS-MT | 32.0 | Japanese to English |
zh-en |
Zh โ En | OPUS-MT | 30.5 | Chinese to English |
GPU Acceleration
Do not add ONNX Runtime packages (Microsoft.ML.OnnxRuntime*): LMSupply provisions the runtime itself, and a
second copy conflicts with it. ExecutionProvider.Auto uses CUDA when the driver supports CUDA 13 and the CUDA 13
runtime and cuDNN 9 are installed on the machine (ONNX Runtime 1.30 is built for CUDA 13), CoreML on macOS, and the CPU otherwise. On Windows with an AMD or Intel GPU, ONNX
sessions run on the CPU (DirectML was removed in 0.67.0). See
GPU acceleration.
Changes from Previous Version
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.