ð LibreTranslate Integration
This tutorial is a community contribution and is not supported by the OpenWebUI team. It serves only as a demonstration on how to customize OpenWebUI for your specific use case. Want to contribute? Check out the contributing tutorial.
Overviewâ
LibreTranslate is a free and open-source machine translation API that supports a wide range of languages. LibreTranslate is a self hosted, offline capable, and easy to setup, and unlike other APIs, it doesn't rely on proprietary providers such as Google or Azure to perform translations. Instead, its translation engine is powered by the open source Argos Translate library. You can integrate LibreTranslate with Open WebUI to leverage its machine translation capabilities. This documentation provides a step-by-step guide to setting up LibreTranslate in Docker and configuring the integration within Open WebUI.
Setting up LibreTranslate in Dockerâ
To set up LibreTranslate in Docker, follow these steps:
Step 1: Create a Docker Compose Fileâ
Create a new file named docker-compose.yml
in a directory of your choice. Add the following configuration to the file:
services:
libretranslate:
container_name: libretranslate
image: libretranslate/libretranslate:v1.6.0
restart: unless-stopped
ports:
- "5000:5000"
env_file:
- stack.env
volumes:
- libretranslate_api_keys:/app/db
- libretranslate_models:/home/libretranslate/.local:rw
tty: true
stdin_open: true
healthcheck:
test: ['CMD-SHELL', './venv/bin/python scripts/healthcheck.py']
volumes:
libretranslate_models:
libretranslate_api_keys:
Step 2: Create a stack.env
Fileâ
Create a new file named stack.env
in the same directory as your docker-compose.yml
file. Add the following configuration to the file:
# LibreTranslate
LT_DEBUG="false"
LT_UPDATE_MODELS="true"
LT_SSL="false"
LT_SUGGESTIONS="false"
LT_METRICS="false"
LT_HOST="0.0.0.0"
LT_API_KEYS="false"
LT_THREADS="12"
LT_FRONTEND_TIMEOUT="2000"
Step 3: Run the Docker Compose Fileâ
Run the following command to start the LibreTranslate service:
docker-compose up -d
This will start the LibreTranslate service in detached mode.
Configuring the Integration in Open WebUIâ
Once you have LibreTranslate up and running in Docker, you can configure the integration within Open WebUI. There are several community integrations available, including:
- LibreTranslate Filter Function
- LibreTranslate Action Function
- MultiLanguage LibreTranslate Action Function
- LibreTranslate Filter Pipeline
Choose the integration that best suits your needs and follow the instructions to configure it within Open WebUI.
Supported languages for the LibreTranslate pipeline & function: Really just all the languages that can be found within LibreTranslate, but here is the list:
Albanian, Arabic, Azerbaijani, Bengali, Bulgarian, Catalan, Valencian, Chinese, Czech, Danish, Dutch, English, Flemish, Esperanto, Estonian, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Indonesian, Irish, Italian, Japanese, Korean, Latvian, Lithuanian, Malay, Persian, Polish, Portuguese, Romanian, Moldavian, Moldovan, Russian, Slovak, Slovenian, Spanish, Castilian, Swedish, Tagalog, Thai, Turkish, Ukrainian, Urdu
Troubleshootingâ
- Make sure the LibreTranslate service is running and accessible.
- Verify that the Docker configuration is correct.
- Check the LibreTranslate logs for any errors.
Benefits of Integrationâ
Integrating LibreTranslate with Open WebUI provides several benefits, including:
- Machine translation capabilities for a wide range of languages.
- Improved text analysis and processing.
- Enhanced functionality for language-related tasks.
Conclusionâ
Integrating LibreTranslate with Open WebUI is a straightforward process that can enhance the functionality of your Open WebUI instance. By following the steps outlined in this documentation, you can set up LibreTranslate in Docker and configure the integration within Open WebUI.