Skip to content

Translation Engine

umlx5h edited this page May 24, 2025 · 21 revisions

LLPlayer supports multiple translation engines. Each engine is explained below.

Normal Translation Engine

It is a normal translation API, sending subtitles one by one, so accuracy is low, but it works fast and very stable.

Google V1

Accuracy (A-E) Speed (A-E) Price Local / Remote
D A Free Remote

Google Translation V1: https://translate.googleapis.com

Translation accuracy is not good, but it is free and very fast.

DeepL

Accuracy Speed Price Local / Remote
C B Free or Paid Remote

DeepL: https://www.deepl.com

API key is required with registered account. A certain amount of usage per month is free of charge.

DeepLX

Accuracy Speed Price Local / Remote
C B Free Remote

DeepLX: https://github.com/OwO-Network/DeepLX

LLM Translation Engine

This is a chat-style API.
It can retain the context of the subtitles, so the translation is more accurate than normal APIs.
However, it is not stable.

Ollama

Accuracy Speed Price Local / Remote
A - D B - E Free Local

Ollama: https://ollama.com

It is an LLM engine that runs locally.
Since the AI is run locally, a significant CPU and GPU are required to use it comfortably.
The amount of memory is important for a GPU.

Not recommended for AMD GPUs as Vulkan is not available.

The server must be up and running and the model must be downloaded in the command line.

Recommended Models

Setup Overview

  1. Install Ollama
  2. Download Model from Powershell
$ ollama pull aya-expanse
$ ollama pull gemma3
  1. Setup Ollama server by launching from GUI or Powershell
# if you need detail log information such as GPU usage
$ $env:OLLAMA_DEBUG=1
$ ollama serve 
  1. (LLPlayer) Setup Ollama endpoint and model in Subtitles -> Translate section
  2. (LLPlayer) Clicking Hello API button to test API
  3. (LLPlayer) Enable translation from the subtitle button in seek bar
  4. Ollama's response time can be checked from the console when started with ollama serve.

Tips

Ollama is officially provided only as an API and CLI.
If you want a GUI like LM Studio for testing, you will need to install a separate tool.

Recommended GUIs

LM Studio

Accuracy Speed Price Local / Remote
A - D B - E Free Local

LM Studio: https://lmstudio.ai

It is an LLM engine that runs locally.
Since the AI is run locally, a considerable CPU and GPU are required to use it comfortably.
The amount of memory is important for a GPU.

Both CUDA and Vulkan are available.

The server must be up and running and the model must be downloaded in the GUI.

Recommended Models

Setup Overview

  1. Install LM Studio
  2. Download Model from GUI or Powershell
$ lms get aya-23-8b
  1. Setup LM Studio API from GUI

You don't need to select model from GUI.
You may need to change default port 1234 to some number.

LM Studio

  1. Do same steps as Ollama

KoboldCpp

Accuracy Speed Price Local / Remote
A - D B - E Free Local

KoboldCpp: https://github.com/LostRuins/koboldcpp

It is an LLM engine that runs locally.

Both CUDA and Vulkan are available.

The server must be up and running and the GGUF model must be loaded in the GUI.

OpenAI

Accuracy Speed Price Local / Remote
A C Paid Remote

OpenAI API: https://openai.com/index/openai-api

API key is required with registered account.
Billing is required to use the service.

It can translate with very high accuracy.

OpenAI Like

This can be used when using any OpenAI compatible API.

Claude

Accuracy Speed Price Local / Remote
A C Paid Remote

Anthropic Claude API: https://www.anthropic.com/api

API key is required with registered account.
Billing is required to use the service.

It can translate with very high accuracy.

LiteLLM

LiteLLM: https://docs.litellm.ai/docs/

LiteLLM provides an OpenAI-compatible proxy to any LLM API.
OpenAI non-compatible APIs such as Gemini and Grok can be used via proxy.

Supported LLM API: https://docs.litellm.ai/docs/providers
How to setup LiteLLM Proxy: https://docs.litellm.ai/docs/simple_proxy

LLM Translation Tips

What is the context-aware translation?

Each piece of subtitle data is independent. If these are translated by API one by one, the translation will inevitably be inaccurate because the context of the entire subtitle is not taken into account.

If a sentence is cut off in the middle, the translation will be particularly inaccurate.

It's very difficult to solve this problem with the normal translation API, but LLM can increase accuracy by sending multiple previous subtitles to the chat simultaneously, rather than sending them one by one.

The actual API call now works as follows.

$ curl http://localhost:11434/api/chat -d '{
  "model": "aya-expanse:latest",
  "messages": [
    {
      "role": "system",
      "content": "I will send the text of the subtitles for the video one at a time. Please translate the text while taking into account the context of the previous text.\nTranslate from English to Japanese."
    },
    {
      "role": "user",
      "content": "Chris Anderson: This is such a strange thing."
    },
    {
      "role": "assistant",
      "content": "クリス・アンダーソン:これって、本当に変なことだよね。"
    },
    {
      "role": "user",
      "content": "Your software, Linux, is in millions of computers,"
    },
    {
      "role": "assistant",
      "content": "あなたのソフトウェア、Linuxは何百万人ものコンピュータにインストールされていますが、"
    },
    {
      "role": "user",
      "content": "it probably powers much of the Internet."
    }
  ],
  "stream": false
}'

{
  "model": "aya-expanse:latest",
  "created_at": "2025-04-01T01:03:22.4755695Z",
  "message": {
    "role": "assistant",
    "content": "それはおそらくインターネットの大半を動かしているでしょう。"
  },
  "done_reason": "stop",
  "done": true,
  "total_duration": 1201720300,
  "load_duration": 26240300,
  "prompt_eval_count": 148,
  "prompt_eval_duration": 350339700,
  "eval_count": 15,
  "eval_duration": 822862100
}

From Subtitles > Translate section in settings, if Translate Chat Method is set to KeepContext, the translation will be done while preserving context.

But be careful with paid LLMs, as more tokens will be consumed.
The number of subtitles sent simultaneously can be adjusted in the settings.

Clone this wiki locally