Cloud Native 11 min read

Translate CS Textbooks Instantly with AI: A Hands‑On Higress Cloud‑Native Guide

This guide shows how to use free AI translation tools—Immersive Translate and OpenAI Translator—together with the Higress cloud‑native AI‑proxy plugin, configuring Docker, model mappings, and custom dictionaries to efficiently translate computer‑science textbooks like Rust and Crafting Interpreters, while comparing machine and human translations.

Alibaba Cloud Native
Alibaba Cloud Native
Alibaba Cloud Native
Translate CS Textbooks Instantly with AI: A Hands‑On Higress Cloud‑Native Guide

Background

Technical textbooks in Chinese often suffer from low translation quality because translators may lack deep domain knowledge. Large language models (LLMs) can generate more accurate and fluent translations.

Free Translation Tools

Immersive Translate – Chrome extension that translates PDF, EPUB, and video subtitles in real time. URL: https://immersivetranslate.com OpenAI Translator – Open‑source GitHub project that forwards translation requests to an OpenAI‑compatible endpoint. URL: https://github.com/openai-translator/openai-translator Both tools can be combined with Alibaba Higress AI‑proxy plugin to route requests to low‑cost LLMs such as Qwen‑long or Qwen‑max.

Example: Translating Rust Documentation

The “Understanding Ownership” chapter from The Rust Programming Language was translated using Immersive Translate (LLM‑based) and compared with a community‑maintained Chinese version ( https://github.com/KaiserY/trpl-zh-cn). The LLM output used smoother sentence structures, removed redundant particles, and produced more natural Chinese.

Setting Up Higress AI‑Proxy

Higress runs as a Docker container and maps incoming model names to specific Qwen models.

# Create a working directory
mkdir higress && cd higress
# Run Higress (all‑in‑one image version 1.4.0‑rc.1)
docker run -d --rm --name higress-ai \
  -v ${PWD}:/data \
  -p 8001:8001 -p 8080:8080 \
  -e CONFIG_TEMPLATE=ai-proxy \
  -e DEFAULT_AI_SERVICE=qwen \
  -e DASHSCOPE_API_KEY="YOUR_API_KEY" \
  higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/all-in-one:1.4.0-rc.1

Default model mapping:

gpt‑4 → qwen‑max

All other models → qwen‑long

Step 0 – Obtain a 通义千问 API Key

Register an Alibaba Cloud account (e.g., via Alipay).

Log in to the DashScope console and create an API key.

Step 1 – Start Higress

Execute the Docker command above. The plugin listens on port 8080 for proxy requests and port 8001 for admin UI.

Step 2.1 – Configure Immersive Translate

In Immersive Translate settings select “OpenAI” as the provider, choose the cheapest model (qwen‑long) and set the custom endpoint to:

http://127.0.0.1:8080/api/openai/v1/chat/completions

No API key is required because Higress forwards the request.

Step 2.2 – Configure OpenAI Translator

Set the provider to OpenAI and change the model to “gpt‑4”. Higress will map this to qwen‑max for higher‑quality translations.

Uploading a Custom Dictionary

Qwen‑long supports file‑upload‑based context. Upload a glossary file to DashScope:

curl --location --request POST 'https://dashscope.aliyuncs.com/compatible-mode/v1/files' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --form 'file=./dict.txt' \
  --form 'purpose="file-extract"'

The response returns an id (e.g., file-fe-xxxxxxx) that must be added to the Higress AI‑proxy configuration:

provider:
  apiTokens:
  - "sk-..."
  modelMapping:
    '*': "qwen-long"
    gpt-4: "qwen-max"
    gpt-4-turbo: "qwen-max"
    gpt-4o: "qwen-max"
  qwenFileIds:
  - "file-fe-xxxxxxx"
  type: "qwen"

After this, translations will incorporate the custom glossary.

Supported Model Providers

通义千问

OpenAI

Azure OpenAI

月之暗面

智谱AI

百川智能

零一万物

Ollama

DeepSeek

Groq

Anthropic Claude

For detailed plugin configuration see the Higress repository:

https://github.com/alibaba/higress/tree/main/plugins/wasm-go/extensions/ai-proxy

Key Takeaways

By combining free LLM‑based translation extensions with the Higress AI‑proxy plugin, users can obtain high‑quality, low‑cost translations of technical documents, attach custom glossaries, and extend the setup to other AI‑driven use cases such as FAQ bots.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Dockercloud-nativeRustOpenAIQwenHigressAI translation
Alibaba Cloud Native
Written by

Alibaba Cloud Native

We publish cloud-native tech news, curate in-depth content, host regular events and live streams, and share Alibaba product and user case studies. Join us to explore and share the cloud-native insights you need.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.