Skip to content
 
 

Repository files navigation

LTEngine

LTEngine-esc is a portable, offline-first Linux document translator powered by local GGUF language models and llama.cpp. Its primary product target is Swedish DOCX/ODT article translation to formatting-preserving HTML for the WordPress Classic Editor Text/code tab. Other language pairs remain supported.

The currently shipped application translates text, stdin, or local .txt documents directly from the CLI. A reusable semantic article model and deterministic WordPress HTML renderer are implemented, but DOCX/ODT import, end-user HTML output, and the native GUI remain roadmap work. It has no HTTP server, browser UI, or loopback listener; see the project specification and WordPress workflow.

Translation

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:

  • CUDA
  • Metal (macOS)
  • Vulkan

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.

Requirements

  • Rust
  • clang
  • CMake
  • A C++ compiler (g++, MSVC) for building the llama.cpp bindings

Build

git clone https://github.com/escapables/LTEngine-esc.git
cd LTEngine-esc
cargo build --release

Run

Running without a subcommand prints an error and usage. Use the required translate subcommand:

Translate Swedish text directly to English:

./target/release/ltengine translate --source sv --target en --text 'Hej världen!' --model-file ./models/model.gguf

Translate stdin while delegating source-language recognition to the model:

printf 'Hej världen!\n' | ./target/release/ltengine translate --source auto --target en --stdin --model-file ./models/model.gguf

Translate a UTF-8 .txt document to a new path:

./target/release/ltengine translate --source sv --target en \
  --input ./documents/source.txt --output ./documents/translated.txt \
  --model-file ./models/model.gguf

Exactly one of --text, --stdin, or --input is required; document mode also requires --output. The default document limit is 10 MiB and can be changed with --max-input-bytes. Documents translate through paragraph-aware sequential slices. Source boundary whitespace and planner-owned slice separators are retained; formatting inside a translated paragraph remains model-controlled. The default --document-context-tokens 512 matches the retained Gemma 3 T480 benchmark; larger values are explicit opt-ins and must not exceed the loaded model limit. Slice progress uses stderr. Existing output files are never overwritten. Text/stdin translation is the only stdout output; document output goes to the selected path.

To run different LLM models:

./target/release/ltengine translate --source sv --target en --text 'Hej' \
  -m gemma3-4b [--model-file /path/to/model.gguf]

For offline operation, stage the GGUF model before disconnecting and pass its local path:

./target/release/ltengine translate --source sv --target en \
  --input ./documents/source.txt --output ./documents/translated.txt \
  --model-file ./models/model.gguf

Inference remains local and makes no external translation API calls. Without --model-file, first use may download a model from Hugging Face.

Models

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 downloads the configured alias selected with -m:

Custom non-Gemma models must provide a usable embedded chat template. Gemma-family models may use LTEngine's built-in turn-format fallback when their embedded template cannot be applied.

Model RAM Usage GPU Usage Notes Default
gemma3-1b 1G 2G Good for testing, poor translations
gemma3-4b 4G 4G ✔️
gemma3-12b 8G 10G
gemma3-27b 16G 18G Best translation quality, slowest
gemma4-e4b 5.43 GiB peak TBD 5.15 GB official QAT Q4_0

Gemma 3 table figures are approximate. The measured Gemma 4 value is median peak process RSS on the target T480. See the completed T480 comparison. Gemma 3 4B was retained as default because Gemma 4 showed no reviewed quality gain while using more time, memory, and disk.

Roadmap

See docs/ROADMAP.md for the public roadmap. Maintainers use docs/PRIMARY_TODO.md for milestone detail and docs/TODO.md for ready work.

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines on pull requests, code style, and local quality gates.

Credits

This work is largely possible thanks the official llama-cpp-2 Rust bindings to llama.cpp.

License

GNU Affero General Public License v3

Trademark

See Trademark Guidelines

About

Local AI Machine Translation. Powered by LLMs. LibreTranslate compatible. Maintaining attempt-fork.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages