76 lines
2.6 KiB
Markdown
76 lines
2.6 KiB
Markdown
# LibreTranslate
|
|
|
|
> Free and Open Source Machine Translation API. Self-hosted, offline capable and easy to setup.
|
|
|
|
<!-- metadata -->
|
|
|
|
* **Maintainer**: [brooke](https://git.coopcloud.tech/Brooke)
|
|
* **Category**: Apps
|
|
* **Status**: 3
|
|
* **Image**: [`libretranslate`](https://hub.docker.com/r/libretranslate/libretranslate), 4, upstream
|
|
* **Healthcheck**: Yes
|
|
* **Backups**: Yes
|
|
* **Email**: N/A
|
|
* **Tests**: Yes
|
|
* **SSO**: Yes (Tinyauth)
|
|
|
|
<!-- endmetadata -->
|
|
|
|
## Quick start
|
|
|
|
* `abra app new libretranslate --secrets`
|
|
* `abra app config <app-name>`
|
|
* `abra app deploy <app-name>`
|
|
|
|
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech).
|
|
|
|
## SSO
|
|
|
|
SSO is provided by Tinyauth, this is best for an environment where you only plan to use the web interface and have no plans to make use of the API.
|
|
|
|
This also requires deploying [Tinyauth](https://git.coopcloud.tech/coop-cloud/tinyauth) and [Traefik](https://git.coopcloud.tech/coop-cloud/traefik).
|
|
|
|
## API Keys
|
|
|
|
Below is a list of commands you can use to generate/remove/view API keys. prefix any of the below commands with `abra app cmd <app-domain> app`
|
|
|
|
```sh
|
|
# Add a key (120 requests/minute by default)
|
|
key_add
|
|
|
|
# Add a key with a custom rate limit
|
|
key_add 60
|
|
|
|
# Add a key with a character limit
|
|
key_add 120 5000
|
|
|
|
# Remove a key
|
|
key_remove "api-key"
|
|
|
|
# View all keys
|
|
keys_view
|
|
```
|
|
|
|
## Metrics
|
|
|
|
Metrics are exported Prometheus-compatible, in this recipe they also require a key.
|
|
|
|
Once you set `METRICS` to `true` you can use `https://<app-domain>/metrics` in your `prometheus.yml` and `SECRET_METRICS_AUTH_TOKEN` which was generated when you setup the app.
|
|
|
|
## Selecting Languages
|
|
|
|
By default [all available languages](https://www.argosopentech.com/argospm/index/) are loaded. Even though the Argo Translate models are very efficient they are too large to include in the image.
|
|
|
|
Expect `All` languages to take up between 8-10 GB of storage space. Depending on the host this can take between 10-20 minutes to setup.
|
|
|
|
If you choose to load languages individually keep in mind there's no one "language file" each Argos model is a from *and* to model. So, if you set `LANG` to `en,es` you will need both the *from* `es` and *to* `es` model files. So two languages will require two model files, 3 languages will require 6 model files.
|
|
|
|
## Backups
|
|
|
|
Backups only preserve API keys for the purpose of ensuring authentication stays consistent across restorations.
|
|
|
|
## Further reading
|
|
|
|
Please refer to https://docs.libretranslate.com/
|
|
|
|
For an incomplete list of projects that the LibreTranslate API will work with see https://docs.libretranslate.com/guides/integrations/ |