seconv: add the advanced local-LLM translate engines (batches with rolling context)

Open
#16,373 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@Makar8000 is already working on this.

Since Nov 3, 2026.

  • #16607 by @Makar8000 — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
54/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
backend, cli

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-prompt option, 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: IBatchContextTranslator and the translator is IBatchContextTranslator branch in DoAutoTranslate, which seconv already uses.
  • The engines live in src/ui/Features/Translate/LlamaCppAdvanced/: AdvancedTranslatorBase, LlamaCppAdvancedTranslate, OllamaAdvancedTranslate, LmStudioAdvancedTranslate, LlamaCppAdvancedClient and LlamaCppAdvancedProtocol. seconv doesn't reference the UI project, and SupportedEngines lists only the regular engines.
  • The ties to the GUI look small:
Proposal
  1. 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.
  2. Expose them in seconv, for example:
    • --translate-engine llamacpp-advanced | ollama-advanced | lmstudio-advanced, where llamacpp-advanced auto-starts llama-server like llamacpp does 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 --settings JSON

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: MaxCharacters is 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SubtitleEdit/subtitleedit

All issues in SubtitleEdit/subtitleedit

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.