Free and Open Source Local AI Machine Translation API, written in Rust, entirely self-hosted and compatible with LibreTranslate. Its translation capabilities are powered by large language models (LLMs) that run locally on your machine via llama.cpp.
The LLMs in LTEngine are much larger than the lightweight transformer models in LibreTranslate. Thus memory usage and speed are traded off for quality of outputs, which for some languages has been reported as being on par or better than DeepL.
It is possible to run LTEngine entirely on the CPU, but an accelerator will greatly improve performance. Supported accelerators currently include:
The largest model (gemma3-27b) can fit on a single consumer RTX 3090 with 24G of VRAM.
⚠️ LTEngine is in active development. Check the Roadmap for current limitations.
git clone https://github.com/LibreTranslate/LTEngine --recursive
cd LTEngine
cargo build [--features cuda,vulkan,metal] --release
./target/release/ltengine
To run different LLM models:
./target/release/ltengine -m gemma3-12b [--model-file /path/to/model.gguf]
LTEngine supports any GGUF language model supported by llama.cpp. You can pass a path to load a custom .gguf model using the --model-file parameter. Otherwise LTEngine will download one of the Gemma3 models based on the -m parameter:
| Model | RAM Usage | GPU Usage | Notes | Default |
|---|---|---|---|---|
| gemma3-1b | 1G | 2G | Good for testing, poor translations | |
| gemma3-4b | 4G | 4G | :heavy_check_mark: | |
| gemma3-12b | 8G | 10G | ||
| gemma3-27b | 16G | 18G | Best translation quality, slowest |
Memory usage numbers are approximate.
Request:
const res = await fetch("http://0.0.0.0:5050/translate", {
method: "POST",
body: JSON.stringify({
q: "Hello!",
source: "en",
target: "es",
}),
headers: { "Content-Type": "application/json" },
});
console.log(await res.json());
Response:
{
"translatedText": "¡Hola!"
}
List of language codes: https://0.0.0.0:5000/languages
Request:
const res = await fetch("http://0.0.0.0:5000/translate", {
method: "POST",
body: JSON.stringify({
q: "Ciao!",
source: "auto",
target: "en",
}),
headers: { "Content-Type": "application/json" },
});
console.log(await res.json());
Response:
{
"detectedLanguage": {
"confidence": 83,
"language": "it"
},
"translatedText": "Bye!"
}
You can use the LTEngine API using the following bindings:
/translate_file (ability to translate files)../ltengine translate as a command line app separate from ./ltengine server)We welcome contributions! Just open a pull request.
This work is largely possible thanks llama-cpp-rs which provide the Rust bindings to llama.cpp.
GNU Affero General Public License v3
Rust
41.8%
JavaScript
30.3%
HTML
14.5%
CSS
10.8%
Dockerfile
2.6%
Free and Open Source Local AI Machine Translation API, written in Rust, entirely self-hosted and compatible with LibreTranslate. Its translation capabilities are powered by large language models (LLMs) that run locally on your machine via llama.cpp.
The LLMs in LTEngine are much larger than the lightweight transformer models in LibreTranslate. Thus memory usage and speed are traded off for quality of outputs, which for some languages has been reported as being on par or better than DeepL.
It is possible to run LTEngine entirely on the CPU, but an accelerator will greatly improve performance. Supported accelerators currently include:
The largest model (gemma3-27b) can fit on a single consumer RTX 3090 with 24G of VRAM.
⚠️ LTEngine is in active development. Check the Roadmap for current limitations.
git clone https://github.com/LibreTranslate/LTEngine --recursive
cd LTEngine
cargo build [--features cuda,vulkan,metal] --release
./target/release/ltengine
To run different LLM models:
./target/release/ltengine -m gemma3-12b [--model-file /path/to/model.gguf]
LTEngine supports any GGUF language model supported by llama.cpp. You can pass a path to load a custom .gguf model using the --model-file parameter. Otherwise LTEngine will download one of the Gemma3 models based on the -m parameter:
| Model | RAM Usage | GPU Usage | Notes | Default |
|---|---|---|---|---|
| gemma3-1b | 1G | 2G | Good for testing, poor translations | |
| gemma3-4b | 4G | 4G | :heavy_check_mark: | |
| gemma3-12b | 8G | 10G | ||
| gemma3-27b | 16G | 18G | Best translation quality, slowest |
Memory usage numbers are approximate.
Request:
const res = await fetch("http://0.0.0.0:5050/translate", {
method: "POST",
body: JSON.stringify({
q: "Hello!",
source: "en",
target: "es",
}),
headers: { "Content-Type": "application/json" },
});
console.log(await res.json());
Response:
{
"translatedText": "¡Hola!"
}
List of language codes: https://0.0.0.0:5000/languages
Request:
const res = await fetch("http://0.0.0.0:5000/translate", {
method: "POST",
body: JSON.stringify({
q: "Ciao!",
source: "auto",
target: "en",
}),
headers: { "Content-Type": "application/json" },
});
console.log(await res.json());
Response:
{
"detectedLanguage": {
"confidence": 83,
"language": "it"
},
"translatedText": "Bye!"
}
You can use the LTEngine API using the following bindings:
/translate_file (ability to translate files)../ltengine translate as a command line app separate from ./ltengine server)We welcome contributions! Just open a pull request.
This work is largely possible thanks llama-cpp-rs which provide the Rust bindings to llama.cpp.
GNU Affero General Public License v3
Rust
41.8%
JavaScript
30.3%
HTML
14.5%
CSS
10.8%
Dockerfile
2.6%