JohnXu22786/subtitle-studio0

subtitle-studio

Multi-language subtitle translation workflow for dsh: SRT/VTT parsing, sentence-level LLM translation, bilingual merge, alignment validation, and batch processing.

包名
subtitle-studio
版本
0.1.0
许可证
MIT
最近更新
2026年8月23日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:JohnXu22786/subtitle-studio

3. Plugin configuration

The plugin reads the config object of its patch row (and any profile override). Keys:

keytypedefaultmeaning
llm.provider"openai"|"dsh""openai"HTTP backend vs. harness ctx.llm seam
llm.baseUrlstringhttps://api.deepseek.com/v1OpenAI-compatible endpoint
llm.apiKeystringAPI key; supports ${ENV_VAR} expansion
llm.modelstringdeepseek-chatmodel name
llm.timeoutMsnumber120000per-request timeout
llm.maxRetriesnumber2retries on transient failures
llm.jsonModebooleantruerequest a JSON object response
llm.chunkCharsnumber3500cue-character budget per request
sourceLanguagestring"" (auto)source language tag
targetLanguagesstring[][]target languages for translation
glossary.pathsstring[][]glossary JSON files (merged)
output.layoutstacked|interleavedstackedbilingual merge layout
output.separatorstring""line between original & translated blocks
output.tagTargetstringper-line tag prefix for translated lines
output.formatsrt|vttkeep sourceoutput container format
output.utf8Bombooleanfalsewrite a UTF-8 BOM
batch.concurrencynumber2parallel files during batch
batch.maxRetriesnumber2per-file retries
batch.checkpointstringsubtitle-studio.checkpoint.jsoncheckpoint path
validation.maxCharsnumber160CJK over-long cue threshold
validation.maxWordsnumber40Latin 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 calls ctx.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).