Translate SRT/VTT/TSV via a local LLM (Ollama-compatible). CLI-first; stdlib-only core.
Project description
Subsetzer
Subsetzer is a stdlib-only subtitle translation toolkit that talks to an
Ollama-compatible LLM running on your LAN. Feed it .srt, .vtt, or .tsv
files, choose the target language, and it handles parsing, chunking, and
translation. The CLI stays faithful to the former setzer tool, but now ships
under a new name ready for PyPI.
Features
- Translate SRT, VTT, and TSV subtitle files via Ollama-compatible APIs.
- Keep bracketed tags (like
[MUSIC]) intact with--no-translate-bracketed. - Chunk large transcripts with configurable
--max-charsand--cues-per-request. - Output SRT, VTT (with NOTE block including model + timestamp), or TSV files.
- Run with
pipx, inside a virtual environment, or directly from source.
Installation
pipx install subsetzer
# or
pip install subsetzer
Ensure you have an accessible Ollama server (default http://127.0.0.1:11434)
with a compatible model pulled (default gemma3:12b).
CLI Usage
subsetzer --in input.srt --out ./out --target "German"
Useful flags (all mirrored from the previous CLI):
--outfmt {auto,srt,vtt,tsv}to override the output format.--outfile TEMPLATEto customise the output path (placeholders:{basename},{dst},{fmt},{src},{ts},{model}). The default template now adds the model slug so parallel runs stay separate.--cues-per-request/--batch-per-chunkto batch cues per LLM call.--llm-mode {auto,chat,generate}to force the Ollama API flavour.--stream/--no-stream,--timeout,--no-llm,--debugbehave as before.
Run subsetzer --help for the full flag list.
Environment Variables
Subsetzer understands both the new SUBSETZER_* variables and the legacy
HOMEDOC_* names. The new aliases take precedence when both are set.
| Variable | Description | Default |
|---|---|---|
SUBSETZER_LLM_SERVER / HOMEDOC_LLM_SERVER |
Ollama server URL | http://127.0.0.1:11434 |
SUBSETZER_LLM_MODEL / HOMEDOC_LLM_MODEL |
Model tag | gemma3:12b |
SUBSETZER_LLM_MODE / HOMEDOC_LLM_MODE |
auto, chat, or generate |
auto |
SUBSETZER_STREAM / HOMEDOC_STREAM |
Enable streaming | True |
SUBSETZER_HTTP_TIMEOUT / HOMEDOC_HTTP_TIMEOUT |
Timeout in seconds | 60 |
SUBSETZER_CUES_PER_REQUEST / HOMEDOC_CUES_PER_REQUEST |
Batch size | 1 |
SUBSETZER_TZ / HOMEDOC_TZ |
Timezone for timestamped folders | local time |
Development
Clone the repository and install in editable mode:
pip install -e packages/subsetzer
pytest packages/subsetzer/tests
Subsetzer ships with type hints (py.typed) and avoids third-party dependencies.
License
GPL-3.0-or-later — see LICENSE for full details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file subsetzer-0.1.4.tar.gz.
File metadata
- Download URL: subsetzer-0.1.4.tar.gz
- Upload date:
- Size: 26.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3deb65f824942149ce60b6d0f5629b5a23b0400971521c7905dc5768a3bdd180
|
|
| MD5 |
9149d0d2344cae378a8f7412c55677df
|
|
| BLAKE2b-256 |
9944b4a22e0a06e93637b409d92d0fb83e0af22d733458cbac6fdd32b3d9d214
|
File details
Details for the file subsetzer-0.1.4-py3-none-any.whl.
File metadata
- Download URL: subsetzer-0.1.4-py3-none-any.whl
- Upload date:
- Size: 31.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af12e42efb2c71ed7d9400b0b614cd33b26e67c4d6948ebd2e58c02689db22ef
|
|
| MD5 |
2fa90822e656bd213f6e8a24b685ac87
|
|
| BLAKE2b-256 |
1394044ec59d8b84e846b19559dc8c6afe638f8250f12caaf876e7afe304de62
|