Build a Local Subtitle Translation Agent with AI, Step by Step
This post walks you through building a subtitle translation Agent from scratch with a Vibe Coding mindset, covering everything from planning and implementation to debugging and Docker deployment.

I recommend reading this on a computer — bookmark it and open it on your desktop.
This post walks you through building a subtitle translation Agent from scratch with a Vibe Coding mindset, covering the whole process from planning and implementation to debugging and Docker deployment.
As for why not just call a translation API for this translation task: the reason is that we can't feed an entire film to a large language model, and a traditional translation API most likely can't translate accurately based on context. Besides, this simple requirement also makes it a good way to quickly get a feel for Agent development.
This build uses the following tools:
- A computer with LM Studio installed to provide a local model service;
- OpenCode TUI / desktop app;
- The official or a third-party Deepseek V4 Pro API;
- GitHub, for managing code — essential for fixing code.
- Superpowers, a coding tool / Skill collection; optional — without it, Plan mode is enough.
Here I'm using a fully open-source setup of Deepseek V4 Pro + OpenCode desktop. You can also use a better model or tool, but in my own experience Deepseek V4 Flash needs more rounds of debugging.
Some related background material is listed at the end of the post.
1. Environment and Tool Preparation
Create a project called trans-agent on Github; fill in the project settings yourself or just keep the defaults.

Create a new folder, trans-agent, then open it in OpenCode with "Open Project" and let the AI link the project up for you.
Please link the current project to the Github project; if SSH is supported, use the SSH link. The Github project address is: the Github URL of the project you just created,
If SSH isn't configured on the computer, an HTTPS link will be used, but then you'll need to log in every time you push to Github.
2. Planning the Project
Start a new conversation and switch to Plan mode.
Enter the project prompt:

Develop a subtitle translation tool:
Input: the user can select/drag in a subtitle file, then choose a local model and start
Output: support configuring multiple target languages; the user can export files in several formats, and finally package everything into a Zip for download
Technical details: use a local web service, support local Docker deployment. The local model supports LM Studio; call the local model with a ReAct loop mechanism.
As a tool for daily use, my thinking was this:
- Web service development technology is more mature, and it can also be used across multiple platforms/computers within the local network.
- Local Docker deployment support is for starting on boot, with no manual execution needed.
- For the local model service I chose LM Studio, which is the most widely used and has clearer logs. Best to set it to start on boot as well.
These technical details can all be adjusted according to the tools you have locally. But "call the local model with a ReAct loop mechanism" cannot be left out.
Diagram of the ReAct loop mechanism:

After every call to the large model, this mechanism checks for itself whether the result meets the requirements; if not, it keeps executing until all the content meets them.
During planning, the AI will ask you some questions. If you're not sure, you can ask the AI back what options there are, and it will offer several for you to choose from.
You can just go with whatever the AI recommends — that's what most non-programmers do.

My recommended frontend stack: Node.js full stack; storage: SQLite; page style: modern SaaS style. As for subtitle format, choose the commonly used SRT; if you're worried about special requirements later, selecting everything is fine too.
These details don't affect whether you can ultimately produce a finished product, because models of this generation all have a certain amount of Agent development ability.
It may also ask you which stages the AI Agent running the ReAct loop should take part in; choose as needed. I select all: it uses the three-step "literal translation – reflection – refinement" translation method advocated by Andrew Ng, it also guesses at the plot to get context, and it unifies the translation across the whole text.

For all of the above, every model and tool will give you different prompts — just choose according to your actual situation.
Once you've made your choices, an architecture diagram, data model, and page design will appear, more or less the same everywhere.

You only need to confirm the parts we can understand. For example: the page architecture and the UI design can be adjusted to your personal taste. Of course, you can also wait until the actual interface is out and adjust it then.
3. Execution Plan
Once planning is done, switch to Build mode and let the AI start implementing the plan.
Here you can see OpenCode show a task list, working through the items one by one. Because OpenCode doesn't grant overly high permissions, you still need to manually authorize every step of the execution.

After about half an hour, the project's first development pass is done.
Let the AI run the project for us; at this point the AI's reply will contain a localhost link. Click it and you'll see the project results.

Barring surprises, a page like this will appear:

If you need local deployment, you can likewise have the AI start the local Docker for you. That way, when you boot the machine, this translation service starts by default. No need to open the project and run the local service every time.
4. Debugging and Optimization
Debugging a web app mainly involves four areas:
- Browser errors
Open the browser; if the page doesn't display properly, whatever the page shows is the error message — things like "This site can't be reached".
- Project frontend errors
If the page doesn't display properly or operations are sluggish, it's most likely a frontend problem. In that case right-click, choose Inspect, and you'll see the specific error on the Console tab.

- Project backend errors
For backend errors: if, like me, you chose a Nodejs full stack earlier, you can see backend errors in the bottom-left corner of the page. Click the red Nextjs logo and you'll see the error details.

With other frameworks you may need to look in the terminal where you started the service.
- Large model errors
Open LM Studio; you can view the model's output in the Developer log under the Developer Tab.

Copy these errors to OpenCode and let the AI troubleshoot them for you.
The problems I ran into here were:
-
The page wouldn't open; OpenCode restarted the backend service and fixed it.
-
The console showed a page rendering error; OpenCode fixed it easily.
-
After selecting Qwen under LM Studio, it couldn't get the correct data. I threw the LM Studio logs at OpenCode, which worked out that Qwen's content was always in reasoning content rather than content, causing an infinite loop / the content being unreadable. Switching to a better model, or choosing to read the reasoning content, solved it.

Finally comes optimization, which you can do however you like. For example, I had it support multiple languages in the interface too, exposed the prompt so users can modify it, added support for the OpenAI and Anthropic APIs, and finally added Google Translate as a fallback, making the overall solution more complete.
If you want to see the finished product, you can get it on Github:
https://github.com/dcchanInSz/ai-srt-translate
Summary
With AI Coding tools, AI Agent development is not as hard as you'd imagine!
This translation Agent can quickly help you understand the ReAct loop mechanism of AI Agents and complete one round of AI Agent development. Afterwards, you can learn more about Agent development according to your own needs.
In short, roll up your sleeves and get to work! AI Agent development is the best direction for programmers right now.
Some related background knowledge:
Environment issues:
GitHub clone hangs, pip gets stuck, brew spins forever? One guide to fix it all
Using OpenCode:
After a week of trying opencode, I threw out Claude Code (with an opencode installation guide)
For GitHub basics you can refer to:
An AI Agent and Git Collaboration Guide: From Code to Documentation