Using TBL with llama.cpp to test local translation of epub books

⌚Time: 2026-09-08 14:41:05

👨‍💻Author: Jack Ge

The GitHub address for TBL - Translate Books with LLMs: https://github.com/hydropix/TranslateBooksWithLLMs

I downloaded the Windows version. After unzipping, it's an exe file. If you just click to open it, it will launch the browser and go to http://localhost:5000.

I need to run llama.cpp locally to provide an AI model interface. The GitHub link for llama.cpp is: https://github.com/ggml-org/llama.cpp

I downloaded the Google open-source model translategemma-4b-it.Q8_0.gguf from huggingface.co. It's good at translation.

I started llama.cpp

llama-server.exe -m "D:\models\translategemma\translategemma-4b-it.Q8_0.gguf" --no-jinja

In the browser, fill in the configuration to connect to the AI model. For AI Provider, select OpenAI-Compatible, leave the API Key blank, enter the local AI model API address, and then just save the configuration.

http://localhost:8080/v1/chat/completions

Back on the translation page, I uploaded an EPUB e-book and then had it translate. The process takes a long time because my computer is low-end, so it can't translate quickly.

This is a translation test for it. Proving that it can work.


science Quick LLM test

A quick taste of how the selected LLM translates 5 excerpts from this file, using your current options. No commitment — just a preview before the full run.
OpenAI
· D:\models\translategemma\translategemma-4b-it.Q8_0.gguf · Italian → Japanese
che fu la mia, quando vidi ch’i’ era ne l’aere d’ogne parte, e vidi spenta ogne veduta fuor che de la fera.

Ella sen va notando lenta lenta; rota e discende, ma non me n’accorgo se non che al viso e di sotto mi venta.

Io sentia già da la man destra il gorgo far sotto noi un orribile scroscio, per che con li occhi ’n giù la testa sporgo.
私は、空中に広がる様子を見て、あらゆる方向から広がっているのを確認した時、その景色を眺めることができなくなった。

彼女はゆっくりと旋回し、下降していく。私は、それと気づくのが遅れて、顔と体の下に風が当たるのを感じた。

すでに、右側から恐ろしい轟音が聞こえていた。私は頭を下げて、音の出所を探った。
⏱ 203.63 s · ⇄ 741/103 · × 0.441
Ma distendi oggimai in qua la mano; aprimi li occhi». E io non gliel’ apersi; e cortesia fu lui esser villano.

Ahi Genovesi, uomini diversi d’ogne costume e pien d’ogne magagna, perché non siete voi del mondo spersi?

Ché col peggiore spirto di Romagna trovai di voi un tal, che per sua opra in anima in Cocito già si bagna,

e in corpo par vivo ancor di sopra.
「手を伸ばしてください、目を覚ませ」と彼は言った。しかし、私は彼に答えることができませんでした。彼は粗末な態度だったからです。

ああ、ジェノヴァの人々よ、様々な身分と様々な悪意を持つ人々よ、なぜあなたは世界から姿を消してしまったのでしょうか?

最も悪質なロマニャの人々と出会いましたが、彼らはすでに魂と体で、まるで生きているかのように、悪に浸っているようです。
⏱ 185.51 s · ⇄ 742/110 · × 0.503
Lo cielo i vostri movimenti inizia; non dico tutti, ma, posto ch’i’ ’l dica, lume v’è dato a bene e a malizia,

e libero voler; che, se fatica ne le prime battaglie col ciel dura, poi vince tutto, se ben si notrica.

A maggior forza e a miglior natura liberi soggiacete; e quella cria la mente in voi, che ’l ciel non ha in sua cura.
空と、皆様の動きが始まります。全てではありませんが、空は善と悪、そして自由な意志に光を与えます。もし私が言うなら、最初の戦いでは困難ですが、しっかりと準備すれば、全てを打ち破ることができるのです。

さらに、あなたはより強靭で、優れた自然な能力を備えています。そして、その能力は、空にはないものです。
⏱ 156.60 s · ⇄ 732/92 · × 0.45
e qual esce di cuor che si rammarca, tal voce uscì del cielo e cotal disse: «O navicella mia, com’ mal se’ carca!».

Poi parve a me che la terra s’aprisse tr’ambo le ruote, e vidi uscirne un drago che per lo carro sù la coda fisse;

e come vespa che ritragge l’ago, a sé traendo la coda maligna, trasse del fondo, e gissen vago vago.
そして、心からの叫びが、空から響き、次のように語った:「ああ、私の船よ、どれほど荷物があるか!」。

その後、あたりの大地が両方の車輪の間から開いたようで、そこから一匹の竜が現れ、車の上に乗って尻尾を動かしているのが見えました。

そして、ハチが針を引っ込めるように、邪悪な尻尾を引っ張り、底から引きずり、唸り声をあげました。
⏱ 189.06 s · ⇄ 748/119 · × 0.489
da esso ebbe milizia e privilegio; avvegna che con popol si rauni oggi colui che la fascia col fregio.

Già eran Gualterotti e Importuni; e ancor saria Borgo più quïeto, se di novi vicin fosser digiuni.

La casa di che nacque il vostro fleto, per lo giusto disdegno che v’ha morti e puose fine al vostro viver lieto,

era onorata, essa e suoi consorti:
そこから、彼らは軍事力と特権を得ていました。今日、彼らはその称号を人々と共に身につけています。

かつて、彼らは「グアルテロッティ」と「インポルターニ」と呼ばれていました。もし新しい近隣住民が現れれば、ボルゴはより平和な場所になるでしょう。

あなたの故郷である、その家の、正当な軽蔑が、あなた方の死と幸福な生活の終焉をもたらしたことを思い出すべきです。

その家とその仲間たちは、尊敬される存在でした。
⏱ 192.34 s · ⇄ 740/134 · × 0.574

So, AI is really powerful now, and some books and documents can be fully translated locally.