{"id":31619757,"url":"https://github.com/mouuff/gosubai","last_synced_at":"2025-10-06T14:39:51.058Z","repository":{"id":315046962,"uuid":"1039200015","full_name":"mouuff/GoSubAI","owner":"mouuff","description":"AI-powered subtitle translator written in Go","archived":false,"fork":false,"pushed_at":"2025-09-21T21:24:38.000Z","size":2343,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-24T19:28:46.345Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mouuff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-16T17:34:59.000Z","updated_at":"2025-09-21T21:24:12.000Z","dependencies_parsed_at":"2025-09-16T12:40:22.341Z","dependency_job_id":"eeb7e4e5-4619-4317-983c-e5a452d1bf97","html_url":"https://github.com/mouuff/GoSubAI","commit_stats":null,"previous_names":["mouuff/gosubai"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mouuff/GoSubAI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mouuff%2FGoSubAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mouuff%2FGoSubAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mouuff%2FGoSubAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mouuff%2FGoSubAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mouuff","download_url":"https://codeload.github.com/mouuff/GoSubAI/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mouuff%2FGoSubAI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278627394,"owners_count":26018321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-06T14:39:49.418Z","updated_at":"2025-10-06T14:39:51.050Z","avatar_url":"https://github.com/mouuff.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# GoSubAI\nGoSubAI is an AI-powered subtitle translator built in Go.\n\nYou can define custom prompts, select the output format, and choose which LLM to run it on.\nIt even lets you adjust the color scheme and display both the original and translated subtitles side by side.\n\nI originally built it as a tool for language learning-customizable prompts make it easy to guide the translation style.\nFor instance, you can ask for more literal translations.\n\n### Features:\n- **Configurable Automation**: Define your own prompts to process subtitles.\n- **Context aware**: You have the ability to create prompts that consider previous title sentences for a more coherent translation.\n- **Modularity**: Choose your preferred AI model.\n- **Remote and local**: You have the option to run the LLM either on your local device or remotely hosted.\n- **SRT support**: Easily import \u0026 export subtitles to SRT format.\n\n## Project Status\n\nIt was built over a few days but is designed to be modular and extendable, allowing for future enhancements and integrations.\n\nYou can easily set up and run this project entirely locally.\n\n## Example Results\n\nBelow is an example of a before / after running GoSubAI with an example configuration:\n\n![Example Result](images/demo_1.png)\n\n## Prerequisites\n\nBefore using GoSubAI, ensure you have the following installed:\n\n- **Golang**: Download and install Golang from [the official website](https://golang.org/dl/).\n- **Ollama**: Download and install Ollama from [Ollama's website](https://ollama.com/).\n\nTo run Ollama in server mode, use the following command:\n\n```sh\nollama serve\n```\n\n## Example Commands\n\n### Generate subtitles\n\nTo produce subtitles, it's essential to specify a configuration that outlines the process to be executed on the subtitle files.\nAdditionally, provide a SubRip (SRT) file containing the subtitles.\n\nTry running this example command from the root of the repository:\n\n```sh\ngo run ./cmd/GoSubAI generate -config ./config/translate_to_eng.json -input ./data/HVOR_BLIR_DET_AV_PENGA.srt\n```\n\nYou can also try this setup, which includes context in the translation and often leads to better results:\n\n```sh\ngo run ./cmd/GoSubAI generate -config ./config/translate_to_eng_with_context.json -input ./data/HVOR_BLIR_DET_AV_PENGA.srt\n```\n\n### Run Unit Tests\n\nTo run unit tests, use the following command:\n\n```sh\ngo clean -testcache; go test ./...\n```\n\n## Example configuration\n\nThe following configuration will include the original text as well as the translated text:\n\n```json\n{\n  \"HostUrl\": \"default\",\n  \"Model\": \"mistral\",\n  \"PropertyName\": \"translated_text\",\n  \"SystemPrompt\": \"You are a subtitle translation assistant. Your only task is to translate subtitles into the target language specified by the user. Subtitles may contain incomplete sentences-when that happens, translate them literally without trying to complete or alter their meaning. Always keep the translation faithful to the original text and do not add explanations or extra words.\",\n  \"Prompt\": \"Translate this to english: '{TEXT}'\",\n  \"Template\": \"{TEXT}\\n----\\n{GENERATED_TEXT}\",\n  \"Debug\": true\n}\n```\n\nIf you only want to include the translation you can change the `Template` to `\"Template\": \"{GENERATED_TEXT}\"`.\n\nFor some subtitles, it can be useful to include context from the previous line.\nHere’s an example configuration that does this:\n\n```json\n{\n  \"HostUrl\": \"default\",\n  \"Model\": \"llama3.2\",\n  \"PropertyName\": \"translated_text\",\n  \"SystemPrompt\": \"You are a subtitle translation assistant. Translate subtitles into the target language specified by the user.\\n\\n- Translate the text literally.\\n- Do not add, remove, or guess words.\\n- If the text is incomplete, translate it as-is.\\n\\n⚠️ Very important: The tag ##TAG## must always be copied exactly, in the same position.\\n- Never remove it.\\n- Never move it.\\n- Never translate it.\\n- Output is invalid if ##TAG## is missing or changed.\\n\\n### Examples\\n\\nInput: \\\"Bonjour##TAG##comment tu vas aujourd'hui?\\\"\\nOutput: \\\"Hello##TAG##how are you today?\\\"\\n\\nInput: \\\"##TAG##Oui, j'arrive.\\\"\\nOutput: \\\"##TAG##Yes, I'm coming.\\\"\\n\\nInput: \\\"Non##TAG##pas du tout.\\\"\\nOutput: \\\"No##TAG##not at all.\\\"\",\n  \"Prompt\": \"Translate this to english: '{PREVIOUS_TEXT} ##TAG## {TEXT}'\",\n  \"Template\": \"{TEXT}\\n----\\n{GENERATED_TEXT}\",\n  \"Regex\": \"##TAG##(.*)\",\n  \"RegexRetryLimit\": 25,\n  \"Debug\": true\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmouuff%2Fgosubai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmouuff%2Fgosubai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmouuff%2Fgosubai/lists"}