[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-machinewrapped--llm-subtrans":3,"tool-machinewrapped--llm-subtrans":64},[4,17,27,35,44,52],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",152630,2,"2026-04-12T23:33:54",[13,14,15],"开发框架","Agent","语言模型","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":10,"last_commit_at":23,"category_tags":24,"status":16},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[25,14,26,13],"插件","图像",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":10,"last_commit_at":33,"category_tags":34,"status":16},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[25,13],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":41,"last_commit_at":42,"category_tags":43,"status":16},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,3,"2026-04-06T11:19:32",[15,26,14,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":10,"last_commit_at":50,"category_tags":51,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,15],{"id":53,"name":54,"github_repo":55,"description_zh":56,"stars":57,"difficulty_score":10,"last_commit_at":58,"category_tags":59,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",85092,"2026-04-10T11:13:16",[26,60,61,25,14,62,15,13,63],"数据工具","视频","其他","音频",{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":70,"readme_en":71,"readme_zh":72,"quickstart_zh":73,"use_case_zh":74,"hero_image_url":75,"owner_login":76,"owner_name":77,"owner_avatar_url":78,"owner_bio":77,"owner_company":77,"owner_location":77,"owner_email":77,"owner_twitter":77,"owner_website":77,"owner_url":79,"languages":80,"stars":93,"forks":94,"last_commit_at":95,"license":96,"difficulty_score":10,"env_os":97,"env_gpu":98,"env_ram":99,"env_deps":100,"category_tags":105,"github_topics":77,"view_count":10,"oss_zip_url":77,"oss_zip_packed_at":77,"status":16,"created_at":106,"updated_at":107,"faqs":108,"releases":138},7007,"machinewrapped\u002Fllm-subtrans","llm-subtrans","Open Source project using LLMs to translate subtitles (SRT, SSA\u002FASS, VTT)","llm-subtrans 是一款开源字幕翻译工具，利用大语言模型（LLM）自动将 SRT、SSA\u002FASS 及 VTT 格式的字幕文件在多种语言间进行互译。它主要解决了传统机器翻译在处理字幕时语境缺失、句式生硬的问题，借助先进的 AI 模型显著提升了翻译的流畅度与自然感，同时通过插件化架构灵活支持多种主流字幕格式。\n\n这款工具非常适合需要频繁处理多语言视频内容的普通用户、字幕组志愿者以及影视创作者。对于希望自定义工作流的开发者或技术人员，它也提供了命令行模式和源码安装选项，便于集成到自动化流程中。用户无需具备深厚的编程背景，下载预编译包即可在 Windows 或 macOS 上通过图形界面轻松上手。\n\nllm-subtrans 的独特亮点在于其开放的模型接入能力。它不仅支持 Google Gemini、OpenAI GPT 等知名模型，还能通过 OpenRouter 聚合平台调用数百种不同的大模型，让用户根据成本、速度或特定语言优势自由选择最佳翻译引擎。此外，项目还提供了一个基于 Gemini 的免费网页版供轻度用户使用。需要注意的是，由于翻译过程需联网并将内容发送至服务商服务器，使用时","llm-subtrans 是一款开源字幕翻译工具，利用大语言模型（LLM）自动将 SRT、SSA\u002FASS 及 VTT 格式的字幕文件在多种语言间进行互译。它主要解决了传统机器翻译在处理字幕时语境缺失、句式生硬的问题，借助先进的 AI 模型显著提升了翻译的流畅度与自然感，同时通过插件化架构灵活支持多种主流字幕格式。\n\n这款工具非常适合需要频繁处理多语言视频内容的普通用户、字幕组志愿者以及影视创作者。对于希望自定义工作流的开发者或技术人员，它也提供了命令行模式和源码安装选项，便于集成到自动化流程中。用户无需具备深厚的编程背景，下载预编译包即可在 Windows 或 macOS 上通过图形界面轻松上手。\n\nllm-subtrans 的独特亮点在于其开放的模型接入能力。它不仅支持 Google Gemini、OpenAI GPT 等知名模型，还能通过 OpenRouter 聚合平台调用数百种不同的大模型，让用户根据成本、速度或特定语言优势自由选择最佳翻译引擎。此外，项目还提供了一个基于 Gemini 的免费网页版供轻度用户使用。需要注意的是，由于翻译过程需联网并将内容发送至服务商服务器，使用时请留意相关隐私政策及区域限制。","# LLM-Subtrans\nLLM-Subtrans is an open source subtitle translator that uses LLMs as a translation service. It can translate subtitles between any language pairs supported by the language model.\n\nThe application supports multiple subtitle formats through a pluggable system. Currently `.srt`, `.ssa`\u002F`.ass` and `.vtt` files are supported.\n\nNote: LLM-Subtrans requires an active internet connection. Subtitles are sent to the provider's servers for translation, so their privacy policy applies.\n\n## Installation\nFor most users the packaged release is the easiest way to use the program. Download a package from [the releases page](https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fllm-subtrans\u002Freleases), unzip to a folder and run `gui-subtrans`. You will be prompted for some basic settings on first run.\n\nIf you want to use the command line tools, modify the code or just prefer to have more control over the setup you will need to [install from source](#installing-from-source).\n\n### Windows\nEvery release is packaged for Windows as (**gui-subtrans-x.x.x.zip**).\n\n### MacOS\nPackaged builds are (usually) provided for MacOS with Apple Silicon (**gui-subtrans-x.x.x.macos-arm64.zip**). If you have an Intel Mac you will need to [install from source](#installing-from-source).\n\n### Linux\nPrebuilt Linux packages are not provided so you will need to [install from source](#installing-from-source).\n\n### LLM-Subtrans Web\nThe Gemini-powered [LLM-Subtrans Web](https:\u002F\u002Ftinyurl.com\u002Fllm-subtrans-web) is free to use, but since it costs _me_ money it now requires a registered email address, and each user is limited to 2 translations per day.\n\n## Translation Providers\n\n### OpenRouter\nhttps:\u002F\u002Fopenrouter.ai\u002Fprivacy\n\n[OpenRouter](https:\u002F\u002Fopenrouter.ai\u002F) is a service which aggregates [models](https:\u002F\u002Fopenrouter.ai\u002Fmodels) from a wide range of providers. You will need an [OpenRouter API Key](https:\u002F\u002Fopenrouter.ai\u002Fsettings\u002Fkeys) to use the service, and a credit balance (though some quite capable models are provided free of charge).\n\nYou can choose to let OpenRouter select the model automatically (the \"Use Default Model\" setting in the GUI or `--auto` on the command line) or you can specify a specific model. Model preferences can also be specified in the OpenRouter dashboard.\n\nSince hundreds of models are available they are grouped by model family. By default the list of available models is pulled from the \"Translation\" category, though this excludes many models that are perfectly capable of translation (including most free options).\n\n### Google Gemini\nhttps:\u002F\u002Fai.google.dev\u002Fterms\n\n**Please note that regions restrictions may apply: https:\u002F\u002Fai.google.dev\u002Favailable_regions**\n\nGemini 2.5 Flash is perhaps the leading model for translation speed and fluency at time of writing, despite some censorship, and Preview models are often free to use.\n\nYou will need a Google Gemini API key from https:\u002F\u002Fai.google.dev\u002F or from a project created on https:\u002F\u002Fconsole.cloud.google.com\u002F. You must ensure that Generative AI is enabled for the api key and project.\n\nUnfortunately Gemini will refuse to translate content that contains certain words or phrases, even with minimal safety settings. If you hit this you will need to use another provider or split the batch and manually translate the offending lines.\n\n### OpenAI\nhttps:\u002F\u002Fopenai.com\u002Fpolicies\u002Fprivacy-policy\n\nYou will need an OpenAI API key from https:\u002F\u002Fplatform.openai.com\u002Faccount\u002Fapi-keys to use OpenAI's GPT models. If the API key is associated with a free trial the translation speed will be *severely* restricted.\n\nYou can use the custom api_base parameter to access a custom OpenAI instance (or any other OpenAI-compatible endpoint, though the Custom Server option gives you more control).\n\nYou can use an **OpenAI Azure** installation as a translation provider, but this is only advisable if you know what you're doing - in which case hopefully it will be clear how to configure the Azure provider settings.\n\n### DeepSeek\nhttps:\u002F\u002Fplatform.deepseek.com\u002Fdownloads\u002FDeepSeek%20Open%20Platform%20Terms%20of%20Service.html\n\nYou will need a DeepSeek API key from https:\u002F\u002Fplatform.deepseek.com\u002Fapi_keys to use this provider.\n\n- **API Base**: You can optionally specify a custom URL, e.g. if you are hosting your own DeepSeek instance. If this is not set, the official DeepSeek API endpoint will be used.\n\n- **Model**: The default model is `deepseek-chat`, which is recommended for translation tasks. `deepseek-reasoner` may produce better results for source subtitles with OCR or transcription errors as it will spend longer trying to guess what the error is.\n\nDeepSeek is quite simple to set up and offers reasonable performance at a very low price, though translation does not seem to be its strongest point.\n\n### Anthropic\nhttps:\u002F\u002Fsupport.anthropic.com\u002Fen\u002Fcollections\u002F4078534-privacy-legal\n\nYou will need an Anthropic API key from https:\u002F\u002Fconsole.anthropic.com\u002Fsettings\u002Fkeys to use Claude as a provider. Translation is not Claude's strongest suit, and the API is expensive compared to others.\n\nThe API has strict [rate limits](https:\u002F\u002Fdocs.anthropic.com\u002Fclaude\u002Freference\u002Frate-limits) based on your credit tier, both on requests per minutes and tokens per day.\n\n### Mistral\nhttps:\u002F\u002Fmistral.ai\u002Fterms\u002F\n\nYou will need a Mistral API key from https:\u002F\u002Fconsole.mistral.ai\u002Fapi-keys\u002F to use this provider.\n\n- **Server URL**: If you are using a custom deployment of the Mistral API, you can specify the server URL using the `--server_url` argument.\n\n- **Model**: `mistral-large-latest` is recommended for translation. Smaller models tend to perform poorly and may not follow the system instructions well.\n\nMistral AI is straightforward to set up, but its performance as a translator is not particularly good.\n\n### Custom Server\nLLM-Subtrans can interface directly with any server that supports an OpenAI compatible API, including locally hosted models e.g. [LM Studio](https:\u002F\u002Flmstudio.ai\u002F).\n\nThis is mainly for research and you should not expect particularly good results from local models. LLMs derive much of their power from their size, so the small, quantized models you can run on a consumer GPU are likely to produce poor translations, fail to generate valid responses or get stuck in endless loops. If you find a model that reliably producess good results, please post about it in the Discussions area!\n\nChat and completion endpoints are supported - you should configure the settings and endpoint based on the model the server is running (e.g. instruction tuned models will probably produce better results using the completions endpoint rather than chat). The prompt template can be edited in the GUI if you are using a model that requires a particular format - make sure to include at least the {prompt} tag in the template, as this is where the subtitles that need translating in each batch will be filled in!\n\n### Amazon Bedrock\nhttps:\u002F\u002Faws.amazon.com\u002Fservice-terms\u002F\n\n**Bedrock is not recommended for most users**: The setup process is complex, requiring AWS credentials, proper IAM permissions, and region configuration. Additionally, not all models on Bedrock support translation tasks or offer reliable results. Bedrock support will not be included in pre-packaged versions - if you can handle setting up AWS, you can handle installing llm-subtrans [from source](#installing-from-source).\n\nTo use Bedrock, you must:\n  1. Create an **IAM user** or **role** with appropriate permissions (e.g., `bedrock:InvokeModel`, `bedrock:ListFoundationModels`).\n  2. Ensure the model you wish to use is accessible in your selected AWS region and [enabled for the IAM user](https:\u002F\u002Fdocs.aws.amazon.com\u002Fbedrock\u002Flatest\u002Fuserguide\u002Fmodel-access-modify.html).\n\n## Installing from source\nIf you want to use the command line tools or modify the program, you will need to have Python 3.10+ and pip installed on your system, then follow these steps.\n\nClone the LLM-Subtrans repository to your local machine using the following command or your preferred tool:\n\n    ```sh\n    git clone https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fllm-subtrans.git\n    ```\n\n### Setup scripts\n\nThe easiest setup method is to run the unified installation script:\n- **Windows**: Run `install.bat`\n- **MacOS\u002FLinux**: Run `install.sh`\n\nThese scripts will create a virtual environment and offer **install with GUI** or **install command line only** options, with additional options to add support for specific providers. The script will guide you through the setup and generate command scripts to launch the application.\n\nDuring the installing process, you can choose to input an API key for each selected provider when prompted, which will be saved in a .env file so that you don't need to provide it every time you run the program. This is largely redundant if you only plan to use the GUI, as keys can be saved in the app settings.\n\n### Manual configuration\n**If you ran an install script you can skip the remaining steps. Continue reading _only_ if you want to configure the environment manually instead.**\n\n1. Create a new file named .env in the root directory of the project. Add any required settings for your chosen provider to the .env file like this:\n    ```sh\n    OPENROUTER_API_KEY=\u003Cyour_openrouter_api_key>\n    OPENAI_API_KEY=\u003Cyour_openai_api_key>\n    GEMINI_API_KEY=\u003Cyour_gemini_api_key>\n    AZURE_API_KEY=\u003Cyour_azure_api_key>\n    CLAUDE_API_KEY=\u003Cyour_claude_api_key>\n    ```\n\n    If you are using Azure:\n\n    ```sh\n    AZURE_API_BASE=\u003Cyour api_base, such as https:\u002F\u002Fsomething.openai.azure.com>\n    AZURE_DEPLOYMENT_NAME=\u003Cdeployment_name>\n    ```\n\n    If you are using Bedrock:\n    ```sh\n    AWS_ACCESS_KEY_ID=your-access-key-id\n    AWS_SECRET_ACCESS_KEY=your-secret-access-key\n    AWS_REGION=your-region\n    ```\n\n    For OpenAI reasoning models you can set the reasoning effort (default is low):\n    ```sh\n    OPENAI_REASONING_EFFORT=low\u002Fmedium\u002Fhigh\n    ```\n\n2. Create a virtual environment for the project by running the following command in the root folder to create a local environment for the Python interpreter (optional, but highly recommended to avoid dependency conflicts with other Python applications):\n\n    ```sh\n    python -m venv envsubtrans\n    ```\n\n3. Activate the virtual environment by running the appropriate command for your operating system. You will need to do this each time before running the app.\n\n    ```sh\n    .\\envsubtrans\\Scripts\\activate      # Windows\n    source .\u002Fenvsubtrans\u002Fbin\u002Factivate   # Mac\u002FLinux\n    ```\n\n4. Install the project (add the -e switch for an editable install if you want to modify the code):\n\n    ```sh\n    pip install -e .                   # Minimal install of command line tools with support for OpenRouter or Custom Server\n    pip install -e \".[gui]\"            # Core module and default provider with GUI module\n    pip install -e \".[gui,openai,gemini,claude,mistral,bedrock]\"   # Full install with optional providers (delete to taste)\n    ```\n\n## Usage\nThe program works by dividing the subtitles up into batches and sending each one to the translation service in turn. \n\nIt can potentially make many API calls for each subtitle file, depending on the batch size. Speed heavily depends on the selected model.\n\nBy default The translated subtitles will be written to a new file in the same directory with the target langugage appended to the original filename.\n\n### GUI\nThe [Subtrans GUI](https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fllm-subtrans\u002Fwiki\u002FGUI#gui-subtrans) is the best and easiest way to use the program. \n\nAfter installation, launch the GUI with the `gui-subtrans` command or shell script, and hopefully the rest should be self-explanatory.\n\nSee the project wiki for further details on how to use the program.\n\n### Command Line\nLLM-Subtrans can be used as a console command or shell script. The install scripts create a cmd or sh file in the project root for each provider, which will take care of activating the virtual environment and calling the corresponding translation script.\n\nThe most basic usage is:\n```sh\n# Use OpenRouter with automatic model selection\nllm-subtrans --auto -l \u003Clanguage> \u003Cpath_to_subtitle_file>\n\n# Use OpenRouter with a specific model\nllm-subtrans --model google\u002Fgemini-2.5-flash -l \u003Clanguage> \u003Cpath_to_subtitle_file>\n\n# Convert format while translating (ASS to SRT in this example)\nllm-subtrans -l \u003Clanguage> -o output.srt input.ass\n\n# Use any server with an OpenAI-compatible API\nllm-subtrans -s \u003Cserver_address> -e \u003Cendpoint> -k \u003Capi_key> -l \u003Clanguage> \u003Cpath_to_subtitle_file>\n\n# Use specific providers\ngpt-subtrans --model gpt-5-mini --target_language \u003Ctarget_language> \u003Cpath_to_subtitle_file>\ngemini-subtrans --model gemini-2.5-flash-latest --target_language \u003Ctarget_language> \u003Cpath_to_subtitle_file>\nclaude-subtrans --model claude-3-5-haiku-latest --target_language \u003Ctarget_language> \u003Cpath_to_subtitle_file>\n\n# List supported subtitle formats\nllm-subtrans --list-formats\n\n# Batch process files in a folder tree (activate the virtual environment first)\npython scripts\u002Fbatch_translate.py .\u002Fsubtitles .\u002Ftranslated --provider openai --model gpt-5-mini --apikey sk-... --language Spanish\n```\n\nThe output format is inferred from file extensions. To convert between formats, provide an output path with the desired extension.\n\nIf the target language is not specified the default is English.\n\nOther options that can be specified on the command line are detailed below.\n\n## Project File\n\n**Note**: Project files are enabled by default in the GUI.\n\nThe `--project` argument or `PROJECT_FILE` .env setting control whether a project file will be written to disc for the command line.\n\nIf enabled, a file will be created with the `.subtrans` extension when a subtitle file is loaded, containing details of the project. It will be updated as the translation progresses. Writing a project file allows, amongst other things, resuming a translation that was interrupted. It is highly recommended.\n\n```sh\n# Use OpenRouter and create a persistent project\nllm-subtrans --project --auto -l \u003Clanguage> \u003Cpath_to_subtitle_file>\n\n# Use OpenRouter and resume a persistent project\nllm-subtrans --project --auto -l \u003Clanguage> \u003Cpath_to_subtrans_file>\nllm-subtrans --project --auto -l \u003Clanguage> \u003Cpath_to_subtitle_file>  # Project file will be detected automatically if it is in the same folder\n```\n\n## Format Conversion\nLLM-Subtrans is primarily a translation application, and format conversion is probably best handled by dedicated tools, but the option exists to read one format and write another.\n\n```sh\n# Use OpenRouter and convert from .ass to .srt\nllm-subtrans --project --auto -l \u003Clanguage> -o \u003Cpath_to_output_file.srt> \u003Cpath_to_subtitle_file.ass>\n```\n\n## Advanced usage\n\nThere are a number of command-line arguments that offer more control over the translation process.\n\nTo use any of these arguments, add them to the command-line after the path to the source file. For example:\n\n```sh\nllm-subtrans path\u002Fto\u002Fmy\u002Fsubtitles.srt --moviename \"My Awesome Movie\" --ratelimit 10 --substitution cat::dog\n```\n\nDefault values for many settings can be set in the .env file, using a NAME_IN_CAPS format. See Options.py and the various Provider_XXX files for the full list.\n\n- `-l`, `--target_language`:\n  The language to translate the subtitles to.\n\n- `-o`, `--output`:\n  Specify a filename for the translated subtitles.\n\n- `--project`:\n  Read or Write a project file for the subtitles being translated (see above for details)\n\n- `--ratelimit`:\n  Maximum number of requests to the translation service per minute (mainly relevant if you are using an OpenAI free trial account).\n\n- `--moviename`:\n  Optionally identify the source material to give context to the translator.\n\n- `--description`:\n  A brief description of the source material to give further context. Less is generally more here, or the AI can start improvising.\n\n- `--name`, `--names`:\n  Optionally provide (a list of) names to use in the translation (more powerful AI models are more likely to actually use them).\n\n- `--substitution`:\n  A pair of strings separated by `::`, to substitute in either source or translation, or the name of a file containing a list of such pairs.\n\n- `--scenethreshold`:\n  Number of seconds between lines to consider it a new scene.\n\n- `--minbatchsize`:\n  Minimum number of lines to consider starting a new batch to send to the translator.\n  Higher values typically result in faster and cheaper translations but increase the risk of desyncs.\n\n- `--maxbatchsize`:\n  Maximum number of lines before starting a new batch is compulsory.\n  This needs to take into account the token limit for the model being used, but the \"optimal\" value depends on many factors, so experimentation is encouraged.\n  Larger batches are more cost-effective but increase the risk of the AI desynchronising, triggering expensive retries.\n\n- `--preprocess`:\n  Preprocess the subtitles prior to batching.\n  This performs various actions to prepare the subtitles for more efficient translation, e.g. splitting long (duration) lines into multiple lines.\n  Mainly intended for subtitles that have been automatically transcribed with e.g. Whisper.\n\n- `--postprocess`:\n  Post-process translated subtitles.\n  Performs various actions like adding line breaks to long lines and normalising dialogue tags after a translation request.\n\n- `--instruction`:\n  An additional instruction for the AI indicating how it should approach the translation.\n\n- `--instructionfile`:\n  Name\u002Fpath of a file to load AI system instructions from (otherwise the default instructions.txt is used).\n\n- `--maxlines`:\n  Maximum number of batches to process. To end the translation after a certain number of lines, e.g. to check the results.\n\n- `--temperature`:\n  A higher temperature increases the random variance of translations. Default 0.\n\n- `--reload`:\n  Subtitles will be reloaded from the source file rather than using the subtitles saved in the project (note: this implies `--project`)\n\n- `--retranslate`:\n  Existing translations will be ignored and all subtitles will be retranslated (note: this implies `--project`)\n\n- `--reparse`:\n  Existing translations will not be sent to the translator again but the translator's response will be reprocessed to extract the translations.\n  This is mainly useful after a bug fix release, but can also be used to reset translations that have been hand-edited (note: this implies `--project`)\n\n- `--preview`:\n  Subtitles will be loaded and batched and the translation flow will run, but no calls to the translator will be made. Only useful for debug.\n\n### Provider-specific arguments\nSome additional arguments are available for specific providers.\n\n#### OpenRouter\n- `-k`, `--apikey`:\n  Your [OpenRouter API Key](https:\u002F\u002Fopenrouter.ai\u002Fsettings\u002Fkeys) (the app will look for OPENROUTER_API_KEY in the environment if this is not provided)\n\n- `--auto`\n  Automatically select the model to use (selection criteria can be configured in the [OpenRouter Dashboard](https:\u002F\u002Fopenrouter.ai\u002Fsettings\u002Fpreferences))\n\n#### OpenAI\n- `-k`, `--apikey`:\n  Your [OpenAI API Key](https:\u002F\u002Fplatform.openai.com\u002Faccount\u002Fapi-keys) (the app will look for OPENAI_API_KEY in the environment if this is not provided)\n\n- `-b`, `--apibase`:\n  API base URL if you are using a custom instance. if it is not set, the default URL will be used.\n\n- `-httpx`:\n  Use the [HTTPX library](https:\u002F\u002Fgithub.com\u002Fprojectdiscovery\u002Fhttpx) for requests (only supported if apibase is specified)\n\n- `-m`, `--model`:\n  Specify the [AI model](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fmodels) to use for translation\n\n#### Gemini\n- `-k`, `--apikey`:\n  Your [Google Gemini API Key](https:\u002F\u002Faistudio.google.com\u002Fapp\u002Fapikey). (the app will look for GEMINI_API_KEY in the environment if this is not provided)\n\n- `-m`, `--model`:\n  Specify the [AI model](https:\u002F\u002Fai.google.dev\u002Fmodels\u002Fgemini) to use for translation\n\n#### Claude\n- `-k`, `--apikey`:\n  Your [Anthropic API Key](https:\u002F\u002Fconsole.anthropic.com\u002Fsettings\u002Fkeys). (the app will look for ANTHROPIC_API_KEY in the environment if this is not provided)\n\n- `-m`, `--model`:\n  Specify the [AI model](https:\u002F\u002Fdocs.anthropic.com\u002Fclaude\u002Fdocs\u002Fmodels-overview#model-comparison) to use for translation. This should be the full model name, e.g. `claude-3-haiku-20240307`\n\n#### DeepSeek\n  - `-k`, `--apikey`:\n  Your [DeepSeek API Key](https:\u002F\u002Fplatform.deepseek.com\u002Fapi_keys). (the app will look for DEEPSEEK_API_KEY in the environment if this is not provided)\n\n- `-b`, `--apibase`:\n  Base URL if you are using a custom deployment of DeepSeek. if it is not set, the official URL will be used.\n\n- `-m`, `--model`:\n  Specify the [model](https:\u002F\u002Fapi-docs.deepseek.com\u002Fquick_start\u002Fpricing) to use for translation. **deepseek-chat** is probably the only sensible choice (and default).\n\n#### Mistral AI\n  - `-k`, `--apikey`:\n  Your [Mistral API Key](https:\u002F\u002Fconsole.mistral.ai\u002Fapi-keys\u002F). (the app will look for MISTRAL_API_KEY in the environment if this is not provided)\n\n- `--server_url`:\n  URL if you are using a custom deployment of Mistral. if unset, the official URL will be used.\n\n- `-m`, `--model`:\n  Specify the [model](https:\u002F\u002Fdocs.mistral.ai\u002Fgetting-started\u002Fmodels\u002Fmodels_overview\u002F) to use for translation. **mistral-large-latest** is recommended, the small models are not very reliable.\n\n#### OpenAI Azure\n- `--deploymentname`:\n  Azure deployment name\n\n- `-k`, `--apikey`:\n  API key [for your deployment](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fazure\u002Fai-services\u002Fopenai\u002F).\n\n- `-b`, `--apibase`:\n  API backend base address.\n\n- `-a`, `--apiversion`:\n  Azure API version.\n\n#### Amazon Bedrock\n- `-k`, `--accesskey`:\n  Your [AWS Access Key ID](https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fid_credentials_access-keys.html). Not required if it is set in the `.env` file.\n\n- `-s`, `--secretkey`:\n  Your [AWS Secret Access Key](https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fid_credentials_access-keys.html). Not required if it is set in the `.env` file.\n\n- `-r`, `--region`:\n  AWS Region where Bedrock is available. You can check the list of regions [here](https:\u002F\u002Faws.amazon.com\u002Fabout-aws\u002Fglobal-infrastructure\u002Fregions_az\u002F). For example: `us-east-1` or `eu-west-1`.\n\n- `-m`, `--model`:\n  The ID of the [Bedrock model](https:\u002F\u002Fdocs.aws.amazon.com\u002Fbedrock\u002Flatest\u002Fuserguide\u002Ffoundation-models.html) to use for translation. Examples include `amazon.titan-text-lite-v1` or `amazon.titan-text-express-v1`.\n\n#### Custom Server specific arguments\n- `-s`, `--server`:\n  The address the server is running on, including port (e.g. http:\u002F\u002Flocalhost:1234). Should be provided by the server\n\n- `-e`, `--endpoint`:\n  The API function to call on the server, e.g. `\u002Fv1\u002Fcompletions`. Choose an appropriate endpoint for the model running on the server.\n\n- `-k`, `--apikey`:\n  API key if required (local servers shouldn't need an api key)\n\n- `-m`, `--model`:\n  The model to use for translation if required (for local servers this is probably determined by the server)\n\n- `--chat`:\n  Specify this argument if the endpoint expects requests in a conversation format - otherwise it is assumed to be a completion endpoint.\n\n- `--systemmessages`:\n  If using a conversation endpoint, translation instructions will be sent as the \"system\" user if this flag is specified.\n\n\n## Proxy Support\n\nLLM-Subtrans has support for proxies across most providers.\n\n### Configuration\n\nYou can configure a proxy using the following arguments:\n\n- `--proxy \u003CURL>`:\n  Specify the proxy URL. Supports both HTTP and SOCKS proxies.\n  *Example*: `--proxy http:\u002F\u002F127.0.0.1:8888` or `--proxy socks5:\u002F\u002F127.0.0.1:1080`\n\n- `--proxycert \u003CPATH>`:\n  Path to a custom CA certificate bundle (PEM format). This is required when using an intercepting proxy (like `mitmproxy` or `Fiddler`) that uses a self-signed certificate.\n  *Example*: `--proxycert C:\\Users\\name\\.mitmproxy\\mitmproxy-ca-cert.pem`\n\n### Example Usage\n\n```sh\n# Use a SOCKS proxy for OpenRouter\nllm-subtrans --auto -l Spanish input.srt --proxy socks5:\u002F\u002F127.0.0.1:1080\n\n# Use mitmdump with a custom certificate\nllm-subtrans --auto -l French input.srt --proxy http:\u002F\u002F127.0.0.1:8080 --proxycert .\u002Fmitmproxy-ca-cert.pem\n```\n\n### batch process\n\nYou can process files with the following directory structure：\n\n      #   -SRT\n      #   --fold1\n      #   ---1.srt\n      #   ---2.srt\n      #   ...\n      #   --fold2\n      #   ---1.srt\n      #   ---2.srt\n      #   ...\n\nUse the `batch_translate.py` script to process multiple subtitle files:\n\nYou can modify the `DEFAULT_OPTIONS` values directly in the script file, or use a combination of script defaults and command line overrides.\n\n```sh\n# Preview mode to test settings without making API calls\npython scripts\u002Fbatch_translate.py --preview\n\n# Basic usage with command line arguments\npython scripts\u002Fbatch_translate.py .\u002Fsubtitles .\u002Ftranslated --provider openai --model gpt-5-mini --apikey sk-... --language Spanish\n\n# Override output format\npython scripts\u002Fbatch_translate.py .\u002Fsubtitles .\u002Ftranslated --provider openai --output-format srt\n\n# Use additional options\npython scripts\u002Fbatch_translate.py .\u002Fsubtitles .\u002Ftranslated --provider openai --option max_batch_size=40 --option preprocess_subtitles=false\n```\n\n### Developers\nIt is recommended to use an IDE such as Visual Studio Code to run the program when installed from source, and set up a launch.json file to specify the arguments.\n\nNote: Remember to activate the virtual environment every time you work on the project.\n\n## Contributing\nContributions from the community are welcome! To contribute, follow these steps:\n\nFork the repository onto your own GitHub account.\n\nClone the repository onto your local machine using the following command:\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Fyour_username\u002Fllm-subtrans.git\n```\n\nCreate a new branch for your changes using the following command:\n\n```sh\ngit checkout -b feature\u002Fyour-new-feature\n```\n\nInstall pyright as a pre-commit hook (optional but encouraged):\n\n```sh\n# Install pyright for type checking\npip install pyright\n\n# Install git hooks (runs type checking before commits)\n# Windows:\nhooks\\install.bat\n\n# Linux\u002FMac:\n.\u002Fhooks\u002Finstall.sh\n```\n\nMake your changes to the code and commit them with a descriptive commit message.\n\nPush your changes to your forked repository.\n\nSubmit a pull request to the main LLM-Subtrans repository.\n\n### Localization\n\nLLM-Subtrans uses GNU gettext for UI localization.\n\n- Template (POT): `locales\u002Fgui-subtrans.pot`\n- Per‑language catalogs: `locales\u002F\u003Clang>\u002FLC_MESSAGES\u002Fgui-subtrans.po`\n- Compiled catalogs: `locales\u002F\u003Clang>\u002FLC_MESSAGES\u002Fgui-subtrans.mo`\n\nStrings in the code are marked with helpers (see codebase):\n- `_(\"text\")` for simple strings\n- `tr(\"context\", \"text\")` for contextualized strings\n\nContributions are very welcome - you can add a new localization in minutes! See `docs\u002Flocalization_contributing.md` for detailed instructions (tools, workflow, etc).\n\n## Acknowledgements\nThis project uses several useful libraries:\n\n- srt (https:\u002F\u002Fgithub.com\u002Fcdown\u002Fsrt)\n- pysubs2 (https:\u002F\u002Fgithub.com\u002Ftkarabela\u002Fpysubs2)\n- requests (https:\u002F\u002Fgithub.com\u002Fpsf\u002Frequests)\n- regex (https:\u002F\u002Fgithub.com\u002Fmrabarnett\u002Fmrab-regex)\n- httpx (https:\u002F\u002Fgithub.com\u002Fprojectdiscovery\u002Fhttpx)\n- babel (https:\u002F\u002Fgithub.com\u002Fpython-babel\u002F)\n\nTranslation providers:\n- openai (https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Flibraries\u002Fpython-bindings)\n- google-genai (https:\u002F\u002Fgithub.com\u002Fgoogleapis\u002Fpython-genai)\n- anthropic (https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fanthropic-sdk-python)\n- mistralai (https:\u002F\u002Fgithub.com\u002Fmistralai\u002Fclient-python)\n- boto3 (Amazon Bedrock) (https:\u002F\u002Fgithub.com\u002Fboto\u002Fboto3)\n\nFor the GUI:\n- pyside6 (https:\u002F\u002Fwiki.qt.io\u002FQt_for_Python)\n- blinker (https:\u002F\u002Fpythonhosted.org\u002Fblinker\u002F)\n- darkdetect (https:\u002F\u002Fgithub.com\u002Falbertosottile\u002Fdarkdetect)\n- appdirs (https:\u002F\u002Fgithub.com\u002FActiveState\u002Fappdirs)\n\nFor bundled versions:\n- python (https:\u002F\u002Fwww.python.org\u002F)\n- pyinstaller (https:\u002F\u002Fpyinstaller.org\u002F)\n\n## Version History\n\nVersion 1.3 added OpenRouter as the default translation service, opening up access to many more\n\nVersion 1.2 added localization for the GUI and support for the GPT-5 model line.\n\nVersion 1.1 added support for a more flexible translation format for use with custom instructions.\n\nVersion 1.0 is (ironically) a minor update, updating the major version to 1.0 because the project has been stable for some time.\n\nVersion 0.7 introduced optional post-processing of translated subtitles to try to fix some of the common issues with LLM-translated subtitles (e.g. adding line breaks), along with new default instructions that tend to produce fewer errors.\n\nVersion 0.6 changes the architecture to a provider-based system, allowing multiple AI services to be used as translators.\nSettings are compartmentalised for each provider. For the intial release the only supported provider is **OpenAI**.\n\nVersion 0.5 adds support for gpt-instruct models and a refactored code base to support different translation engines. For most users, the recommendation is still to use the **gpt-3.5-turbo-16k** model with batch sizes of between (10,100) lines, for the best combination of performance\u002Fcost and translation quality.\n\nVersion 0.4 features significant optimisations to the GUI making it more responsive and usable, along with numerous bug fixes.\n\nVersion 0.3 featured a major effort to bring the GUI up to full functionality and usability, including adding options dialogs and more, plus many bug fixes.\n\nVersion 0.2 employs a new prompting approach that greatly reduces desyncs caused by GPT merging together source lines in the translation. This can reduce the naturalness of the translation when the source and target languages have very different grammar, but it provides a better base for a human to polish the output.\n\nThe instructions have also been made more detailed, with multiple examples of correct output for GPT to reference, and the generation of summaries has been improved so that GPT is better able to understand the context of the batch it is translating. Additionally, double-clicking a scene or batch now allows the summary to be edited by hand, which can greatly improve the results of a retranslation and of subsequent batches or scenes. Individually lines can also be edited by double-clicking them.\n\n## License\nLLM-Subtrans is licensed under the MIT License. See LICENSE for the 3rd party library licenses.\n","# LLM-Subtrans\nLLM-Subtrans 是一款开源字幕翻译工具，它利用大语言模型（LLM）作为翻译服务。该工具支持在语言模型所支持的任意语种对之间进行字幕翻译。\n\n应用程序通过插件式架构支持多种字幕格式。目前支持 `.srt`、`.ssa`\u002F`.ass` 和 `.vtt` 文件。\n\n注意：LLM-Subtrans 需要有效的互联网连接。字幕会被发送到提供商的服务器进行翻译，因此适用其隐私政策。\n\n## 安装\n对于大多数用户来说，使用打包发布的版本是最简单的方式。请从 [发布页面](https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fllm-subtrans\u002Freleases) 下载一个压缩包，解压到任意文件夹并运行 `gui-subtrans`。首次运行时，程序会提示您进行一些基本设置。\n\n如果您希望使用命令行工具、修改源代码，或者更倾向于对安装过程有更多控制权，则需要 [从源码安装](#installing-from-source)。\n\n### Windows\n每个发布版本都为 Windows 打包成 (**gui-subtrans-x.x.x.zip**)。\n\n### MacOS\n通常会为搭载 Apple Silicon 芯片的 Mac 提供打包好的构建版本 (**gui-subtrans-x.x.x.macos-arm64.zip**)。如果您使用的是 Intel 芯片的 Mac，则需要 [从源码安装](#installing-from-source)。\n\n### Linux\n不提供预编译的 Linux 包，因此您需要 [从源码安装](#installing-from-source)。\n\n### LLM-Subtrans Web\n基于 Gemini 的 [LLM-Subtrans Web](https:\u002F\u002Ftinyurl.com\u002Fllm-subtrans-web) 可免费使用，但由于这对我个人而言会产生费用，现在需要注册邮箱地址，并且每位用户每天仅限 2 次翻译。\n\n## 翻译提供商\n\n### OpenRouter\nhttps:\u002F\u002Fopenrouter.ai\u002Fprivacy\n\n[OpenRouter](https:\u002F\u002Fopenrouter.ai\u002F) 是一项聚合了来自众多提供商的 [模型](https:\u002F\u002Fopenrouter.ai\u002Fmodels) 的服务。您需要一个 [OpenRouter API 密钥](https:\u002F\u002Fopenrouter.ai\u002Fsettings\u002Fkeys) 才能使用该服务，并且账户需有一定余额（尽管也有一些功能相当强大的模型是免费提供的）。\n\n您可以选择让 OpenRouter 自动选择模型（GUI 中的“使用默认模型”选项或命令行中的 `--auto` 参数），也可以指定特定的模型。模型偏好还可以在 OpenRouter 控制面板中进行设置。\n\n由于可用的模型多达数百种，它们被按模型家族分组。默认情况下，可用模型列表是从“Translation”类别中提取的，但这排除了许多完全具备翻译能力的模型（包括大多数免费选项）。\n\n### Google Gemini\nhttps:\u002F\u002Fai.google.dev\u002Fterms\n\n**请注意，可能存在地区限制：https:\u002F\u002Fai.google.dev\u002Favailable_regions**\n\n截至撰写本文时，Gemini 2.5 Flash 或许是翻译速度和流畅性方面的领先模型，尽管存在一定的内容审查；而 Preview 版本通常可以免费使用。\n\n您需要从 https:\u002F\u002Fai.google.dev\u002F 或者在 https:\u002F\u002Fconsole.cloud.google.com\u002F 上创建的项目中获取 Google Gemini API 密钥。务必确保为该 API 密钥和项目启用生成式 AI 功能。\n\n遗憾的是，Gemini 有时会拒绝翻译包含某些特定词汇或短语的内容，即使安全设置已调至最低。如果遇到这种情况，您需要改用其他提供商，或者将字幕分批处理，手动翻译那些含有违禁内容的行。\n\n### OpenAI\nhttps:\u002F\u002Fopenai.com\u002Fpolicies\u002Fprivacy-policy\n\n您需要从 https:\u002F\u002Fplatform.openai.com\u002Faccount\u002Fapi-keys 获取 OpenAI API 密钥，才能使用 OpenAI 的 GPT 模型。如果该 API 密钥关联的是免费试用账户，翻译速度将会 *严重* 受限。\n\n您可以使用自定义的 `api_base` 参数来接入自定义的 OpenAI 实例（或任何其他兼容 OpenAI 协议的端点），不过使用“自定义服务器”选项能提供更多的控制。\n\n您也可以将 **OpenAI Azure** 部署作为翻译提供商，但只有在您非常熟悉相关配置的情况下才建议这样做——在这种情况下，相信您已经清楚如何设置 Azure 提供商的相关参数。\n\n### DeepSeek\nhttps:\u002F\u002Fplatform.deepseek.com\u002Fdownloads\u002FDeepSeek%20Open%20Platform%20Terms%20of%20Service.html\n\n您需要从 https:\u002F\u002Fplatform.deepseek.com\u002Fapi_keys 获取 DeepSeek API 密钥才能使用该提供商。\n\n- **API 基础 URL**：您可以选择指定自定义的 URL，例如当您自行托管 DeepSeek 实例时。若未设置，则将使用官方的 DeepSeek API 端点。\n  \n- **模型**：默认模型为 `deepseek-chat`，推荐用于翻译任务。对于存在 OCR 或转录错误的源字幕，`deepseek-reasoner` 可能会给出更好的结果，因为它会花更多时间尝试推断错误所在。\n\nDeepSeek 的配置相对简单，性能尚可且价格低廉，不过翻译并非其强项。\n\n### Anthropic\nhttps:\u002F\u002Fsupport.anthropic.com\u002Fen\u002Fcollections\u002F4078534-privacy-legal\n\n您需要从 https:\u002F\u002Fconsole.anthropic.com\u002Fsettings\u002Fkeys 获取 Anthropic API 密钥，才能使用 Claude 作为翻译提供商。翻译并不是 Claude 的强项，而且与其他提供商相比，它的 API 费用较高。\n\n该 API 根据您的信用等级设定了严格的 [速率限制](https:\u002F\u002Fdocs.anthropic.com\u002Fclaude\u002Freference\u002Frate-limits)，分别针对每分钟请求数和每日令牌数。\n\n### Mistral\nhttps:\u002F\u002Fmistral.ai\u002Fterms\u002F\n\n您需要从 https:\u002F\u002Fconsole.mistral.ai\u002Fapi-keys\u002F 获取 Mistral API 密钥才能使用该提供商。\n\n- **服务器 URL**：如果您使用的是自定义部署的 Mistral API，可以通过 `--server_url` 参数指定服务器 URL。\n  \n- **模型**：推荐使用 `mistral-large-latest` 进行翻译。较小的模型表现通常较差，可能无法很好地遵循系统指令。\n\nMistral AI 的设置较为简单，但其作为翻译工具的表现并不算出色。\n\n### 自定义服务器\nLLM-Subtrans 可以直接与任何支持 OpenAI 兼容 API 的服务器对接，包括本地托管的模型，例如 [LM Studio](https:\u002F\u002Flmstudio.ai\u002F)。\n\n这主要用于研究目的，不应期望本地模型能带来特别好的翻译效果。大语言模型的强大能力很大程度上源于其规模，因此您在消费级 GPU 上运行的小型量化模型，很可能会产生质量不佳的翻译、无法生成有效响应，甚至陷入无限循环。如果您发现某个模型能够稳定地生成高质量翻译，请在讨论区分享相关信息！聊天和完成端点均受支持——请根据服务器上运行的模型类型来配置设置和端点（例如，经过指令微调的模型可能更适合使用完成端点而非聊天端点）。如果使用的模型需要特定的格式，可以在 GUI 中编辑提示模板；务必在模板中至少包含 `{prompt}` 标记，因为每一批次待翻译的字幕都会被填充到此处！\n\n### Amazon Bedrock\nhttps:\u002F\u002Faws.amazon.com\u002Fservice-terms\u002F\n\n**不建议大多数用户使用 Bedrock**：其设置过程较为复杂，需要 AWS 凭证、正确的 IAM 权限以及区域配置。此外，并非 Bedrock 上的所有模型都支持翻译任务或能提供可靠的结果。预打包版本将不会包含 Bedrock 支持——如果您能够自行配置 AWS，那么您也可以从源代码安装 llm-subtrans。\n\n要使用 Bedrock，您必须：\n1. 创建一个具有适当权限的 **IAM 用户** 或 **角色**（例如 `bedrock:InvokeModel`、`bedrock:ListFoundationModels`）。\n2. 确保您希望使用的模型在所选的 AWS 区域中可用，并且已为该 IAM 用户启用访问权限（参阅 [AWS 官方文档](https:\u002F\u002Fdocs.aws.amazon.com\u002Fbedrock\u002Flatest\u002Fuserguide\u002Fmodel-access-modify.html)）。\n\n## 从源代码安装\n如果您希望使用命令行工具或对程序进行修改，您需要在系统上安装 Python 3.10 及以上版本和 pip，然后按照以下步骤操作。\n\n使用以下命令或您偏好的工具将 LLM-Subtrans 仓库克隆到本地：\n\n    ```sh\n    git clone https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fllm-subtrans.git\n    ```\n\n### 设置脚本\n\n最简单的设置方法是运行统一的安装脚本：\n- **Windows**：运行 `install.bat`\n- **macOS\u002FLinux**：运行 `install.sh`\n\n这些脚本会创建一个虚拟环境，并提供“带 GUI 的安装”或“仅命令行安装”选项，同时还可选择添加对特定提供商的支持。脚本会引导您完成设置，并生成用于启动应用程序的命令脚本。\n\n在安装过程中，您可以根据提示为每个选定的提供商输入 API 密钥，这些密钥将保存在 `.env` 文件中，这样您每次运行程序时就不必重复输入。不过，如果您只打算使用 GUI，这一步就显得有些多余，因为密钥可以直接保存在应用设置中。\n\n### 手动配置\n**如果您已经运行了安装脚本，则可以跳过剩余步骤。仅当您希望手动配置环境时，才继续阅读以下内容。**\n\n1. 在项目的根目录下创建一个名为 `.env` 的文件。将您选择的提供商所需的所有设置添加到 `.env` 文件中，格式如下：\n    ```sh\n    OPENROUTER_API_KEY=\u003C您的 OpenRouter API 密钥>\n    OPENAI_API_KEY=\u003C您的 OpenAI API 密钥>\n    GEMINI_API_KEY=\u003C您的 Gemini API 密钥>\n    AZURE_API_KEY=\u003C您的 Azure API 密钥>\n    CLAUDE_API_KEY=\u003C您的 Claude API 密钥>\n    ```\n\n    如果您使用的是 Azure：\n    ```sh\n    AZURE_API_BASE=\u003C您的 API 基础地址，例如 https:\u002F\u002Fsomething.openai.azure.com>\n    AZURE_DEPLOYMENT_NAME=\u003C部署名称>\n    ```\n\n    如果您使用的是 Bedrock：\n    ```sh\n    AWS_ACCESS_KEY_ID=您的访问密钥 ID\n    AWS_SECRET_ACCESS_KEY=您的秘密访问密钥\n    AWS_REGION=您的区域\n    ```\n\n    对于 OpenAI 的推理模型，您可以设置推理力度（默认为低）：\n    ```sh\n    OPENAI_REASONING_EFFORT=low\u002Fmedium\u002Fhigh\n    ```\n\n2. 在项目根目录下运行以下命令创建一个虚拟环境，为 Python 解释器提供一个本地环境（可选，但强烈建议这样做以避免与其他 Python 应用程序发生依赖冲突）：\n\n    ```sh\n    python -m venv envsubtrans\n    ```\n\n3. 根据您的操作系统运行相应的命令激活虚拟环境。每次运行应用程序前都需要执行此操作。\n\n    ```sh\n    .\\envsubtrans\\Scripts\\activate      # Windows\n    source .\u002Fenvsubtrans\u002Fbin\u002Factivate   # Mac\u002FLinux\n    ```\n\n4. 安装项目（如果您想修改代码，可以添加 `-e` 参数以进行可编辑安装）：\n\n    ```sh\n    pip install -e .                   # 仅安装命令行工具，支持 OpenRouter 或自定义服务器\n    pip install -e \".[gui]\"            # 核心模块及默认提供商，附带 GUI 模块\n    pip install -e \".[gui,openai,gemini,claude,mistral,bedrock]\"   # 完整安装，包含可选提供商（可根据需求删减）\n    ```\n\n## 使用方法\n该程序的工作原理是将字幕分成若干批次，依次发送至翻译服务。\n\n根据批次大小的不同，它可能会为每个字幕文件发起多次 API 调用。速度主要取决于所选的模型。\n\n默认情况下，翻译后的字幕会写入同一目录下的新文件，文件名会在原文件名后附加目标语言标识。\n\n### GUI\n[Subtrans GUI](https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fllm-subtrans\u002Fwiki\u002FGUI#gui-subtrans) 是使用该程序的最佳且最简单的方式。\n\n安装完成后，通过 `gui-subtrans` 命令或 shell 脚本启动 GUI，其余操作应该都非常直观易懂。\n\n有关如何使用该程序的更多详细信息，请参阅项目 Wiki。\n\n### 命令行\nLLM-Subtrans 可以作为控制台命令或 shell 脚本使用。安装脚本会在项目根目录下为每个提供商创建一个 cmd 或 sh 文件，这些文件会负责激活虚拟环境并调用相应的翻译脚本。\n\n最基本的用法如下：\n```sh\n# 使用 OpenRouter 并自动选择模型\nllm-subtrans --auto -l \u003C语言> \u003C字幕文件路径>\n\n# 使用 OpenRouter 并指定模型\nllm-subtrans --model google\u002Fgemini-2.5-flash -l \u003C语言> \u003C字幕文件路径>\n\n# 在翻译的同时转换格式（本例中将 ASS 转换为 SRT）\nllm-subtrans -l \u003C语言> -o output.srt input.ass\n\n# 使用任何兼容 OpenAI API 的服务器\nllm-subtrans -s \u003C服务器地址> -e \u003C端点> -k \u003CAPI 密钥> -l \u003C语言> \u003C字幕文件路径>\n\n# 使用特定提供商\ngpt-subtrans --model gpt-5-mini --target_language \u003C目标语言> \u003C字幕文件路径>\ngemini-subtrans --model gemini-2.5-flash-latest --target_language \u003C目标语言> \u003C字幕文件路径>\nclaude-subtrans --model claude-3-5-haiku-latest --target_language \u003C目标语言> \u003C字幕文件路径>\n\n# 列出支持的字幕格式\nllm-subtrans --list-formats\n\n# 批量处理文件夹中的文件（请先激活虚拟环境）\npython scripts\u002Fbatch_translate.py .\u002Fsubtitles .\u002Ftranslated --provider openai --model gpt-5-mini --apikey sk-... --language Spanish\n```\n\n输出文件的格式由文件扩展名推断得出。如需在不同格式之间转换，请提供带有目标扩展名的输出路径。\n\n如果未指定目标语言，默认为英语。\n\n其他可在命令行中指定的选项详见下文。\n\n## 项目文件\n\n**注意**：GUI 中默认已启用项目文件。\n\n`--project` 参数或 `.env` 文件中的 `PROJECT_FILE` 设置控制是否为命令行创建项目文件并保存到磁盘。\n\n如果启用，当加载字幕文件时，将创建一个扩展名为 `.subtrans` 的文件，其中包含项目的详细信息。随着翻译的进行，该文件会不断更新。编写项目文件的好处之一是允许恢复中断的翻译任务。强烈建议使用此功能。\n\n```sh\n# 使用 OpenRouter 并创建持久化项目\nllm-subtrans --project --auto -l \u003C语言> \u003C字幕文件路径>\n\n# 使用 OpenRouter 并恢复持久化项目\nllm-subtrans --project --auto -l \u003C语言> \u003Csubtrans 项目文件路径>\nllm-subtrans --project --auto -l \u003C语言> \u003C字幕文件路径>  # 如果项目文件在同一目录下，将自动检测到\n```\n\n## 格式转换\nLLM-Subtrans 主要是一个翻译应用程序，格式转换最好由专门的工具来处理。不过，该工具也支持读取一种格式并输出另一种格式。\n\n```sh\n# 使用 OpenRouter 将 .ass 转换为 .srt\nllm-subtrans --project --auto -l \u003C语言> -o \u003C输出文件.srt路径> \u003C输入字幕文件.ass路径>\n```\n\n## 高级用法\n\n命令行提供了一些参数，可以更精细地控制翻译过程。\n\n要使用这些参数，只需在源文件路径之后添加即可。例如：\n\n```sh\nllm-subtrans path\u002Fto\u002Fmy\u002Fsubtitles.srt --moviename \"我的精彩电影\" --ratelimit 10 --substitution cat::dog\n```\n\n许多设置的默认值可以在 `.env` 文件中以大写形式（NAME_IN_CAPS）进行配置。完整的参数列表请参阅 Options.py 和各个 Provider_XXX 文件。\n\n- `-l`, `--target_language`:\n  指定要翻译成的目标语言。\n\n- `-o`, `--output`:\n  指定翻译后字幕的输出文件名。\n\n- `--project`:\n  读取或写入当前翻译字幕的项目文件（详情见上文）。\n\n- `--ratelimit`:\n  每分钟向翻译服务发送的最大请求数（主要适用于使用 OpenAI 免费试用账户的情况）。\n\n- `--moviename`:\n  可选地指定源素材名称，为翻译者提供上下文信息。\n\n- `--description`:\n  对源素材的简要描述，提供更多背景信息。通常内容越简洁越好，否则 AI 可能会开始自行发挥。\n\n- `--name`, `--names`:\n  可选地提供用于翻译的人名列表（更强大的 AI 模型更有可能实际使用这些名字）。\n\n- `--substitution`:\n  由 `::` 分隔的字符串对，用于在原文或译文中进行替换；也可以指定包含此类替换对的文件。\n\n- `--scenethreshold`:\n  认为属于新场景的两行字幕之间的时间间隔（秒数）。\n\n- `--minbatchsize`:\n  开始向翻译器发送新批次所需的最小字幕行数。较高的值通常会使翻译更快且成本更低，但也会增加不同步的风险。\n\n- `--maxbatchsize`:\n  强制开始新批次之前的最大字幕行数。此值需要考虑所用模型的令牌限制，但“最佳”值取决于多种因素，因此建议多做实验。较大的批次更具成本效益，但也增加了 AI 出现不同步、导致昂贵重试的风险。\n\n- `--preprocess`:\n  在分批之前对字幕进行预处理。此操作会执行多种步骤，以使字幕更适合高效翻译，例如将过长的字幕行拆分为多行。主要用于通过 Whisper 等工具自动生成的字幕。\n\n- `--postprocess`:\n  对翻译后的字幕进行后处理。例如，在过长的字幕行中添加换行符，并在翻译请求完成后规范化对话标签。\n\n- `--instruction`:\n  向 AI 提供的额外指令，指示其如何进行翻译。\n\n- `--instructionfile`:\n  从指定文件加载 AI 系统指令（若未指定，则使用默认的 instructions.txt）。\n\n- `--maxlines`:\n  最多处理的批次数量。可用于在达到一定行数后结束翻译，例如检查结果。\n\n- `--temperature`:\n  较高的温度会增加翻译结果的随机性。默认值为 0。\n\n- `--reload`:\n  将从源文件重新加载字幕，而不是使用项目文件中保存的字幕（注意：此选项要求同时启用 `--project`）。\n\n- `--retranslate`:\n  忽略现有翻译，重新翻译所有字幕（注意：此选项要求同时启用 `--project`）。\n\n- `--reparse`:\n  不会再次将现有翻译发送给翻译器，而是重新处理翻译器的响应以提取翻译结果。这在修复错误版本后非常有用，也可用于重置已被手动编辑过的翻译（注意：此选项要求同时启用 `--project`）。\n\n- `--preview`:\n  字幕将被加载并分批，翻译流程也会运行，但不会向翻译器发起任何调用。仅适用于调试目的。\n\n### 供应商特定参数\n某些特定供应商还提供额外的参数。\n\n#### OpenRouter\n- `-k`, `--apikey`:\n  您的 [OpenRouter API 密钥](https:\u002F\u002Fopenrouter.ai\u002Fsettings\u002Fkeys)（如果未提供此参数，程序将从环境变量中查找 `OPENROUTER_API_KEY`）\n\n- `--auto`\n  自动选择要使用的模型（选择标准可在 [OpenRouter 控制面板](https:\u002F\u002Fopenrouter.ai\u002Fsettings\u002Fpreferences) 中配置）\n\n#### OpenAI\n- `-k`, `--apikey`:\n  您的 [OpenAI API 密钥](https:\u002F\u002Fplatform.openai.com\u002Faccount\u002Fapi-keys)（如果未提供此参数，程序将从环境变量中查找 `OPENAI_API_KEY`）\n\n- `-b`, `--apibase`:\n  如果您使用的是自定义实例，则指定 API 基础 URL。若未设置，则使用默认 URL。\n\n- `-httpx`:\n  使用 [HTTPX 库](https:\u002F\u002Fgithub.com\u002Fprojectdiscovery\u002Fhttpx) 发起请求（仅在指定了 `apibase` 时支持）\n\n- `-m`, `--model`:\n  指定用于翻译的 [AI 模型](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fmodels)\n\n#### Gemini\n- `-k`, `--apikey`:\n  您的 [Google Gemini API 密钥](https:\u002F\u002Faistudio.google.com\u002Fapp\u002Fapikey)（如果未提供此参数，程序将从环境变量中查找 `GEMINI_API_KEY`）\n\n- `-m`, `--model`:\n  指定用于翻译的 [AI 模型](https:\u002F\u002Fai.google.dev\u002Fmodels\u002Fgemini)\n\n#### Claude\n- `-k`, `--apikey`:\n  您的 [Anthropic API 密钥](https:\u002F\u002Fconsole.anthropic.com\u002Fsettings\u002Fkeys)（如果未提供此参数，程序将从环境变量中查找 `ANTHROPIC_API_KEY`）\n\n- `-m`, `--model`:\n  指定用于翻译的 [AI 模型](https:\u002F\u002Fdocs.anthropic.com\u002Fclaude\u002Fdocs\u002Fmodels-overview#model-comparison)。应使用完整的模型名称，例如 `claude-3-haiku-20240307`\n\n#### DeepSeek\n- `-k`, `--apikey`:\n  您的 [DeepSeek API 密钥](https:\u002F\u002Fplatform.deepseek.com\u002Fapi_keys)（如果未提供此参数，程序将从环境变量中查找 `DEEPSEEK_API_KEY`）\n\n- `-b`, `--apibase`:\n  如果您使用的是 DeepSeek 的自定义部署，则指定基础 URL。若未设置，则使用官方 URL。\n\n- `-m`, `--model`:\n  指定用于翻译的 [模型](https:\u002F\u002Fapi-docs.deepseek.com\u002Fquick_start\u002Fpricing)。通常情况下，`deepseek-chat` 是唯一合理的选择（也是默认值）。\n\n#### Mistral AI\n- `-k`, `--apikey`:\n  您的 [Mistral API 密钥](https:\u002F\u002Fconsole.mistral.ai\u002Fapi-keys\u002F)（如果未提供此参数，程序将从环境变量中查找 `MISTRAL_API_KEY`）\n\n- `--server_url`:\n  如果您使用的是 Mistral 的自定义部署，则指定 URL。若未设置，则使用官方 URL。\n\n- `-m`, `--model`:\n  指定用于翻译的 [模型](https:\u002F\u002Fdocs.mistral.ai\u002Fgetting-started\u002Fmodels\u002Fmodels_overview\u002F)。推荐使用 `mistral-large-latest`，小型模型的可靠性较低。\n\n#### OpenAI Azure\n- `--deploymentname`:\n  Azure 部署名称\n\n- `-k`, `--apikey`:\n  您的 [Azure 部署 API 密钥](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fazure\u002Fai-services\u002Fopenai\u002F)。\n\n- `-b`, `--apibase`:\n  API 后端基础地址。\n\n- `-a`, `--apiversion`:\n  Azure API 版本。\n\n#### Amazon Bedrock\n- `-k`, `--accesskey`:\n  您的 [AWS 访问密钥 ID](https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fid_credentials_access-keys.html)。如果已在 `.env` 文件中设置，则无需提供。\n\n- `-s`, `--secretkey`:\n  您的 [AWS 秘密访问密钥](https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fid_credentials_access-keys.html)。如果已在 `.env` 文件中设置，则无需提供。\n\n- `-r`, `--region`:\n  Bedrock 可用的 AWS 区域。您可以在此处查看区域列表：[AWS 全球基础设施区域和可用区](https:\u002F\u002Faws.amazon.com\u002Fabout-aws\u002Fglobal-infrastructure\u002Fregions_az\u002F)。例如：`us-east-1` 或 `eu-west-1`。\n\n- `-m`, `--model`:\n  指定用于翻译的 [Bedrock 模型 ID](https:\u002F\u002Fdocs.aws.amazon.com\u002Fbedrock\u002Flatest\u002Fuserguide\u002Ffoundation-models.html)。示例包括 `amazon.titan-text-lite-v1` 或 `amazon.titan-text-express-v1`。\n\n#### 自定义服务器特定参数\n- `-s`, `--server`:\n  服务器运行的地址，包含端口（例如：http:\u002F\u002Flocalhost:1234）。应由服务器提供。\n\n- `-e`, `--endpoint`:\n  要在服务器上调用的 API 函数，例如 `\u002Fv1\u002Fcompletions`。请根据服务器上运行的模型选择合适的端点。\n\n- `-k`, `--apikey`:\n  如果需要 API 密钥，则提供。本地服务器通常不需要 API 密钥。\n\n- `-m`, `--model`:\n  如果需要，指定用于翻译的模型（对于本地服务器，这通常由服务器决定）。\n\n- `--chat`:\n  如果端点期望以对话格式接收请求，则指定此参数；否则，默认为完成端点。\n\n- `--systemmessages`:\n  如果使用对话端点，且指定了此标志，则会将翻译指令作为“系统”用户发送。\n\n\n## 代理支持\n\nLLM-Subtrans 支持大多数供应商的代理功能。\n\n### 配置\n您可以通过以下参数配置代理：\n\n- `--proxy \u003CURL>`:\n  指定代理 URL。支持 HTTP 和 SOCKS 代理。\n  *示例*：`--proxy http:\u002F\u002F127.0.0.1:8888` 或 `--proxy socks5:\u002F\u002F127.0.0.1:1080`\n\n- `--proxycert \u003CPATH>`:\n  自定义 CA 证书包的路径（PEM 格式）。当使用拦截式代理（如 `mitmproxy` 或 `Fiddler`）且该代理使用自签名证书时，需要此参数。\n  *示例*：`--proxycert C:\\Users\\name\\.mitmproxy\\mitmproxy-ca-cert.pem`\n\n### 使用示例\n```sh\n# 对 OpenRouter 使用 SOCKS 代理\nllm-subtrans --auto -l Spanish input.srt --proxy socks5:\u002F\u002F127.0.0.1:1080\n\n# 使用 mitmdump 并指定自定义证书\nllm-subtrans --auto -l French input.srt --proxy http:\u002F\u002F127.0.0.1:8080 --proxycert .\u002Fmitmproxy-ca-cert.pem\n```\n\n### 批量处理\n您可以按照以下目录结构处理文件：\n\n      #   -SRT\n      #   --fold1\n      #   ---1.srt\n      #   ---2.srt\n      #   ...\n      #   --fold2\n      #   ---1.srt\n      #   ---2.srt\n      #   ...\n\n使用 `batch_translate.py` 脚本来处理多个字幕文件：\n\n您可以在脚本文件中直接修改 `DEFAULT_OPTIONS` 的值，也可以结合脚本默认值与命令行覆盖来使用。\n\n```sh\n# 预览模式，测试设置而不进行 API 调用\npython scripts\u002Fbatch_translate.py --preview\n\n# 基本用法，通过命令行参数指定\npython scripts\u002Fbatch_translate.py .\u002Fsubtitles .\u002Ftranslated --provider openai --model gpt-5-mini --apikey sk-... --language Spanish\n\n# 覆盖输出格式\npython scripts\u002Fbatch_translate.py .\u002Fsubtitles .\u002Ftranslated --provider openai --output-format srt\n\n# 使用附加选项\npython scripts\u002Fbatch_translate.py .\u002Fsubtitles .\u002Ftranslated --provider openai --option max_batch_size=40 --option preprocess_subtitles=false\n```\n\n### 开发者\n建议从源代码安装后，使用 Visual Studio Code 等 IDE 运行程序，并设置 `launch.json` 文件以指定参数。\n注意：每次处理项目时，请务必激活虚拟环境。\n\n## 贡献\n我们欢迎社区的贡献！要参与贡献，请按照以下步骤操作：\n\n1. 将仓库 Fork 到您自己的 GitHub 账户。\n2. 使用以下命令将仓库克隆到您的本地机器：\n   ```sh\n   git clone https:\u002F\u002Fgithub.com\u002Fyour_username\u002Fllm-subtrans.git\n   ```\n3. 使用以下命令为您的更改创建一个新分支：\n   ```sh\n   git checkout -b feature\u002Fyour-new-feature\n   ```\n4. 安装 pyright 作为 pre-commit 钩子（可选但推荐）：\n   ```sh\n   # 安装 pyright 进行类型检查\n   pip install pyright\n\n   # 安装 Git 钩子（在提交前运行类型检查）\n   # Windows:\n   hooks\\install.bat\n\n   # Linux\u002FMac:\n   .\u002Fhooks\u002Finstall.sh\n   ```\n5. 对代码进行修改，并使用描述性的提交信息提交更改。\n6. 将您的更改推送到您 Fork 的仓库。\n7. 向 LLM-Subtrans 主仓库提交 Pull Request。\n\n### 本地化\n\nLLM-Subtrans 使用 GNU gettext 进行 UI 本地化。\n\n- 模板文件 (POT)：`locales\u002Fgui-subtrans.pot`\n- 各语言目录：`locales\u002F\u003Clang>\u002FLC_MESSAGES\u002Fgui-subtrans.po`\n- 编译后的目录：`locales\u002F\u003Clang>\u002FLC_MESSAGES\u002Fgui-subtrans.mo`\n\n代码中的字符串使用辅助函数标记：\n- `_(\"text\")` 用于简单字符串\n- `tr(\"context\", \"text\")` 用于上下文相关的字符串\n\n非常欢迎本地化贡献——您可以在几分钟内添加一种新的本地化语言！详细说明（工具、工作流程等）请参阅 `docs\u002Flocalization_contributing.md`。\n\n## 致谢\n\n本项目使用了多个有用的库：\n\n- srt (https:\u002F\u002Fgithub.com\u002Fcdown\u002Fsrt)\n- pysubs2 (https:\u002F\u002Fgithub.com\u002Ftkarabela\u002Fpysubs2)\n- requests (https:\u002F\u002Fgithub.com\u002Fpsf\u002Frequests)\n- regex (https:\u002F\u002Fgithub.com\u002Fmrabarnett\u002Fmrab-regex)\n- httpx (https:\u002F\u002Fgithub.com\u002Fprojectdiscovery\u002Fhttpx)\n- babel (https:\u002F\u002Fgithub.com\u002Fpython-babel\u002F)\n\n翻译服务提供商：\n- openai (https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Flibraries\u002Fpython-bindings)\n- google-genai (https:\u002F\u002Fgithub.com\u002Fgoogleapis\u002Fpython-genai)\n- anthropic (https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fanthropic-sdk-python)\n- mistralai (https:\u002F\u002Fgithub.com\u002Fmistralai\u002Fclient-python)\n- boto3 (Amazon Bedrock) (https:\u002F\u002Fgithub.com\u002Fboto\u002Fboto3)\n\nGUI 相关：\n- pyside6 (https:\u002F\u002Fwiki.qt.io\u002FQt_for_Python)\n- blinker (https:\u002F\u002Fpythonhosted.org\u002Fblinker\u002F)\n- darkdetect (https:\u002F\u002Fgithub.com\u002Falbertosottile\u002Fdarkdetect)\n- appdirs (https:\u002F\u002Fgithub.com\u002FActiveState\u002Fappdirs)\n\n打包版本相关：\n- python (https:\u002F\u002Fwww.python.org\u002F)\n- pyinstaller (https:\u002F\u002Fpyinstaller.org\u002F)\n\n## 版本历史\n\n- **1.3 版** 添加了 OpenRouter 作为默认的翻译服务，从而开放了更多选择。\n- **1.2 版** 增加了 GUI 的本地化支持，并引入了对 GPT-5 系列模型的支持。\n- **1.1 版** 支持更灵活的翻译格式，方便用户使用自定义指令。\n- **1.0 版** 是一次小更新，但由于项目已稳定运行了一段时间，因此将主版本号提升至 1.0。\n- **0.7 版** 引入了可选的翻译字幕后处理功能，以尝试修复 LLM 翻译字幕中常见的问题（如添加换行符），并提供了新的默认指令，以减少错误率。\n- **0.6 版** 将架构改为基于服务提供商的系统，允许使用多种 AI 服务作为翻译工具。每个服务提供商的设置被独立管理。首次发布时，仅支持 **OpenAI**。\n- **0.5 版** 增加了对 gpt-instruct 模型的支持，并重构了代码库以适应不同的翻译引擎。对于大多数用户来说，仍然建议使用 **gpt-3.5-turbo-16k** 模型，批量大小控制在 10 到 100 行之间，以获得最佳的性能、成本和翻译质量。\n- **0.4 版** 对 GUI 进行了显著优化，使其响应更快、更易用，并修复了许多 bug。\n- **0.3 版** 大力提升了 GUI 的功能性和可用性，增加了选项对话框等功能，并修复了大量 bug。\n- **0.2 版** 采用了一种新的提示方法，大大减少了由于 GPT 在翻译过程中合并源文本行而导致的字幕不同步问题。虽然这种方法可能会降低源语言与目标语言语法差异较大时的自然度，但它为人工润色输出提供了更好的基础。\n  此外，指令变得更加详细，提供了多个正确输出示例供 GPT 参考，并改进了摘要生成机制，使 GPT 更好地理解当前批次的上下文。现在，双击场景或批次即可手动编辑摘要，这可以显著提高重新翻译以及后续批次或场景的效果。单个字幕行也可以通过双击进行编辑。\n\n## 许可证\n\nLLM-Subtrans 采用 MIT 许可证授权。第三方库的许可证信息请参阅 LICENSE 文件。","# LLM-Subtrans 快速上手指南\n\nLLM-Subtrans 是一款开源字幕翻译工具，利用大语言模型（LLM）将字幕文件在任意支持的语言对之间进行翻译。支持 `.srt`、`.ssa`\u002F`.ass` 和 `.vtt` 格式。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**：Windows、macOS (Apple Silicon) 或 Linux。\n  - *注意*：Intel Mac 和 Linux 用户需从源码安装。\n- **网络**：需要稳定的互联网连接（字幕将发送至服务商服务器）。\n- **运行环境（源码安装必需）**：\n  - Python 3.10+\n  - pip\n\n### 前置依赖\n- **API 密钥**：需准备至少一个 LLM 服务商的 API Key（如 OpenRouter, Google Gemini, DeepSeek, OpenAI 等）。\n  - **推荐**：对于国内开发者，**DeepSeek** 或 **OpenRouter**（可聚合多种模型）通常具有更好的访问稳定性和性价比。\n  - **注意**：Google Gemini 和 OpenAI 免费版可能存在区域限制或速度限制。\n\n## 安装步骤\n\n### 方式一：使用预编译包（推荐 Windows \u002F Apple Silicon Mac 用户）\n1. 访问 [Releases 页面](https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fllm-subtrans\u002Freleases) 下载对应系统的压缩包。\n   - Windows: `gui-subtrans-x.x.x.zip`\n   - macOS (ARM): `gui-subtrans-x.x.x.macos-arm64.zip`\n2. 解压到任意文件夹。\n3. 运行 `gui-subtrans` 启动图形界面，首次运行会引导配置基本设置。\n\n### 方式二：从源码安装（Linux \u002F Intel Mac \u002F 高级用户）\n\n1. **克隆仓库**\n   ```sh\n   git clone https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fllm-subtrans.git\n   cd llm-subtrans\n   ```\n\n2. **运行自动安装脚本**（最简单的方式）\n   - **Windows**:\n     ```cmd\n     install.bat\n     ```\n   - **macOS \u002F Linux**:\n     ```sh\n     .\u002Finstall.sh\n     ```\n   *脚本将自动创建虚拟环境，并引导选择安装 GUI 版本或仅命令行版本，同时支持配置特定服务商。*\n\n3. **手动配置（可选）**\n   若未使用脚本，需手动创建 `.env` 文件配置 API Key：\n   ```sh\n   # 在项目根目录创建 .env 文件\n   OPENROUTER_API_KEY=\u003Cyour_openrouter_api_key>\n   DEEPSEEK_API_KEY=\u003Cyour_deepseek_api_key>\n   # 其他服务商配置参考 README\n   ```\n\n   创建并激活虚拟环境：\n   ```sh\n   python -m venv envsubtrans\n   # Windows\n   .\\envsubtrans\\Scripts\\activate\n   # Mac\u002FLinux\n   source .\u002Fenvsubtrans\u002Fbin\u002Factivate\n   ```\n\n   安装依赖（按需选择）：\n   ```sh\n   # 最小化安装（仅命令行 + OpenRouter\u002F自定义服务）\n   pip install -e .\n   \n   # 完整安装（含 GUI 及主流服务商支持）\n   pip install -e \".[gui,openai,gemini,claude,mistral,bedrock]\"\n   ```\n\n## 基本使用\n\n### 图形界面 (GUI) - 推荐新手\n启动程序后，界面操作直观：\n```sh\ngui-subtrans\n```\n1. 加载字幕文件。\n2. 选择源语言和目标语言。\n3. 选择翻译服务商（Provider）及模型。\n4. 点击开始翻译，结果将保存为同名文件（附带目标语言后缀）。\n\n### 命令行 (CLI)\n适用于批量处理或自动化脚本。安装脚本会在根目录生成便捷的启动脚本，或直接使用以下命令：\n\n**基础示例（使用 OpenRouter 自动选择模型）：**\n```sh\nsubtrans-openrouter --auto input.srt --target-lang zh\n```\n\n**指定 DeepSeek 模型翻译：**\n```sh\nsubtrans-deepseek --model deepseek-chat input.srt --target-lang en\n```\n\n**参数说明：**\n- `input.srt`: 输入字幕文件路径。\n- `--target-lang`: 目标语言代码（如 `zh`, `en`, `ja`）。\n- `--model`: 指定具体模型名称（若不指定则使用默认值）。\n- 输出文件默认保存在原目录下，文件名格式为 `input_target_lang.srt`。\n\n*提示：翻译速度取决于所选模型的响应速度及批次大小设置。*","一位独立开发者需要将一部热门开源教程的英文 SRT 字幕快速本地化为中文，以便社区成员学习，但面临专业术语多、时间紧迫的挑战。\n\n### 没有 llm-subtrans 时\n- 只能依赖传统机器翻译接口，导致技术术语（如\"API 端点”、“异步回调”）翻译生硬甚至错误，严重影响观看体验。\n- 手动逐行校对和修正字幕格式耗时极长，处理一小时视频往往需要数天人工投入，严重拖慢发布进度。\n- 难以灵活切换翻译模型，若某家服务商对特定内容有限制或效果不佳，缺乏便捷的替代方案来优化结果。\n- 缺乏批量处理能力，面对多集系列视频时，重复的文件格式转换和上传操作让工作流程变得繁琐且易出错。\n\n### 使用 llm-subtrans 后\n- 通过配置 OpenRouter 或 Gemini 等高性能 LLM，准确识别并地道翻译专业技术词汇，确保字幕内容与原意高度一致。\n- 直接导入原始 SRT 文件一键完成翻译，自动保留时间轴和样式标签，将原本数天的工作量压缩至几分钟内完成。\n- 支持自由切换 DeepSeek、OpenAI 等多种后端模型，遇到敏感词拦截时可立即更换模型或调整策略，保证任务连续不中断。\n- 利用其插件化架构轻松处理 SSA\u002FASS 等复杂格式字幕，实现多集视频批量化流水线作业，大幅提升本地化效率。\n\nllm-subtrans 通过引入大语言模型的语义理解能力，将繁琐的字幕本地化工作从“人工修补”转变为“智能生成”，极大降低了开源内容的跨国传播门槛。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmachinewrapped_llm-subtrans_bff7a0d2.png","machinewrapped",null,"https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fmachinewrapped_a788934b.jpg","https:\u002F\u002Fgithub.com\u002Fmachinewrapped",[81,85,89],{"name":82,"color":83,"percentage":84},"Python","#3572A5",98.8,{"name":86,"color":87,"percentage":88},"Shell","#89e051",0.7,{"name":90,"color":91,"percentage":92},"Batchfile","#C1F12E",0.5,583,58,"2026-04-12T20:43:22","NOASSERTION","Windows, macOS, Linux","未说明 (主要基于云端 API，本地运行自定义服务器时依赖用户自有硬件，无特定型号要求)","未说明",{"notes":101,"python":102,"dependencies":103},"该工具主要调用云端大模型 API（如 OpenRouter, Gemini, OpenAI 等），因此必须保持网络连接。官方提供 Windows 和 macOS (Apple Silicon) 的预打包版本，Linux 及 Intel Mac 用户需从源码安装。若使用本地模型（如通过 LM Studio），性能取决于本地硬件，但官方不建议用于生产环境。安装时可选择仅命令行或包含图形界面 (GUI) 的版本。","3.10+",[104],"未明确列出具体库及版本 (通过 pip install -e . 自动安装)",[15,25],"2026-03-27T02:49:30.150509","2026-04-13T13:43:18.661901",[109,114,119,124,129,134],{"id":110,"question_zh":111,"answer_zh":112,"source_url":113},31545,"运行 gui-subtrans.cmd 时出现 'SyntaxError: f-string: expecting '}'' 错误怎么办？","该错误通常与 Python 版本兼容性有关。建议将 Python 版本回退到 3.11 版本即可解决。维护者已推送更新以增强兼容性，但如果问题依旧，请确保使用 Python 3.11。","https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fllm-subtrans\u002Fissues\u002F309",{"id":115,"question_zh":116,"answer_zh":117,"source_url":118},31546,"如何在 Unraid 上通过 Docker 安装并配合 Bazarr 使用？","Unraid 应用页面现已提供专用的 Docker 包。安装步骤如下：\n1. 确保 Unraid 服务器已安装 Docker。\n2. 在 Unraid 中安装 Bazarr 并配置媒体库字幕管理。\n3. 创建 Docker 容器：\n   - 创建目录：mkdir -p \u002Fmnt\u002Fuser\u002Fappdata\u002Fgpt-subtrans-gui\n   - 在该目录下创建 Dockerfile，基础镜像建议使用 FROM python:3.10。\n4. 配置 Bazarr 链接下载器（如 Transmission）和媒体管理器（如 Sonarr, Radarr）以实现自动字幕翻译。","https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fllm-subtrans\u002Fissues\u002F150",{"id":120,"question_zh":121,"answer_zh":122,"source_url":123},31547,"Linux 系统下 GUI 频繁崩溃（segfault）如何解决？","此问题在 Wayland 和 X11 会话下均可能出现，通常与 GUI 库稳定性有关。维护者已提交修复补丁，显著提高了稳定性。如果仍遇到崩溃，请尝试更新到最新版本。若问题持续，可暂时使用 CLI 模式进行翻译，或报告更多详细日志以便进一步排查。","https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fllm-subtrans\u002Fissues\u002F134",{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},31548,"调用 API 时遇到 '307 Temporary Redirect' 错误如何处理？","307 错误表示临时重定向。解决方法有两种：\n1. 修改代码启用 httpx 客户端的自动重定向功能（follow_redirects=True）。\n2. （推荐）直接使用 llm-subtrans 命令行工具，它内置了处理重定向的逻辑。命令示例：\nscripts\u002Fllm-subtrans.py \"$file\" --server https:\u002F\u002Fhk.xty.app --endpoint \u002Fv1\u002Fchat\u002Fcompletions --chat -l Chinese [...]\n该方式不依赖 OpenAI 官方库，能更好地处理 307 跳转。","https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fllm-subtrans\u002Fissues\u002F155",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},31549,"报错 'Failed to translate subtitles: No scenes to translate' 或解析 SRT 失败怎么办？","此错误通常由两个原因引起：\n1. SRT 文件格式错误或编码问题导致无法解析场景。请检查字幕文件是否损坏或格式标准。\n2. 使用的本地模型过小（如 qwen3:8b），导致无法正确识别场景或输出格式混乱。解决方案是更换更大的模型（如 qwen3:80b），或者在代码中启用 'no-thinking' 模式以减少推理干扰。此外，尝试调整 --maxbatchsize 参数也可能有帮助。","https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fllm-subtrans\u002Fissues\u002F289",{"id":135,"question_zh":136,"answer_zh":137,"source_url":133},31550,"字幕翻译后出现行不同步（row mismatch）的问题如何解决？","行不同步通常是因为模型太小或推理模式导致的。用户反馈表明，切换到更大的模型（例如从 qwen3:8b 升级到 qwen3:80b）可以完全解决此问题并提高速度。如果必须使用小模型，可以尝试修改代码加入 'no-thinking' 模式，或减小批量大小（--maxbatchsize），但最彻底的方案是升级模型。",[139,144,149,154,159,164,169,174,179,184,189,194,199,204,209,214,219,224,229,234],{"id":140,"version":141,"summary_zh":142,"released_at":143},238768,"v1.5.8","修复了使用自定义客户端实现的翻译提供商（OpenRouter、DeepSeek、自定义服务器）在错误处理中存在的一项问题：当与提供商通信时发生的任何错误都会被视作不可恢复，从而阻止对可能可恢复情况的重试。\n\n按惯例，已更新至最新版本的 SDK 和库。","2026-02-12T16:37:15",{"id":145,"version":146,"summary_zh":147,"released_at":148},238769,"v1.5.7","在 OpenAI 提供商设置中新增了“无”推理力度选项。请注意，此选项**仅**由 GPT-5.1 支持。\n\n与之相反，新的 `gpt-5.1-chat-latest` 模型仅支持“中等”推理力度。\n\n希望 OpenAI 未来的模型或 API 能不再如此脆弱 😓","2025-11-23T07:46:49",{"id":150,"version":151,"summary_zh":152,"released_at":153},238770,"v1.5.6","扩展了 OpenAI 理性推理模型客户端，以处理来自 API 的不同错误类型，从而在翻译请求失败时报告具有解释性和可操作性的错误信息。\n\n此外，OpenAI 的流式翻译功能现已默认关闭，因为流式输出理性推理模型的响应似乎需要经过验证的账户。感谢 Neoony 在诊断该问题上所做的努力！\n\n对于其他支持流式传输的提供商，流式传输仍保持默认启用状态，因为这一限制似乎仅适用于 OpenAI。","2025-10-11T08:15:27",{"id":155,"version":156,"summary_zh":157,"released_at":158},238771,"v1.5.4","更新了 OpenAI 推理客户端（用于 gpt-5、o3、o4），使其在请求中使用类型正确的参数。\n\n* 在 OpenAI 模型选择中添加了更多过滤条件，因为 API 现已提供一系列完全不适合用于翻译的 gpt-5-xxx 型号。\n\n* 修复了一个问题：当打开设置对话框时，模型设置会基于当前活动的模型，而非用户所选的模型，而这种设置可能会被项目设置覆盖。","2025-10-09T19:03:32",{"id":160,"version":161,"summary_zh":162,"released_at":163},238772,"v1.5.2","本次发布新增了对翻译 LLM 响应流式传输的支持，这样一来，翻译结果可以逐行实时更新，而无需等待整个批次处理完毕后再分批更新。目前支持流式传输的提供商包括：\n\n- OpenRouter（理论上所有模型）\n- OpenAI（仅限思考类模型，包括 GPT-5）\n- Gemini\n- Claude\n- DeepSeek\n\n在提供商设置中，如果相关选项可用，即可启用或禁用流式传输功能（默认已启用）。\n\n此外，本次发布还终于修复了一个长期存在的问题：场景视图会在每次翻译更新时自动重置——这在翻译过程中更新几乎持续进行的情况下显得尤为难以忍受。同时，在拆分或合并场景和批次时，程序也更加稳定。\n\n如果您好奇版本号为何直接跳到了 1.5.2，这是因为 1.5.0 是 [PySubtrans](https:\u002F\u002Fpypi.org\u002Fproject\u002Fpysubtrans\u002F) 的首发版本。[PySubtrans] 将 llm-subtrans 的核心功能封装为一个 Python 包，方便您将其集成到自己的项目中。\n\n此外，还附带了一个新的 [批量翻译脚本](https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fllm-subtrans\u002Fblob\u002Fmain\u002Fscripts\u002Fbatch-translate.py)，可用于执行大规模翻译任务，支持所有受支持的提供商。您只需下载该脚本并运行 `pip install pysubtrans` 即可使用，无需克隆整个仓库。","2025-09-29T20:08:53",{"id":165,"version":166,"summary_zh":167,"released_at":168},238773,"v1.4.0","这是项目长期演进的成果，旨在摆脱对 `srt` 库作为字幕内部表示的依赖，从而支持多种字幕文件格式。\n\n现在，系统在内部采用与格式无关的表示方式，并通过可插拔架构实现特定文件格式的读写功能。\n\nSSA\u002FASS 文件目前由 pysubs2 库提供支持。在读取文件时会提取样式、位置等元数据，在翻译过程中予以保留，并尽可能在输出中恢复。这意味着翻译后的字幕应能保持原有的外观。\n\n对于 VTT 文件，则使用自定义解析器来处理，仅提供有限的元数据提取支持——VTT 格式非常灵活，要完整保留所有元数据并不现实，因此复杂的元数据会直接传递给翻译模型，看其能否正确处理。具体情况因模型而异。\n\n理论上可以实现一种格式的读取与另一种格式的写入，但 LLM-Subtrans 主要是一款翻译工具，格式转换并非优先考虑的功能。如果只是将简单的 `.ass` 文件转换为 `.srt`，应该可以正常工作；但如果希望反向操作并保留样式等信息，则仍需借助功能完善的字幕编辑软件对翻译结果进行后期处理。\n\n此次更新对项目而言是一次重大变革（可以说是 v2.0），因此首次发布版本中难免存在一些问题。\n\n由于我平时不常使用 `.ssa`\u002F`.ass`\u002F`.vtt` 字幕，库中相关文件数量有限，这在一定程度上限制了我的测试能力。如果您遇到翻译结果与源文件不符的情况，请将相关文件发送至 machinewrapped@gmail.com，并附上具体问题描述，我会尽力优化改进！\n\n如果没有“机器人军团”的帮助，这一功能根本无法实现：Claude Code 和 Codex 承担了大量繁重的工作，而 Gemini 和 Copilot 则负责代码审查。\n\n**请注意**：如果您是从源码安装本仓库，在同步到最新版本时，需要重新运行安装脚本或手动执行 `pip install` 命令（详情请参阅 README 文档），因为安装流程已发生变化，且新增了一些依赖项。\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fllm-subtrans\u002Fcompare\u002Fv1.3.2...v1.4.0","2025-09-14T15:32:10",{"id":170,"version":171,"summary_zh":172,"released_at":173},238774,"v1.3.2","本次发布包含一些 minor 修复：\n- 确保在项目设置或全局设置中更改 OpenRouter 模型选择时，该选择在两者中都能保持有效；\n- 更好地处理 Gemini 的翻译拒绝响应（似乎某些主题或词汇会被屏蔽）。\n\n在底层，我们进行了一项大规模的工程，以启用 PyLance 的静态分析，并在整个代码中添加了类型注解和运行时类型检查。这将有助于在问题进入正式发布之前更早地发现并修复 bug，因为我们可以确保数据类型始终有效，而无需等到运行时才暴露问题。同时，单元测试也得到了扩展，覆盖了更多代码区域。\n\n理论上，终端用户不应感受到任何变化，除了可能更加稳定的版本之外。不过，正如任何涉及数千行代码的改动一样，初期仍可能会有一些需要调整的地方！\n\n预发布更新 1：修复了首次安装时出现的问题。\n预发布更新 2：修复了调试日志中的无效 f-string。\n发布后更新：修复了加载旧版 .subtrans 项目文件的问题。","2025-08-27T20:45:40",{"id":175,"version":176,"summary_zh":177,"released_at":178},238775,"v1.3.1","由于我们长期以来一直支持除 OpenAI 的 GPT 模型之外的众多其他提供商，因此当前的名称显得有些不妥。如今新增 OpenRouter 作为默认提供商，正是一个将名称正式更改为更具包容性的 LLM-Subtrans 的好时机。\n\n设置应会自动迁移到新的应用数据位置。\n\n仓库也将随之更名为反映新名称——这可能会引发一些混乱，不过还是 hopeful！内部方面，该应用现已在 Windows 上使用最新版本的 Python（3.13）。看起来 Microsoft Defender 对这一变更似乎有些敏感——希望只是暂时的（我已经提交了扫描请求）。\n\n此外，我们还推出了全新的 logo（由 Qwen3 创作）和图标集，以避免继续不当使用 Qt 自带的图标。\n\n\u003Cimg width=\"800\" height=\"800\" alt=\"LLM-Subtrans Logo (full size)\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F98fb77bd-a486-451c-ad21-63c4a634f9ef\" \u002F>","2025-08-16T12:51:30",{"id":180,"version":181,"summary_zh":182,"released_at":183},238776,"v1.3.0","新增了 OpenRouter 作为翻译服务提供商。OpenRouter 是一个聚合平台，只需一个 API 密钥即可访问多种模型。其中包含许多功能强大且免费使用的模型，例如：\n\n- `google\u002Fgemini-2.0-flash-exp:free`\n- `deepseek\u002Fdeepseek-chat-v3-0324:free`\n- `qwen\u002Fqwen3-235b-a22b:free`\n- `meta-llama\u002Fllama-3.1-405b-instruct:free`\n\n由于 OpenRouter 提供的模型种类繁多，模型列表按模型家族分组，默认情况下仅显示“Translation”（翻译）类别的模型——但这会排除许多实际上非常适合翻译任务的模型，包括大多数甚至全部的免费选项。\n\n您也可以选择让 OpenRouter 根据您在其仪表板中配置的标准自动选择要使用的模型，例如指定纳入或排除哪些提供商，以及是优先考虑价格还是速度。这是默认设置，但显然存在一定风险。\n\n如果您是从源代码安装，OpenRouter 不需要任何额外依赖项，现在已成为 `llm-subtrans` 的默认提供商。","2025-08-15T15:27:31",{"id":185,"version":186,"summary_zh":187,"released_at":188},238777,"v1.2.0","** 重新发布，修复了英文本地化问题 **\n\n新增对 GPT-5 系列模型 `gpt-5`、`gpt-5-mini` 和 `gpt-5-nano` 的支持。这些模型需要使用 OpenAI 较新的 Responses API，而非旧版的 Chat API，因此客户端已相应更新。同时，我们更新了[文档](https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fgpt-subtrans\u002Fwiki#which-model-should-i-use)，提供了关于应选用哪种模型的建议——剧透一下：_千万别用 gpt-5-nano_！\n\n我一直想为 GPT-Subtrans 添加多语言本地化功能，这样用户就可以用自己的语言来使用它了。此外，这也正好是一个尝试 AI 代理工作流的好机会。因此，这项功能是由以下几位“成员”共同协作完成的：\n- Claude Code\n- Cursor Agent\n- Github Copilot Agent\n- Gemini Code Assist（主要担任审阅角色）\n- Gemini 2.5 Pro（负责翻译）\n- ChatGPT（负责翻译）\n- @machinewrapped（主要提供 API 费用，并在 Gemini 反复无法写出可用代码时与之同甘共苦）\n\n目前先提供西班牙语和捷克语的本地化支持；我们也鼓励广大用户为自己的语言环境贡献本地化内容。如果你可以从源码安装，整个流程非常简单，具体说明请参阅 docs\u002Flocalization_contributing.md 文件。我暂时没有计划自行添加更多语言，但如果有人愿意自愿测试，或许我会考虑采纳。\n\n需要注意的是，这次的 Pull Request 总共包含了超过 10,000 行代码，其中绝大多数由 AI 编写，因此初始版本中可能会存在一些 bug。不过，常规的加载、翻译和编辑等操作都已经经过测试并可以正常运行。\n\n## 变更内容\n* 修复：`summary` 标签自动闭合功能损坏。由 @zorbathut 在 https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fgpt-subtrans\u002Fpull\u002F247 中完成。\n* 在截断文本后添加换行符。由 @machinewrapped 在 https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fgpt-subtrans\u002Fpull\u002F248 中完成。\n* 自定义服务器的超时时间可配置。由 @machinewrapped 在 https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fgpt-subtrans\u002Fpull\u002F249 中完成。\n* 增加对 GPT-5 的支持。由 @machinewrapped 在 https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fgpt-subtrans\u002Fpull\u002F256 中完成。\n* 添加本地化支持。由 @machinewrapped 在 https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fgpt-subtrans\u002Fpull\u002F257 中完成。\n\n## 新贡献者\n* @zorbathut 在 https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fgpt-subtrans\u002Fpull\u002F247 中完成了首次贡献。\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fgpt-subtrans\u002Fcompare\u002Fv1.1.2...v1.2.0","2025-08-12T18:47:39",{"id":190,"version":191,"summary_zh":192,"released_at":193},238778,"v1.1.2","Fixed a random crash when writing to the log window, it's been there for a long time but became much more likely to crash in recent versions after an update to the Qt GUI library - particularly when opening a project file.","2025-05-10T12:40:07",{"id":195,"version":196,"summary_zh":197,"released_at":198},238779,"v1.1.1","Minor fix: the new task_type field for custom instructions was not being saved to the instruction file when saved via Edit Instructions.","2025-04-23T20:05:31",{"id":200,"version":201,"summary_zh":202,"released_at":203},238780,"v1.1.0","Updated the \"Improve Quality\" instructions to include multilingual examples, to show the model that it isn't expected to translate to English.\r\n\r\nMade the request\u002Fresponse format more flexible, so that the model isn't required to respond with a \"Translation\" for each line, to further emphasize the nature of the task.\r\n\r\n*update* Updated the release to include the task type in the Edit Instructions dialog so that it can be checked\u002Fchanged.\r\n\r\nKnown issue: Sometimes the GUI crashes when loading a project. It seems to be most likely on first run.\r\n\r\n## What's Changed\r\n* Added Task type to instructions files by @machinewrapped in https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fgpt-subtrans\u002Fpull\u002F236\r\n* Updated dependencies to latest versions\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fgpt-subtrans\u002Fcompare\u002Fv1.0.9...v1.1.0","2025-04-18T11:52:07",{"id":205,"version":206,"summary_zh":207,"released_at":208},238781,"v1.0.9","Added support for Claude 3.7 Sonnet with extended thinking mode - enable \"Thinking\" in the provider options and specify the number of tokens Claude is allowed to use for thinking. Maximum output tokens have been increased from 4096 to 8192 with Claude 3.7 so that setting can be increased, and some tokens set aside for thinking (minimum is 1024).\r\n\r\nIf thinking is enabled the model's thoughts for each batch can be seen by double-clicking the batch and selecting the \"Reasoning\" tab.\r\n\r\n![image](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fb8dc4c75-35d6-48dd-9aa3-d8b809ae94fe)\r\n\r\nThe Claude API doesn't indicate which models support thinking so you'll need to manually disable Thinking in settings if you go back to one of the earlier Claude models.\r\n\r\nWith this release the available models are finally retrieved from the Claude API instead of being baked into the app. Any previous model setting will be reset because it now uses user-friendly model names rather than their IDs.\r\n","2025-03-03T15:20:09",{"id":210,"version":211,"summary_zh":212,"released_at":213},238782,"v1.0.8","Fixed a regression where the \"Edit Instructions\" button would reset the instructions to default.\r\n\r\n+ Gemini could potentially return multiple response candidates so try to at least choose one that has content.  Also handles responses with no content more gracefully, if there are none that do. This _probably_ implies Gemini is censoring the request for that batch.\r\n","2025-02-19T17:34:30",{"id":215,"version":216,"summary_zh":217,"released_at":218},238783,"v1.0.7","NEW: repackaged the Windows zip because of a false positive on some Antivirus software. Includes some tweaks to the themes.\r\n\r\nRenamed \"Local Server\" provider to \"Custom Server\" - it was never a requirement that the server be local, so this makes it clearer that the provider can be used with any OpenAI-compatible API.\r\n\r\nAdded a max_completion_tokens option for Custom Server, since OpenAI are no longer accepting max_tokens for some of their own models. You should probably set one or the other or neither, not both.\r\n\r\nPlus several arguably more important fixes for non-Windows platforms:\r\n- Fixed the MacOS package builder\r\n- Updated to latest PySide6 GUI modules\r\n- Force the Qt theme to Fusion Light, for cross-platform compatibility with app themes\r\n- Added a light Large theme\r\n\r\nRemoved boto3 from the packaged build to reduce the size - Bedrock is pretty niche, and if you can handle setting up AWS then you can definitely handle installing gpt-subtrans from source!","2025-02-15T10:09:25",{"id":220,"version":221,"summary_zh":222,"released_at":223},238784,"v1.0.6","Some of the APIs are unreliable at the moment so requests quite often need to be retried. I've cleaned up the retry mechanism for OpenAI-based clients (which includes DeepSeek) and fixed the Gemini retry so that both will retry in the event of the common API failures I am seeing.\r\n\r\nI also added a reuse_client option for DeepSeek that defaults to False, meaning that a new connection will be established for each translation request. I noticed that the first request succeeds much more often than the second+ - creating a new client for each request seems to improve the odds of it being successful.\r\n\r\nI also updated the custom instructions for OCR Errors and Whisper to match the format of the newer default instructions, as in my experience it seems to produce better results than the older instructions.\r\n\r\nA MacOS version will be provided if I can get it to build, otherwise check previous versions to find one or install from source.","2025-02-13T17:21:25",{"id":225,"version":226,"summary_zh":227,"released_at":228},238785,"v1.0.5","* Enables OpenAI's reasoning models, o1 and o3, for translation. \r\n* Switched to Google's newer **genai** SDK to enable support for Flash Thinking models\r\n* Extracts reasoning content from the **deepseek-reasoner** model.\r\n* Adds a new option under the OpenAI provider settings, **reasoning effort** - options are low, medium and high.\r\n* Adds a max_toxens setting for DeepSeek, enabling generation of the full 8192 output tokens the model supports, rather than the default 4096.\r\n* Changed the default temperature for DeepSeek to 1.3, which is what they recommend for translation (not sure why, seems high to me!)\r\n\r\nSince reasoning models are tuned for reasoning they may score lower for \"creative\" tasks like translation. However, they may perform better with subtitles that contain OCR or transcription errors.\r\n\r\nNote that there are additional costs with reasoning models in the form of reasoning tokens that do not form part of the final translations. The number of reasoning tokens generated is extracted from the response when available and can be viewed by double-clicking a translated batch and selecting the \"Response\" tab. \r\n\r\nIf the reasoning content is included in the response there will also be a Reasoning tab so you can see how the model thought about translating the subtitles with the provided context. This is currently only available for DeepSeek as the other providers do not expose the model's reasoning in the API.\r\n\r\n_Line 35: \"一向是穿寬鞋賣大布\" → \"have always walked tall and proud,\" The idiom here is tricky. \"穿寬鞋賣大布\" literally is \"wear wide shoes and sell big cloth,\" but idiomatically, it might mean acting confidently or with swagger._ \r\n\r\n_Line 59: \"2.\" – probably a scene number or a typo. Since subtitles don't usually have just numbers, maybe it's a misplaced line or part of a previous sentence. Maybe it's a misread of \"二\" (two), but in context, perhaps it's a card in a game, like \"Two.\" But the next lines are about gambling (\"梭\" is \"all-in\" in poker). So maybe line https:\u002F\u002Fgithub.com\u002Fmachinewrapped\u002Fgpt-subtrans\u002Fpull\u002F59 is \"2.\" referring to a card, so translated as \"Two.\"_\r\n\r\n_Line 66: \"今晚可以財色兼收了\" – \"財色兼收\" means to obtain both wealth and beauty. So \"Tonight I'll get both wealth and women!\" fits the character's boastful tone._\r\n\r\no1 and o3 support a reasoning effort setting (available in the GUI settings when a reasoning model is selected). Higher effort implies higher hidden costs in the form of reasoning tokens.\r\n\r\nNOTE: No MacOS release for this version due to PyInstaller issues **again**. Use version 1.0.4 or install from source.","2025-02-03T20:43:05",{"id":230,"version":231,"summary_zh":232,"released_at":233},238786,"v1.0.4","tl;dr - changing the model in project settings should work correctly now.\r\n\r\nFixed selected model being reset when opening project settings.\r\nFixed selected model not being updated in project settings immediately, causing the selection to be ignored if it was reselected.\r\nFixed provider\u002Fmodel changes not being committed when using \"Translate Selection\" with project settings open.\r\nFixed invalid index being set if the model saved in a project is no longer available from the provider.","2025-02-03T20:02:40",{"id":235,"version":236,"summary_zh":237,"released_at":238},238787,"v1.0.3","Made Amazon Bedrock available as a translation provider. Note that this is NOT recommended for most users. The AWS setup process is a lot more complicated than getting an API key for other providers, and the available models (which depend on the AWS region) may or may not be able to handle translation tasks well or at all.\r\n\r\nHowever, if you are used to using AWS and Bedrock, the option is now there. Let us know in the discussions section if you find any of the models it offers particularly good for translation.\r\n\r\nIt won't be receiving much official support, so any fixes or improvements might be best handled by the community of people who actually use it (if any!).","2025-01-26T11:15:38"]