Skip to content

Translation & LLM

Sublarr supports optional subtitle translation. Translation is off by default and is treated as an experimental feature — turn it on only if you need it. Backends fall into two camps:

  • Cloud backends (DeepL, Claude, Gemini, OpenAI, DeepSeek, Mistral, Google, Azure, MyMemory) — currently the most reliable choice for production-grade output. Subtitle text leaves your server.
  • Ollama (local LLM) — fully offline, no API keys, no data egress. Quality is improving but still rough at the edges; use general-purpose models like qwen2.5:14b or llama3.1:8b.

Translation ships disabled. To turn it on:

  1. Open Settings and select Translation in the left-hand settings navigation.
  2. On the Translation page, click Translation aktivieren (“Enable translation”) in the beta banner at the top.
  3. The page switches to its full configuration view — pick and configure a backend below.

To turn it back off later, use the Disable Translation button at the bottom of the same page.

Install Ollama on the host that runs Sublarr (or on a reachable LAN host), pull a general-purpose model, then point Sublarr at it:

Terminal window
ollama pull qwen2.5:14b-instruct
# or, lighter:
ollama pull llama3.1:8b-instruct

Set in Settings → Translation → Backends → Ollama:

FieldExample
Endpoint URLhttp://ollama:11434
Modelqwen2.5:14b-instruct

Sublarr ships 12 translation backends. Configure them in Settings → Translation Backends. Every backend records per-call cost, latency and token usage; visit Settings → Translation → Cost & Memory to compare.

BackendTypeSelf-HostedAPI KeyBest For
OllamaLocal LLMYesNoFull control, custom prompts, GPU-accelerated
OpenAI-compatibleLLMBothYesGPT-4 / local OpenAI-compatible endpoints
OpenAI ChatGPTLLM APINoYesGPT-4o / GPT-4-turbo via official endpoint
Anthropic ClaudeLLM APINoYesHigh-quality long-context translation
Google GeminiLLM APINoYesFast Gemini 2.x with native multilingual support
DeepSeekLLM APINoYesCost-effective Chinese-LLM provider
MistralLLM APINoYesEU-hosted LLM, GDPR-friendly
DeepLNMT APINoYesHighest-quality NMT for EU languages
Google TranslateNMT APINoYesBroad language support, fast
LibreTranslateNMT APIYesOptionalSelf-hosted, privacy-focused fallback
Azure TranslatorNMT APINoYesEnterprise-grade NMT with regional endpoints
MyMemoryNMT APINoOptionalFree tier, useful as zero-cost fallback

Configuring Ollama (Default):

  1. Install Ollama on your server
  2. Pull a model: ollama pull qwen2.5:14b-instruct
  3. In Sublarr: Settings > Translation Backends > Ollama
  4. Enter your Ollama URL and model name
  5. Click Test to verify

Fallback Chains: Configure backup backends in case your primary fails. Example:

  1. Primary: Ollama (local, fast, free)
  2. Fallback 1: DeepL (cloud, high quality)
  3. Fallback 2: LibreTranslate (self-hosted backup)

See Settings → Translation → Ollama Chat API for the full reference including how to configure system prompts and series context injection.

Settings → Translation → Prompt Presets

Prompt presets let you save and reuse prompt templates across translation backends. Sublarr auto-creates one default preset on first run. The marked-default preset is what get_prompt_template() loads; switching a preset to default takes effect immediately for the next translation job without restarting.

Each preset is a free-form text field. Two variables are substituted at load time:

VariableReplaced with
{source_language}Full name of the source language (e.g. English)
{target_language}Full name of the target language (e.g. German)

For Ollama in Chat API mode, the system prompt field additionally supports:

VariableReplaced with
{series_context}Show synopsis from Sonarr/Radarr metadata, if available

Settings → Translation → Backends → Episode Context

When enabled, Sublarr prepends the subtitle text from one or more previous episodes as context, giving the LLM enough dialogue history to keep character voice, pronouns, and proper nouns consistent across an entire series.

SettingDefaultValuesEffect
Use Episode ContextOfftoggleInclude prior-episode subtitles as translation context
Context Episodes11–5How many previous episodes to draw context from
Auto Series GlossaryOfftoggleAutomatically extract a per-series glossary from existing translated subtitles

Settings → Translation → Backends

The “Global LLM Request Settings” card exposes controls that apply to all LLM backends as fallback defaults:

SettingDefaultRangeEffect
Request Timeout90 s10–600Seconds before an in-flight LLM API call is killed; raise for slow local models or large batches
Backoff Base5 s1–60Base interval for exponential back-off between retry attempts

Additional global tuning knobs exist in the underlying settings store (not directly exposed in this card):

SettingDefaultValuesEffect
temperature0.30.0–1.0Sampling temperature; lower = more deterministic output
max_retries3integerRetry attempts before a batch is considered failed
translation_max_workers4integerParallel worker threads in the translation job queue
batch_size15integerSubtitle lines sent per LLM request

LLM backends receive surrounding lines as read-only context to improve pronoun resolution and terminology consistency across batch boundaries. This is controlled by three settings:

SettingDefaultRangeEffect
Context WindowOntoggle (translation_context_enabled)Enable/disable lookback+lookahead entirely
Lookback lines100–50 (translation_context_lookback_lines)Lines before each batch shown as context only
Lookahead lines50–50 (translation_context_lookahead_lines)Lines after each batch shown as context only

Each line of context adds approximately 6 extra tokens. At the defaults (10 + 5 = 15 context lines, 15-line batches) this costs roughly 90 additional tokens per request — negligible for cloud APIs but noticeable on small local models.

Non-LLM backends (DeepL, Google Translate, LibreTranslate, Azure, MyMemory) ignore all context-window settings.

Practically: if you want to give your Ollama instance a 300 s timeout without touching other backends, expand the Ollama card, set Timeout to 300, and save. The global timeout remains 90 s for any backend you have not individually configured.