Cerlancism/chatgpt-subtitle-translator
Token efficient translation tool based on ChatGPT or any OpenAI compatible LLM chat completion API
What it solves
Translating SRT subtitle files using LLMs often results in inconsistent output, where the model fails to maintain the original line-by-line structure or timing. This tool solves that by enforcing strict input-to-output matching, ensuring that translated subtitles remain perfectly synchronized with the original video timing.
How it works
The utility processes subtitles by stripping away unnecessary SRT overhead and grouping text into optimized batches to save on token costs. It uses structured output formats (like JSON arrays or objects) to force the AI to return translations that correspond exactly to the input lines. For more complex needs, an "Agent Mode" performs a multi-pass process: it first analyzes the file to understand context, tone, and characters before generating a refined translation instruction for the final pass.
Who it’s for
This tool is for developers, translators, or content creators who need to automate high-quality, context-aware subtitle translation while maintaining strict timing and formatting requirements.
Highlights
- Supports both a Web UI and a Command Line Interface (CLI).
- Compatible with OpenAI API and other compatible providers like local Ollama instances.
- Includes advanced features like prompt caching, progress resumption, and automatic batch size adjustment to stay within token limits.
- Offers specialized structured output modes, including a timestamp-aware mode that allows the model to intelligently merge or adjust entries while preserving timing.
- Provides an optional moderation check to prevent token wastage on content the model might refuse to translate.
Related
- Project
- Project
- Project
- Project
- Project