Write in Italian. Think in English (or Spanish, French…). Read in Italian.
pi-translate is a pi extension that silently translates your prompts to a model language of your choice before the LLM sees them, then translates the model's replies back to your source language in the transcript. The original model response is always one keystroke away.
- Prompts go to the model in your chosen language — every user message is translated before it enters the LLM context.
- Replies appear in your source language — assistant messages are translated back at the end of generation.
- Original response on demand — press
Ctrl+Shift+Eto open a native overlay panel with the untouched model output. - Code stays intact — fenced blocks, inline code,
@filereferences, URLs and absolute paths are protected during translation.
# install globally for all pi sessions
pi install npm:pi-translate
# or install only in the current project
pi install -l npm:pi-translatepi downloads the package, adds it to your settings and loads it automatically. Default config is written to ~/.pi/agent/translate.json.
pi -e npm:pi-translateIf you prefer, you can still install directly from GitHub or a local path:
pi install git:github.com/kinderp/pi-translate@v1.0.1
# or
pi install /path/to/pi-translate| Command | What it does |
|---|---|
/translate |
Toggle the whole extension on or off. |
/translate-backend <backend> |
Switch backend: google, mymemory, libretranslate, llm. |
/translate-original |
Open the original model-response overlay panel. |
/translate-model-lang <code> |
Change the language the model reasons in (default en). |
Ctrl+Shift+E |
Same as /translate-original, instant. |
More: /translate-lang, /translate-mode, /translate-protect, /translate-status, /translate-mirror <path>.
When the translated reply is on screen, hit Ctrl+Shift+E:
The panel scrolls with arrow keys / Page Up / Page Down and closes with Esc or q.
~/.pi/agent/translate.json:
{
"enabled": true,
"sourceLang": "it",
"modelLang": "en",
"backend": "google",
"outputMode": "translate",
"protectCode": true,
"showFooterStatus": true,
"originalShortcut": "ctrl+shift+e",
"mirrorFile": "",
"llm": { "provider": "google", "model": "gemini-2.5-flash" }
}| Backend | Notes |
|---|---|
google |
Free client=gtx endpoint, auto-detects source language. Default. |
mymemory |
Free api.mymemory.translated.net. |
libretranslate |
Self-hosted or public instance via LIBRETRANSLATE_URL. |
llm |
Any model registered in pi via modelRegistry. |
By default the model reasons in English ("modelLang": "en"). You can change it with:
/translate-model-lang es # Spanish
/translate-model-lang fr # French
/translate-model-lang de # German- Tasks deeply rooted in another language (literary analysis, legal text, localisation review).
- Working with reference documents that are already in that language.
- Experimenting with multilingual models.
- Coding and technical tasks: most training data, docs and tools are in English.
- Token cost: English is usually the most token-efficient language for LLMs.
- Reasoning quality: instruction following and step-by-step reasoning are generally strongest in English.
For most day-to-day work, leave modelLang as en.
translate(default) — prompts are translated tomodelLang; replies are translated back tosourceLang. Original model response viewable on demand.native— prompts are still translated tomodelLang, but the model is asked to reply directly in your source language. No output flip, no original panel.
Latest: v1.0.1
MIT