seconv: add the advanced local-LLM translate engines (batches with rolling context)
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 54/100
Research direction
Start with src/seconv/Core/AutoTranslateRunner.cs to see how engines and command-line options are registered, then trace the existing batch-context path through src/libuilogic/Translate/IBatchContextTranslator.cs and DoAutoTranslate. Compare those interfaces with the advanced engines under src/ui/Features/Translate/LlamaCppAdvanced/, including how settings and row updates are handled. Done means seconv can use the advanced local engines for batch translation with rolling context and the requested optional translation settings.
Written by the indexing model from the issue text.
Description
Feature request
Please make the advanced local-LLM translate engines (llama.cpp, Ollama, LM Studio) available in seconv.
In the GUI, these engines translate numbered batches of lines with a rolling history of already-translated lines, plus an optional synopsis, glossary and formality, and a JSON schema keeps every line in place. seconv only offers the regular engines, so unattended batch translation from the command line gets none of that context.
Why
Batch translation is what seconv is for, but with --translate-engine llamacpp it goes through LlamaCppTranslate and MergeAndSplitHelper:
- A request holds at most 1000 characters (
MaxCharacters, counted URL-encoded, so every space, punctuation mark and non-ASCII character counts as three). - Nothing carries over from one request to the next.
- When a merged reply can't be split back, it falls back to one line per request, with no context at all.
The rolling history and the synopsis/glossary are what keep names, terms and tone consistent across a whole file, and batch runs are where that matters most.
Current state (5.4.0-beta5, and main at d4aaa1c)
- The 5.2.0 changelog says the new advanced engines are "also in batch convert and seconv (--translate-prompt)". For seconv, that means only the
--translate-promptoption, which applies to the regular engines. The advanced engines themselves went into the GUI's Batch convert window (#13678), and #13694 notes that seconv "has no advanced engine". - The batch path is already in libuilogic:
IBatchContextTranslatorand thetranslator is IBatchContextTranslatorbranch inDoAutoTranslate, which seconv already uses. - The engines live in
src/ui/Features/Translate/LlamaCppAdvanced/:AdvancedTranslatorBase,LlamaCppAdvancedTranslate,OllamaAdvancedTranslate,LmStudioAdvancedTranslate,LlamaCppAdvancedClientandLlamaCppAdvancedProtocol. seconv doesn't reference the UI project, andSupportedEngineslists only the regular engines. - The ties to the GUI look small:
- Settings are read from
Se.Settings.AutoTranslate.LlamaCppAdvanced(AdvancedTranslatorBase L74, L150, L245; LlamaCppAdvancedClient L200). - Two row updates go through
Dispatcher.UIThread.Invoke(L79, L122).MergeAndSplitHelperalready solves the same thing with its optionalapplyRowUpdatecallback.
- Settings are read from
Proposal
- Move the engine classes (not the settings window) into libuilogic, with the settings passed in and an optional row-update callback in place of the dispatcher.
- Expose them in seconv, for example:
--translate-engine llamacpp-advanced | ollama-advanced | lmstudio-advanced, wherellamacpp-advancedauto-starts llama-server likellamacppdoes when there's no--translate-url--translate-batch-size <n>(default 10) and--translate-history <n>(default 12)--translate-synopsis <text or file>and--translate-glossary <text or file>, read like--translate-prompt--translate-formality default|formal|informal- the same keys in the
--settingsJSON
This proposal and the argument names are only suggestions. The core of this feature request is to have access to the advanced local-LLM translate features in seconv.
Alternatives considered
- A larger request size for the regular engine:
MaxCharactersis fixed at 1000, and bigger requests still wouldn't carry context from one to the next. - Calling llama-server directly from outside Subtitle Edit: that would mean re-implementing the batch protocol, echo guard and line alignment that Subtitle Edit already has.
Disclaimer: this issue was drafted with an AI assistant (Claude Opus 5.5, max effort). The code references point to main at d4aaa1c and were checked against that source.
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 1.4k
- Avg merge
- 57m
- Merged PRs (30d)
- 637
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SubtitleEdit/subtitleedit
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
SubtitleEdit/subtitleedit#16638 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
SubtitleEdit/subtitleedit#16614 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
SubtitleEdit/subtitleedit#16374 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
SubtitleEdit/subtitleedit#14510 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
SubtitleEdit/subtitleedit#16624 ·
Maintainers usually reply within 1 day
All issues in SubtitleEdit/subtitleedit
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
Unity-Technologies/unity-agent-plugin#118 ·
Maintainers usually reply within 1 day
-
The Recommended preset turns on Import Uno DSP, which only works with the Material themePossibly taken @agneszitte claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
unoplatform/uno.templates#2388 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
eyalgolan/statecraft-israel#2732 ·
Maintainers usually reply within 1 day
-
要トリアージ
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
kind/chore status/draft
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Altinn/altinn-events#1158 ·
Maintainers usually reply within 1 day