Bilibili has open-sourced its translation API, Index-Translate. It works quite well, but directly entering it into plugins like Immersive Translate or Peiduwa (陪读蛙) can cause problems: requests must include a hidden parameter, enable_thinking=false. Without it, the model first outputs a long chain of thought, so the plugin doesn’t receive a translation. Most plugins don’t send this parameter.
So I wrote a local proxy that sits between the plugin and Bilibili and adds the parameter for you.
It has zero dependencies and uses only the Python standard library (3.8+), so you don’t need to pip install anything. It’s open source under the MIT license, but since it runs locally, it may use around 30 MB of memory.
How to use
- Download the repository. On Windows, double-click
setup.bat; it will start automatically, run a self-check, and ask whether you want to enable silent startup at boot (it will restart automatically if the connection drops). On Linux / macOS, use./run.sh installor./run.sh serve. (I haven’t tested the macOS and Linux versions, so please feel free to open an issue if you run into problems qaq) - In the plugin, set the translation service to “Custom / OpenAI-compatible”:
- API URL: http://127.0.0.1:8080/v1
- Model: Index-Translate-35B-A3B (9B and 2B are also available)
- API key: Enter anything, such as
index
Notes
- Translations are sent to Bilibili’s public internet API; the proxy itself does not upload any additional data.
- I mainly use it on Windows. I haven’t tested macOS / Linux yet, so feel free to open an issue if you encounter any problems.
Project: bili-translate-proxy
If you find it useful, I’d be really happy if you gave it a star
(The image was AI-generated to introduce the project’s features and content. If anyone has implemented something similar before, feedback and discussion are welcome.)
