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.
It is possible to run LTEngine entirely on the CPU, but an accelerator will greatly improve performance. Supported accelerators currently include:
⚠️ 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 | Good for testing, poor translations | |||
| gemma3-4b | :heavy_check_mark: | |||
| gemma3-12b | ||||
| gemma4-27b | Best translation quality, slowest |
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
$ claude mcp add LTEngine \
-- python -m otcore.mcp_server <graph>