Run LibreTranslate Locally

Nuvi wants quick, private translations—so you’ll host the translation “brain” right on your machine.

1. Add it to requirements.txt

Open your project’s requirements.txt and add (or confirm these lines are present):

libretranslate
requests

Save the file.

Install using the VS Code terminal

To open the terminal you can:

  1. Make sure your virtual environment is selected (look for .venv in the bottom status bar). If not, select it.
  2. Open a new terminal in VS Code (Ctrlxd+` ).
  3. Run:
pip install -r requirements.txt
  1. Wait for the install to finish without errors.
  2. (Optional) List installed packages to verify:
pip show libretranslate

2. Run LibreTranslate Locally

Start the server in the terminal (keep this window open while you test):

libretranslate --load-only en,es

This will start the server with support for translating English and Spanish—the two languages Nuvi wants to support first.

The first time running it may download language data. That can take a few minutes.

LibreTranslate starting

Once it’s finished, open a browser to:

http://127.0.0.1:5000

You should see a simple page. To see languages the server supports, visit:

http://127.0.0.1:5000/languages

xdxd

3. Troubleshooting

ProblemFix
No module named libretranslateEnsure your terminal shows the (.venv) text or ask an adult for help.
Server starts then quitsRead the error text; reinstall or try again.
Can’t open 127.0.0.1:5000Make sure the server is still running; check firewall.
First translation slowModels still loading. Wait a bit.
Output is empty / weirdMake sure you used POST with keys: q, source, target, format.
Port already in useUse a different one: python -m libretranslate --port 5001 and update the URL.