JohnXu22786/subtitle-studio ↗★ 0
subtitle-studio
Multi-language subtitle translation workflow for dsh: SRT/VTT parsing, sentence-level LLM translation, bilingual merge, alignment validation, and batch processing.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:JohnXu22786/subtitle-studio说明文档
阅读完整 README ↗3. Plugin configuration
The plugin reads the config object of its patch row (and any profile
override). Keys:
| key | type | default | meaning |
|---|---|---|---|
llm.provider | "openai"|"dsh" | "openai" | HTTP backend vs. harness ctx.llm seam |
llm.baseUrl | string | https://api.deepseek.com/v1 | OpenAI-compatible endpoint |
llm.apiKey | string | — | API key; supports ${ENV_VAR} expansion |
llm.model | string | deepseek-chat | model name |
llm.timeoutMs | number | 120000 | per-request timeout |
llm.maxRetries | number | 2 | retries on transient failures |
llm.jsonMode | boolean | true | request a JSON object response |
llm.chunkChars | number | 3500 | cue-character budget per request |
sourceLanguage | string | "" (auto) | source language tag |
targetLanguages | string[] | [] | target languages for translation |
glossary.paths | string[] | [] | glossary JSON files (merged) |
output.layout | stacked|interleaved | stacked | bilingual merge layout |
output.separator | string | "" | line between original & translated blocks |
output.tagTarget | string | — | per-line tag prefix for translated lines |
output.format | srt|vtt | keep source | output container format |
output.utf8Bom | boolean | false | write a UTF-8 BOM |
batch.concurrency | number | 2 | parallel files during batch |
batch.maxRetries | number | 2 | per-file retries |
batch.checkpoint | string | subtitle-studio.checkpoint.json | checkpoint path |
validation.maxChars | number | 160 | CJK over-long cue threshold |
validation.maxWords | number | 40 | Latin over-long cue threshold |
Example patch override (in the profile's own cordis.patch.yml, whole-row
config replacement — see the dsh docs on patch layer semantics):
- id: subtitle-studio
config:
llm:
provider: openai
baseUrl: https://api.deepseek.com/v1
apiKey: ${DEEPSEEK_API_KEY}
model: deepseek-chat
sourceLanguage: en
targetLanguages: [zh, ja]
output:
layout: stacked
To use the harness's own LLM provider (e.g. the DeepSeek adapter configured in the harness), set
llm.provider: dsh. The plugin then callsctx.llm.stream.
Configuration
The CLI mirrors the dsh plugin configuration (see the table above) through
--config or flags. API keys can reference environment variables:
node bin/subtitle-studio.js translate a.srt --target zh --api-key "${env:DEEPSEEK_API_KEY}"
Prices in the cost estimator are approximate list prices keyed by model
(deepseek-chat, deepseek-reasoner) and are always overridable with
--rate-in/--rate-out (or llm config equivalents).