Skip to content
github-actions[bot] edited this page Sep 30, 2026 · 2 revisions

TXT

bbook_maker --book_name my_book.txt --language zh-hans --batch_size 20

That writes my_book_bilingual.txt beside the input. SRT subtitles and Markdown have pages of their own below; a PDF has its own section.

A plain-text file is translated line group by line group. There is no structure to keep, so there are few options.

How the file is read

  • The file is read as UTF-8 and split into lines.
  • Lines are sent in groups of --batch_size (default 10), joined by newlines.
  • A group that is empty, whitespace or only a number is copied without a request.
  • No earlier text is sent with a request: the TXT loader has no context mode.

What you get

  • <name>_bilingual.txt beside the input: each group of original lines followed by its translation. With --single_translate, the translation only.
  • On Ctrl+C or an error: <name>_bilingual_temp.txt and a checkpoint. Rerun with --resume.

Recommended command

bbook_maker \
  --book_name test_books/the_little_prince.txt \
  --language zh-hans \
  --batch_size 20

A larger --batch_size means fewer requests and more context per request. Lower it if the model starts merging or dropping lines.

Flags that apply

Route and run

These work the same on every format.

flag what it does
--book_name PATH The file to translate. The extension picks the format.
-m, --model MODEL The model id, exactly as the endpoint names it. Default gpt-6-luna on the openai format.
--key KEY API key; several comma-separated keys rotate. Falls back to BBM_API_KEY, then the format's own variable.
--api_base URL The endpoint. Defaults to the format's official host.
--api_format FORMAT The API the endpoint speaks, or a translation service. Inferred from --api_base when left out.
--provider NAME A named endpoint from bbm_providers.json.
--model_list IDS Several models to rotate across. Refused with --use_context session.
--language LANGUAGE Target language: a tag, a name, or TAG:NAME. Default zh-hans.
--source_lang LANGUAGE Source language, stated. Reaches every LLM prompt; sent as a field on qwen and customapi.
--prompt VALUE_OR_FILE Custom prompt: user template (must contain {text}), system, style.
--temperature FLOAT Sampling temperature, on the formats that take one.
--no-thinking Ask the model not to reason before answering. The field is negotiated on the OpenAI-shaped routes; thinking: disabled on anthropic; refused on codex.
--extra_body JSON Extra request-body fields on the openai and anthropic routes.
--extra_headers JSON Extra HTTP headers on the openai and anthropic routes.
--interval SECONDS Pause between requests. Only the gemini format uses it.
-p, --proxy URL HTTP proxy for the run.
--test Translate only the first paragraphs.
--test_num N How many, with --test (default 10).
--resume Continue an interrupted run from its checkpoint.
--single_translate Write the translation only, without the original.

TXT flags

flag what it does
--batch_size N Lines sent in one request (default 10).

Not for this format

  • --use_context: the TXT loader never hands context to the model, in either mode. The run warns; for a session it prints --use_context session is not supported for txt books; it will be ignored.
  • --context_paragraph_limit, --context-compact-at, --no-context-compact: context flags; nothing reads them here.
  • --glossary, --glossary-auto: forwarded by the EPUB, Markdown and PDF loaders only; the run warns.
  • --accumulated_num: not read by the TXT loader; the run warns and points at --batch_size.
  • --max-batch-units, --plan-classify, --plan-dry-run, --plan-min-coverage, --poetry-group-size: plan mode is EPUB only.
  • --classify-model, --classify-base-url, --classify-key (and --plan-classify-model, the old name): nothing classifies on this format yet. The run warns that the flag is ignored.
  • --translate-tags, --exclude-translate-tags, --allow_navigable_strings: EPUB markup selectors; the run warns.
  • --only_filelist, --exclude_filelist: EPUB internal files; ignored.
  • --block_size, --sentence_mode: EPUB only; ignored.
  • --parallel-workers: the TXT run stays serial; the run warns.
  • --translation_style, --translation_color: plain text carries no style; the run warns.
  • --no_disclosure, --translation-metadata: the output carries no credit line and no metadata file; the run warns.
  • --retranslate: EPUB only; refused.
  • --quiet: EPUB only; the run warns.
  • --batch, --batch-use: the TXT loader does not implement the Batch API.
  • --to-epub, --pdf-ocr, --ocr-replace-layer, --device, --ocr-lang, --pages, --no-formula-images, --pdf_layout, --img-model, --img-base-url, --img-key: PDF only. --to-epub on this format stops the run; the others warn or do nothing (the three image flags: the run warns that only the PDF route has an image step).

Clone this wiki locally