Single-binary AI translation platform written in Go.
Text translation | Document translation | Image text translation | OCR extraction
Localize packages the backend API, embedded React UI, mutool integration for document extraction, OCR pipeline, and AI provider connections into one deployable binary. You upload documents or images, the backend extracts text and translates it using configured LLMs, and you get the translated output—all without splitting the stack across multiple services.
| Component | Path | Responsibility |
|---|---|---|
| Server entrypoint | cmd/localize |
Starts the web server |
| API and embedded frontend | internal/api |
API routes, file uploads, embedded web assets (dist), Swagger docs |
| Translation engine | internal/translation |
Document parsing, text chunking, AI translation orchestration |
| OCR processing | internal/ocr |
Image text extraction, layout analysis |
| Tooling | mutool (external) |
PDF, DOCX, and document page extraction (bundled in Docker) |
- AI-powered text translation
- Document translation supporting PDF, DOCX, and other formats via
mutool - Image text translation with built-in OCR capabilities
- React frontend embedded directly into the Go binary for easy deployment
- Automatic language detection
- Auto-generated OpenAPI/Swagger documentation
- Single binary deployment with no external database dependencies
| Area | Technology |
|---|---|
| Language | Go 1.26 |
| Backend | Go standard library / Fiber (depending on your setup) |
| Frontend | React + Vite (built with Bun, embedded into the server binary) |
| Document Processing | mutool (mupdf-tools) |
| AI integrations | Ollama, (OpenAI, Anthropic, Openrouter, OpenAI-compatible endpoints are planned) |
| API Docs | Swaggo (Swagger v2) |
- Go
1.26or newer bun(for frontend builds)makemutoolinstalled on your system (for document translation features)
Set your Ollama instance URL as an environment variable:
export OLLAMA_HOST="http://localhost:11434"Recommended models:
translategemma:latest[3.3GB] for text translationglm-ocr:latest[2.2GB] for OCRPull the models using Ollama CLI:
ollama pull translategemma:latestollama pull glm-ocr:latest
Then start Localize:
make runOpen http://localhost:8080.
Run the app directly using Go:
make runOr build the binary into the bin/ directory and run it:
make build
./bin/localize.exeBuild the Docker image using the provided Makefile target:
make build-dockerOr build and run manually:
docker build -t localize:latest .
docker run -p 8080:8080 -e OLLAMA_HOST="http://localhost:11434" localize:latestThe Docker image is based on Alpine Linux and comes with mutool (via mupdf-tools) pre-installed. The app automatically detects mutool either in the system PATH or in the same directory as the executable.
Published images are expected at:
ghcr.io/FlameInTheDark/localize:<tag>
ghcr.io/FlameInTheDark/localize:latest
Localize reads configuration from environment variables.
| Variable | Default | Description |
|---|---|---|
ADDRESS |
:8080 |
HTTP server address and port |
OLLAMA_HOST |
http://localhost:11434 |
Ollama LLM backend host URL |
MUMTOOL_PATH |
mutool |
Path to the mutool executable |
TRANSLATION_MODEL |
translategemma:latest |
Name of the model used for translation |
OCR_MODEL |
glm-ocr:latest |
Name of the model used for OCR |
Notes:
- For local development without Docker, you must install
mutoolmanually (e.g.,apt install mupdf-toolsorbrew install mupdf-tools).
- Direct text input with automatic source language detection
- Configurable target language and translation tone
- Context-aware translation using advanced LLMs
- Upload PDF, DOCX, and text files
mutoolextracts text while preserving structure where possible- Document reassembly and downloadable translated output
- Upload images (PNG, JPG) containing text
- OCR engine extracts text from images
- Extracted text is passed directly to the translation pipeline
Before building the Go binary, ensure the frontend is built so it can be embedded via go:embed:
cd web
bun install
bun run build
cd ..Useful Make targets:
| Target | What it does |
|---|---|
make build |
Build the Go server binary into bin/localize.exe |
make run |
Run the server directly using go run ./cmd/localize |
make build-docker |
Build the Docker image tagged as localize:latest |
make clean |
Remove the bin build directory |
make tools |
Install the swag CLI tool for Swagger generation |
make swag |
Format and generate OpenAPI/Swagger docs into ./docs/api from cmd/localize/main.go |
make lint |
Run golangci-lint run with a 5-minute timeout |
cmd/localize server entrypoint
internal/api API routes, handlers, embedded frontend assets (dist)
internal/ocr image OCR processing logic
internal/translation text/document translation orchestration
internal/llm LLM provider clients and integrations
bin/ compiled binary output directory
docs/api/ auto-generated Swagger JSON files
docs/assets/ README and UI illustration assets
web/ React + Vite frontend (built with Bun)
MIT License