Optional translation fallback¶
Fallback is off by default. Configure and enable it once in Settings → Translation to apply it to all monitored series with missing books or chapters, including series added later. There is no per-series translation switch. The series language remains the destination language. Source languages are selected automatically: any language supported by the processing backend can supply a missing book or chapter. There is no language list to maintain. The deprecated global source-language setting is kept for old clients and does not restrict acquisition. Per-series translation switches and language lists are removed on upgrade; existing jobs and files are preserved.
Tankarr considers known sources in every language on every pass. It prefers an already downloaded source, then the original language, identity match, availability and download size. After the series language has been searched, every other language of an already enabled source is searched in the same pass. The languages chosen under Settings → General are the library's final languages only: they do not filter that search, and a language that merely appears in the product's language list is not a second destination. When the source catalogue cannot be listed, provider discovery still rotates through at most three languages per pass; the cursor survives restarts so a language is not permanently excluded. A local processor only selects languages its OCR supports. External processors remain responsible for validating their supported language pairs.
Automatic processing (default)¶
Enter the AI provider API base URL, model and API key. No translation processor URL or token is required. Tankarr runs local Tesseract OCR and basic lettering, one job at a time, and sends recognized dialogue to the compatible chat API. The Docker image includes Tesseract's language models and DejaVu Sans. Native installations need Tesseract in PATH, the source-language models, and DejaVu Sans installed as a system font. Missing prerequisites produce an actionable job error.
This is a basic CPU renderer: it places the translation in white rectangles over recognized text. It does not reconstruct artwork or provide manga-specific neural OCR. It supports Latin, Greek and Cyrillic destination text; complex pages and other destination scripts need an external processor. Unrecognized dialogue can remain in the original language. Language and archive checks cannot prove that OCR found every text region or that the lettering is good. Review representative pages before enabling a large queue.
Completed local pages are checkpointed in Tankarr's staging directory. Restarting resumes from those pages; a provider call interrupted before its checkpoint may be repeated. Changing the source, languages, model or endpoint invalidates the checkpoint. Pausing or cancelling stops the local operation; any request already sent to the AI provider may still be billed. Checkpoints and sources are retained for retry, and removed after successful import. Incomplete output is removed on handled interruption or failure. No separate service is needed.
Advanced settings offer an External processor URL and access token for an optional compatible service. A nonempty URL selects it instead of local OCR; clear the URL to return to local processing. The processor token authenticates Tankarr to that service and is separate from the AI provider key. Never enter your Tankarr login in these fields.
Tankarr searches the series language first. A release in that language is downloaded as usual. When no usable release in the series language exists for a missing chapter or book, and translation is enabled, Tankarr may take a source in any other language and translate it into the series language. A Suwayomi source in another language can be mapped for that purpose. When translation is off, a source that does not offer the series language is still refused, and nothing is acquired from another language.
Monitored missing slots without an obtainable native release can use a verified foreign source with matching chapter or book numbering. Existing identity and numbering checks apply to discovery; foreign releases are not marked for ordinary downloads. Up to ten translations are queued per series per Wanted pass, with at most two external processor jobs outstanding or one local job running. The original archive stays in staging. Only a validated translation enters the library, with its source hash, AI model and machine translation provenance in ComicInfo. A translated book does not retire human chapter files.
The series page lists jobs, permits retries and cancellation, and accepts a source CBZ assigned to one book or chapter. Use this for a source archive obtained through another channel, checking that its numbering matches the managed edition. Packs must first be separated into their individual books. Native library imports keep their usual language rules.
When Prowlarr is enabled, fallback searches its configured indexers once per
title for explicitly numbered foreign books and packs. A release is eligible
only when the name claims exactly one source language. That language is kept,
and the book is translated into the series language. The library language
profile does not choose which source languages qualify. A release with no
language claim, or with two claims, is not relabelled as the series language.
OCR on the processor must verify the actual source and target languages before import.
Automatic staging supports image ZIP/CBZ, RAR/CBR and PDF files through the same
bounded archive extractor used by normal imports. Differently sized editions with
an edition_book_count override require explicit source assignment.
The configured torrent retention action runs only after the translations have
been imported. A native release appearing in the meantime pauses translation and
has priority; the foreign archive is never treated as a native library file.
When Internet Archive is enabled, translation fallback also searches it directly, without an English-language filter or a torrent client. The item's language or an explicit per-file language marker supplies the source language; the translation processor verifies the text before publication. Missing or ambiguous declarations are not labelled English and need source-language verification before automatic translation. Only matching, missing, explicitly numbered books are acquired, with at most two new archive/indexer downloads in total per pass. Ordinary English acquisition keeps its language checks when translation is disabled.
Switching the global toggle off pauses submissions, polling and publication. An external request already running on the processor can finish and incur its existing API charges; its cached result waits for re-enablement. Cancel prevents publication and sends a durable cancellation request to the processor, retried after connection failures even while fallback is disabled. Changing the destination language cancels old-language jobs. Already imported files remain available. Failed jobs need an explicit retry; temporary connection failures retry automatically with the same processor ID. An explicit retry starts a new attempt. Late responses, progress updates and results from the cancelled attempt cannot update or publish the new attempt; each attempt keeps its output in a separate staging directory.
Manga Image Translator on demand¶
Select Manga Image Translator (MIT) under Settings → Translation to run the advanced worker on the Tankarr host. Install Tankarr from the checkout or use its Docker image. Give the worker a writable, administrator-managed Manga Image Translator checkout pinned to a compatible commit. The engine writes its model cache there.
- Set
TANKARR_MIT_ENGINE_ROOTto an existing checkout. For Compose, mount it at/mit-engineand set the variable to that container path. Alternatively, setTANKARR_MIT_ENGINE_REVISIONto a full upstream commit. The first job fetches the pinned checkout into<data dir>/mit/engineif that directory is absent. - Set
TANKARR_MIT_VENVto a persistent, writable path on that host. At the first job, the worker creates the virtual environment and installs the checkout's requirements. MIT loads its model weights as needed. Compose defaults to/config/mit/venvand includes a Python 3.11 environment builder. In a native installation,TANKARR_MIT_SETUP_PYTHONcan select another interpreter. - To reuse an existing MIT virtual environment, set
TANKARR_MIT_ENGINE_PYTHONto its Python executable instead. For CUDA and other hardware-specific dependencies, prepare the environment on the worker host and setTANKARR_MIT_GPU=truewhen the engine supports that device. CPU is the default.TANKARR_MIT_CONFIGcan point to an engine configuration JSON file.
Initialization starts only when fallback is enabled and an eligible job reaches this worker. The first job can take longer. Prepare a fresh virtual environment when changing the pinned checkout. Choose an external processor or a script hook to keep the work off the Tankarr host.
For multiple hosts, the optional capability-aware dispatcher selects an available, explicitly enrolled worker using its live resources and observed throughput. Adding or removing hardware only changes the registry. The reference processor limits admission and keeps checkpoints separate for each attempt. Fully checkpointed MIT jobs reuse validated pages without initializing the engine; source, runtime and output checks still apply.
Enter an independent Vision API base URL and OCR and balloon lettering model to guide MIT's detection, OCR, validation and in-balloon lettering. Use an OpenAI-compatible multimodal endpoint. The vision API key is optional and stored as a secret. This endpoint may receive page images and OCR text. The dialogue translation endpoint receives recognized text. MIT falls back to its native rendering where the vision geometry cannot be matched confidently. Automatic mode with basic local Tesseract uses its own OCR and renderer.
If both vision requests return unusable balloon geometry, the worker records the page for review and continues checkpointing other pages. It withholds the entire archive until every page passes; the existing limit on refused pages still stops a run with widespread failures. It does not repeat OCR for a geometry failure. Vision connection errors and HTTP failures stop the run immediately.
Script hook and external worker routing¶
Select Script hook and save an executable filename. The host administrator
sets TANKARR_TRANSLATION_HOOK_DIRECTORY and installs the executable in that
directory. With Docker, mount the directory read-only at /hooks or configure
the corresponding container path. Keep the files and the directory under trusted
administrator control. The web interface can select a filename in that
directory. Deployment-specific device lists and credentials can live outside
the Tankarr checkout.
Tankarr invokes the executable directly and writes one version 1 JSON object to its standard input, then closes it. Example fields:
{
"protocol_version": 1,
"event": "translation.requested",
"job_id": "job-id",
"attempt": 1,
"manga_id": "series-id",
"source_path": "/staging/source.cbz",
"source_sha256": "<sha256>",
"source_language": "zh",
"target_language": "en",
"result_path": "/staging/attempt-1/worker-result.cbz",
"checkpoint_directory": "/staging/attempt-1/worker-checkpoints",
"ai": {"base_url": "https://translation.example/v1", "model": "translator", "api_key": "<secret>"},
"vision": {"base_url": "https://vision.example/v1", "model": "vision-model", "api_key": null}
}
The optional vision block is omitted if no vision provider is configured.
The hook keeps the source unchanged, routes the job, and writes the completed
CBZ atomically to result_path before exiting with status 0. Its CBZ must
contain the same receipt as the HTTP processor, with the configured model
and, when supplied, vision_model. Tankarr checks the receipt and imports the
result. Exit 75 to retry the same attempt on a later pass. Other nonzero exits
fail the attempt. Two hook jobs may run concurrently.
Treat the hook input as sensitive. Forward it only over authenticated, private
transport to trusted workers. Use job_id and attempt for deduplication.
On pause, cancellation, relevant settings changes or the six-hour limit,
Tankarr terminates the local hook. The hook owns cancellation and cleanup on
remote hosts. If replacing an HTTP processor, finish or cancel active HTTP jobs
before switching to the hook. To rerun OCR and lettering from the original,
retry the failed or cancelled translation from Activity. An installed translation
must be replaced through the normal library import workflow.
Optional external reference processor¶
Tankarr itself has no GPU or platform-specific dependency. Run the reference
processor on a host with an installed
manga-image-translator environment.
Keep a working engine version and OCR/render configuration pinned. The reference
runner uses its Python MangaTranslator / Config API and compatible chat provider
configuration. The processor controls supported OCR/target languages; the
reference runner currently supports the language codes in contrib/translate_archive.py.
From a Tankarr checkout, using your own engine locations:
python3 contrib/translation_processor.py \
--engine-python /srv/manga-image-translator/.venv/bin/python \
--engine-root /srv/manga-image-translator \
--state ./data/translation-processor
The default listener is 127.0.0.1:8095. Set TRANSLATION_PROCESSOR_TOKEN in its
environment before exposing it with --host; configure the same token and a
reachable URL in Tankarr. Use HTTPS or a trusted private network: the processor is
trusted to receive archive contents and the AI credential. --config selects an
engine configuration file; --cpu opts into CPU execution. Do not run this heavy
engine on a small host unless it has enough resources.
The runner defaults to the engine's chatgpt adapter; a supplied configuration can
select any OpenAI-compatible adapter that the runner accepts (see
contrib/translate_archive.py). The selected adapter uses the endpoint, model and
credential from the job. Translation chains and language skip rules are cleared so
they cannot override the requested destination.
Completed pages are saved atomically in state/checkpoints/<job-id>/. A restart
or explicit retry can reuse those pages without calling the translator again.
The unfinished page may need to be repeated. Checkpoints contain rendered pages
and OCR/translation text, but no API credential. Their identity includes the
source archive, languages, model, endpoint and OCR/render settings; changed inputs
or corrupt checkpoints are regenerated. Custom dispatchers can enable this with
the runner's --checkpoint-directory argument and copy the immutable, hash-named
checkpoint files to durable storage before cleaning up a remote workspace.
Retain that directory alongside the processor state if restart recovery is needed.
On failure, the runner saves result.failure.json next to its output. It contains
only a fixed code and a boolean retryable: page_review_required,
provider_unavailable, translation_failed, provider_interrupted, or
validation_failed. The reference processor includes these validated fields as
failure in a failed job's status response. Provider bodies, exception text,
source dialogue, URLs and credentials are never copied into this receipt.
page_review_required needs correction before retry; provider availability may
also require operator action. The flag is diagnostic and does not schedule retries.
A new execution clears any previous receipt; older workers may return only the
failed status, without a category.
Enter the AI provider's API base URL, model identifier and key in Tankarr. The reference worker accepts providers implementing the compatible chat API. Provider keys are masked in Settings and use the existing private secrets store, not the job database. Worker credentials travel in request bodies and subprocess stdin; they are excluded from command lines, receipts and persisted processor metadata.
The reference worker checks page count and dimensions, untranslated/echoed text, leftover response markers and detected source/destination languages. These checks can reject short or unusual text and cannot prove translation or lettering quality. Test your OCR/render configuration on representative pages before a large queue. Failed output stays outside the library for review. An unchanged provider answer is still refused unless a separate language check identifies the entire region as readable English and echoes it exactly. This preservation path rejects source-script text and records its evidence in the page checkpoint; it does not count preserved text as a translated region. Failed, ambiguous or malformed language checks do not release the page.
Processor protocol, version 1¶
Requests use a configured bearer token. IDs are a 32-character hexadecimal job ID,
followed by - and its retry number. A transport retry reuses the ID; an explicit
retry increments the number. Processors must treat source and request identity as
immutable and return cached results when the same job is submitted again.
GET /jobs/{id}returns404if submission is needed, or{"status":"queued|running|completed|failed"}.PUT /jobs/{id}/sourceuploads the CBZ asapplication/zipwith Content-Length.POST /jobs/{id}submits JSON:source_sha256,source_language,target_language, andai: {base_url, model, api_key}. Return a status immediately.GET /jobs/{id}/resultreturns a completed ZIP with all image pages andtranslation.json: the source hash/languages,page_count,translated_regions(positive),untranslated_regions(zero),detected_source_language,detected_target_language(base language codes), andmodel.DELETE /jobs/{id}requests cancellation and returns202. The processor persists the request before acknowledging it, stops its owned work, and reportscancellingthencancelled. A cancelled ID cannot be submitted again; a retry uses the next attempt number. Cancellation must not stop unrelated work.
An optional independent source reader can corroborate the book's language when the engine OCR lost diacritics. That evidence does not certify the translation of regions the second reading cannot confirm: a receipt listing unconfirmed source regions is refused at import until they have been corrected.
Tankarr validates the receipt, archive limits and image geometry, rebuilds ComicInfo, and uses its existing atomic publication and recovery machinery. The reference processor retains input/output archives in its state directory for retry recovery; include that directory in your storage/retention planning.
API clients can inspect GET /api/translations?manga_id=..., request a normal
search plus fallback with POST /api/manga/{id}/translations/search, upload a CBZ
to POST /api/manga/{id}/translations/upload?source_language=ja&volume=1 (or
chapter=1.5), and use POST /api/translations/{job}/retry or /cancel.
These endpoints use Tankarr's normal authentication.