DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to use the API inside a browser translation extension with Index Translate

Run a local bridge so Immersive Translate can translate web pages through the free API.

Short answer: Clone the repo with git clone https://github.com/bilibili/Index-Translate and open a terminal in the folder; then run python inference/llm/call_api.py --serve to start the local bridge proxy; in Immersive Translate, set Service to Custom / OpenAI and API URL to http://127.0.0.1:8080/v1. All steps.

  • Content
  • Intermediate
  • 30 minutes
  • From the README
  • Any agent

Who it is forA reader who browses foreign-language pages and uses a browser extension such as Immersive Translate.

The problemBrowser extensions cannot always reach the API directly because of CORS and WAF headers, so the extension needs a local bridge.

The outcomeWeb pages translated in the browser, with requests routed through a local address on your machine.

What you need first

  • Python installed to run inference/llm/call_api.py
  • Internet access to call the free public API at index-translate.bilibili.com
  • A local image file (PNG or JPG) or text you want translated

Steps

  1. Clone the repo with git clone https://github.com/bilibili/Index-Translate and open a terminal in the folder. (inferred, check the README)
  2. Run python inference/llm/call_api.py --serve to start the local bridge proxy.
  3. In Immersive Translate, set Service to Custom / OpenAI and API URL to http://127.0.0.1:8080/v1.
  4. Set Model to Index-Translate-35B-A3B and API Key to any string, such as index, then translate a test page.

Prompt for your agent

Use the repo at https://github.com/bilibili/Index-Translate. Start the local bridge with `python inference/llm/call_api.py --serve` and confirm it listens at http://127.0.0.1:8080/v1. Return the exact extension settings used. Verify that a test request to that address returns a translated response.

Caveat. The bridge only runs while the script is running on your machine, so the extension stops working when you close the terminal.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for bilibili/Index-Translate and "Use the API inside a browser translation extension"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer