loqi helps you produce local translation drafts using LLMs via Ollama or llama.cpp. All data stays on your machine.
Why Loqi
Built for people who work with text, docs and code without pasting sensitive content into third-party services.
Every translation runs entirely via Ollama on your machine. No data sent to Google, DeepL or anyone else.
Works in shell scripts and pipelines. Pipe stdin, redirect stdout, integrate into CI or build tools.
Batch-translate JSON locale files preserving structure or entire markdown and plain text files in one pass.
Interactive terminal UI with live auto-translate or one-shot commands directly from your shell.
Flexible settings resolved dynamically from YAML config, environment variables, or CLI flags. Check ~/.config/loqi/config.yaml
Works with Ollama or llama.cpp. Use any model: gemma, phi, qwen and more. Switch per-command or set a default in config.
Usage
Interactive terminal UI with auto-translate as you type. Best for exploratory translation sessions.
$ loqi
Keyboard shortcuts
| Key | Action |
|---|---|
| Tab / Shift+Tab | Cycle focus |
| โ โ | Change language |
| Ctrl+Y | Copy to clipboard |
| Ctrl+L | Clear input/output |
| Ctrl+T | Swap languages |
| Ctrl+C / Esc | Quit |
One-shot translation from the command line. Supports strings, stdin and files.
# Translate a string $ loqi translate --from en --to fr "Hello world" # Pipe from stdin $ echo "Hello world" | loqi translate --from en --to fr # Translate a file $ loqi translate --from auto --to en ./document.md # Choose a specific model $ loqi translate --model phi4-mini:latest --from fr --to en "Bonjour le monde"
Translate JSON or text files in one pass. Format is auto-detected: JSON preserves structure, only values are translated.
# Translate all string values in a JSON file $ loqi batch --from en --to es locales/en.json > locales/es.json # Translate a markdown file $ loqi batch --from en --to fr README.md # Pipe JSON from stdin $ echo '{"msg": "Hello"}' | loqi batch --from en --to es
Configuration
--config <path> flagLOQI_CONFIG environment variable~/.config/loqi/config.yaml (default path)
# Ollama (default) backend: type: ollama model: gemma4:e2b-it-qat base_url: http://localhost:11434 options: temperature: 0.0 num_predict: 2048 # llama.cpp (auto-start with GGUF) # backend: # type: llamacpp # model: gemma-3-1b-it # base_url: http://localhost:8080 # model_path: /path/to/model.gguf # server_args: ["--ctx-size", "8192", "--ngl", "99"]
Installation
Requires Go 1.26+ and Ollama (default) or llama.cpp with a model loaded.
# Pull a model first or let loqi download a model $ ollama pull gemma3:1b # Install Loqi $ go install github.com/danterolle/loqi@latest # Launch $ loqi
$ git clone https://github.com/danterolle/loqi $ cd loqi $ make build $ make run ARGS="--model phi4-mini:latest"