# sakurallm/sakurallm

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/sakurallm-sakurallm).**

4,381 stars · 110 forks · Python · gpl-3.0

## Links

- GitHub: https://github.com/SakuraLLM/SakuraLLM
- awesome-repositories: https://awesome-repositories.com/repository/sakurallm-sakurallm.md

## Description

SakuraLLM is a multi-format document translation system that hosts large language models for translating Japanese text into other languages. It functions as an inference server that exposes translation models through an OpenAI-compatible API, allowing any tool supporting the OpenAI client format to send translation requests. The system is designed as a glossary-aware translation engine that applies user-defined term dictionaries to ensure consistent translation of proper nouns and names across outputs.

The project distinguishes itself by supporting multiple high-performance inference backends including llama.cpp, vLLM, and Ollama, enabling flexible deployment across consumer CPU and GPU hardware. It features a format-preserving translation pipeline that extracts, translates, and reassembles text from structured formats like ebooks and subtitles while retaining timestamps, line breaks, and markup. The system also supports CPU-GPU hybrid inference for memory-constrained setups, tensor parallel multi-GPU distribution for larger models, and token probability filtering to refine translation precision.

SakuraLLM provides translation capabilities for ebooks, subtitles, visual novels, galgames, RPG Maker games, manga, and plain-text novels. It processes documents by dividing long texts into manageable segments, translating each segment through the language model, and reassembling the output with original formatting intact. The system includes glossary management for maintaining terminology consistency, degeneration detection that monitors token generation and retries with adjusted parameters when output quality degrades, and multi-threaded inference for improved throughput.

The project offers a Docker-based deployment with API authentication and supports running on consumer NVIDIA and AMD GPUs.

## Tags

### Artificial Intelligence & ML

- [LLM Inference Servers](https://awesome-repositories.com/f/artificial-intelligence-ml/agent-deployment-servers/llm-inference-servers.md) — Hosts large language models behind an OpenAI-compatible API with multi-GPU support and multiple backend engines.
- [OpenAI-Compatible APIs](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-systems-frameworks/model-integration-serving/model-integration-interfaces/ai-integration-apis/openai-compatible-apis.md) — Exposes the translation model through an OpenAI-format API for integration with any OpenAI-compatible client. ([source](https://github.com/SakuraLLM/SakuraLLM#readme))
- [EPUB and Subtitle Translation](https://awesome-repositories.com/f/artificial-intelligence-ml/audio-transcription/multilingual-transcription/epub-and-subtitle-translation.md) — Processes Japanese ebooks and subtitle files through an inference server while maintaining structural integrity. ([source](https://github.com/SakuraLLM/SakuraLLM/blob/main/requirements.vllm.txt))
- [Format-Preserving Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/audio-transcription/multilingual-transcription/epub-and-subtitle-translation/format-preserving-pipelines.md) — Extracts, translates, and reassembles text from EPUBs and subtitles while retaining timestamps, line breaks, and markup.
- [Subtitle Translation](https://awesome-repositories.com/f/artificial-intelligence-ml/audio-transcription/multilingual-transcription/subtitle-translation.md) — Converts subtitle files via language model inference while preserving timestamps and formatting. ([source](https://github.com/SakuraLLM/SakuraLLM#readme))
- [Japanese Text Translation](https://awesome-repositories.com/f/artificial-intelligence-ml/japanese-text-translation.md) — Provides a specialized pipeline for translating Japanese text using large language models while preserving formatting and timestamps.
- [Japanese Text Translations](https://awesome-repositories.com/f/artificial-intelligence-ml/japanese-text-translations.md) — Translates Japanese text into Chinese using a large language model, preserving formatting and timestamps. ([source](https://github.com/SakuraLLM/SakuraLLM#readme))
- [Multi-Format Document Translators](https://awesome-repositories.com/f/artificial-intelligence-ml/japanese-text-translations/multi-format-document-translators.md) — Translates Japanese ebooks, subtitles, and visual novel scripts while preserving original formatting and timestamps.
- [Large Language Model Serving](https://awesome-repositories.com/f/artificial-intelligence-ml/large-language-model-serving.md) — Hosts a large language model behind an HTTP API so clients can send text and receive translated output. ([source](https://github.com/SakuraLLM/SakuraLLM/blob/main/server.py))
- [Translation Servers](https://awesome-repositories.com/f/artificial-intelligence-ml/neural-machine-translation-frameworks/translation-servers.md) — Hosts large language models for translating Japanese text into other languages via a standardized API.
- [Ollama Model Runners](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-application-frameworks/local-on-device-ai/ollama-engine-integrations/ollama-model-runners.md) — Loads models from the Ollama library using Docker for simplified installation and management. ([source](https://github.com/SakuraLLM/SakuraLLM/blob/main/usage.md))
- [Ollama Model Servers](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-application-frameworks/local-on-device-ai/ollama-engine-integrations/ollama-model-servers.md) — Pulls and runs models from the Ollama library, managing them with Docker for simplified deployment. ([source](https://github.com/SakuraLLM/SakuraLLM/blob/main/usage.md))
- [Multi-Backend GPU Inference Engines](https://awesome-repositories.com/f/artificial-intelligence-ml/inference-backends/multi-backend-gpu-inference-engines.md) — Supports llama.cpp, vLLM, and Ollama backends for flexible deployment across CPU and GPU hardware.
- [Manga Translation Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/llm-translation-integrations/manga-translation-pipelines.md) — Translates Japanese manga into Chinese, preserving the original image layout and text placement. ([source](https://github.com/SakuraLLM/SakuraLLM#readme))
- [CPU-GPU Hybrid Runtimes](https://awesome-repositories.com/f/artificial-intelligence-ml/local-model-execution/hybrid-execution-engines/cpu-gpu-hybrid-runtimes.md) — Enables translation on consumer hardware by offloading model parts to CPU when GPU memory is insufficient.
- [vLLM Backend Runners](https://awesome-repositories.com/f/artificial-intelligence-ml/model-serving-frameworks/multi-framework-model-serving/vllm-backend-runners.md) — Loads full-precision models using the vLLM backend with PagedAttention and tensor parallel multi-GPU acceleration. ([source](https://github.com/SakuraLLM/SakuraLLM/blob/main/usage.md))
- [Game Script Translations](https://awesome-repositories.com/f/artificial-intelligence-ml/multilingual-content-translation/game-script-translations.md) — Integrates with Galgame translation tools to provide real-time or offline translation of game dialogue and text. ([source](https://github.com/SakuraLLM/SakuraLLM#readme))
- [Visual Novel Script Translators](https://awesome-repositories.com/f/artificial-intelligence-ml/optical-character-recognition/visual-translation-interfaces/visual-novel-script-translators.md) — Translates visual novel and galgame scripts while preserving inline formatting, control characters, and ruby annotations.
- [Tensor Parallelism](https://awesome-repositories.com/f/artificial-intelligence-ml/tensor-parallelism.md) — Splits model computation across multiple GPUs using tensor parallelism to accelerate inference and handle larger models.

### Content Management & Publishing

- [EPUB Translation Pipelines](https://awesome-repositories.com/f/content-management-publishing/epub-structure-parsing/epub-translation-pipelines.md) — Processes EPUB files through a translation pipeline that extracts, translates, and reassembles content while maintaining structure. ([source](https://github.com/SakuraLLM/SakuraLLM#readme))
- [Terminology-Aware Translation](https://awesome-repositories.com/f/content-management-publishing/media-management/subtitle-management-systems/subtitle-synchronization/subtitle-processing/terminology-aware-translation.md) — Uses a glossary to keep proper nouns and character names consistent across translations. ([source](https://github.com/SakuraLLM/SakuraLLM#readme))

### DevOps & Infrastructure

- [Translation Servers](https://awesome-repositories.com/f/devops-infrastructure/self-hosted-infrastructure-platforms/translation-servers.md) — Starts a Docker-based inference server with authentication that accepts translation requests via HTTP. ([source](https://github.com/SakuraLLM/SakuraLLM/blob/main/README.docker.md))
- [Consumer GPU Optimizations](https://awesome-repositories.com/f/devops-infrastructure/intel-hardware-acceleration/low-bit-weight-quantization/consumer-gpu-optimizations.md) — Runs the translation model on NVIDIA and AMD GPUs with CPU-GPU hybrid inference for lower-memory setups. ([source](https://github.com/SakuraLLM/SakuraLLM/blob/main/README.md))
- [llama.cpp Backend Runners](https://awesome-repositories.com/f/devops-infrastructure/model-serving/llama-cpp-backend-runners.md) — Loads quantized GGUF models using the llama.cpp backend for efficient CPU and GPU inference. ([source](https://github.com/SakuraLLM/SakuraLLM/blob/main/usage.md))

### Software Engineering & Architecture

- [Translation Term Mapping](https://awesome-repositories.com/f/software-engineering-architecture/glossaries/glossary-and-acronym-managers/translation-term-mapping.md) — Accepts a user-provided term dictionary to enforce consistent translation of specific names and phrases. ([source](https://github.com/SakuraLLM/SakuraLLM#readme))
- [Translation](https://awesome-repositories.com/f/software-engineering-architecture/glossaries/translation.md) — Applies a user-defined glossary to maintain consistent translation of proper nouns and pronouns. ([source](https://github.com/SakuraLLM/SakuraLLM/blob/main/README.md))

### Web Development

- [Translation API Endpoints](https://awesome-repositories.com/f/web-development/translation-api-endpoints.md) — Serves a standardized API endpoint that other translation tools can call to use the model. ([source](https://github.com/SakuraLLM/SakuraLLM#readme))
- [Translation API Hosting](https://awesome-repositories.com/f/web-development/web-infrastructure-deployment/web-infrastructure-servers/web-server-hosting/headless-server-hosting/translation-api-hosting.md) — Loads a large language model and exposes it over an API so other tools can send text for translation. ([source](https://github.com/SakuraLLM/SakuraLLM/tree/main/infers))
- [llama.cpp Backend Servers](https://awesome-repositories.com/f/web-development/model-serving/llama-cpp-backend-servers.md) — Loads quantized GGUF models and runs them on GPU with the llama.cpp backend for efficient inference serving. ([source](https://github.com/SakuraLLM/SakuraLLM/blob/main/usage.md))
- [vLLM Backend Servers](https://awesome-repositories.com/f/web-development/model-serving/vllm-backend-servers.md) — Loads full-precision models and distributes inference across multiple GPUs using tensor parallelism for faster throughput. ([source](https://github.com/SakuraLLM/SakuraLLM/blob/main/usage.md))
- [Subtitle Translation Utilities](https://awesome-repositories.com/f/web-development/translation-tools/subtitle-translation-utilities.md) — Converts subtitle files via language model inference while preserving timestamps and formatting for media localization.

### Part of an Awesome List

- [Galgame Translators](https://awesome-repositories.com/f/awesome-lists/media/translation-tools/galgame-translators.md) — Integrates with galgame translation tools to provide real-time or offline translation of game dialogue. ([source](https://github.com/SakuraLLM/SakuraLLM#readme))

### Business & Productivity Software

- [Ebook Translation Pipelines](https://awesome-repositories.com/f/business-productivity-software/ebook-readers/bilingual-ebook-generators/ebook-translation-pipelines.md) — Processes ebook content by extracting text, translating it, and reassembling the result while preserving the original structure. ([source](https://github.com/SakuraLLM/SakuraLLM/blob/main/translate_sub.py))

### Data & Databases

- [Segmented Processing Pipelines](https://awesome-repositories.com/f/data-databases/text-processing-utilities/text-extraction/text-segmentation/segmented-processing-pipelines.md) — Divides long documents into manageable segments for translation, then reassembles them with original formatting intact.

### Game Development

- [RPG Servers](https://awesome-repositories.com/f/game-development/open-source-games/genres/massively-multiplayer-online-games/rpg-servers.md) — Supports RPG game translation through integration with batch translation tools for RPGMaker. ([source](https://github.com/SakuraLLM/SakuraLLM#readme))
- [RPG Game Text Translators](https://awesome-repositories.com/f/game-development/translated-text-injectors/rpg-game-text-translators.md) — Integrates with RPG translation tools to automatically translate in-game text for RPG Maker engines. ([source](https://github.com/SakuraLLM/SakuraLLM#readme))
- [Visual Novel Script Translators](https://awesome-repositories.com/f/game-development/visual-novel-ui-stylers/visual-novel-script-translators.md) — Translates visual novel scripts while preserving inline line breaks, control characters, and ruby annotations. ([source](https://github.com/SakuraLLM/SakuraLLM/blob/main/README.md))

### Graphics & Multimedia

- [Document Format Preservations](https://awesome-repositories.com/f/graphics-multimedia/format-preservation/document-format-preservations.md) — Keeps original line breaks, timestamps, and markup intact when translating subtitles or ebooks. ([source](https://github.com/SakuraLLM/SakuraLLM/tree/main/infers))
- [Light Novel Translators](https://awesome-repositories.com/f/graphics-multimedia/text-shaping-and-layout/novel-text-layout-engines/novel-exporters/light-novel-translators.md) — Processes e-book files and web novel content to produce machine-translated Chinese versions while maintaining formatting. ([source](https://github.com/SakuraLLM/SakuraLLM#readme))
- [Novel Translators](https://awesome-repositories.com/f/graphics-multimedia/text-shaping-and-layout/novel-text-layout-engines/novel-exporters/novel-translators.md) — Reads a plain-text novel file, splits it into segments, and sends each segment to a language model for translation. ([source](https://github.com/SakuraLLM/SakuraLLM/blob/main/translate_novel.py))
- [Visual Novel Script Translations](https://awesome-repositories.com/f/graphics-multimedia/visual-media-translation-tools/visual-novel-script-translations.md) — Processes visual novel scripts, preserving inline line breaks, control characters, and ruby annotations. ([source](https://github.com/SakuraLLM/SakuraLLM#readme))
