Py polyglot-gpu
Open source

polyglot-gpu 57 languages on your GPU.

Python translation library + MCP server. TranslateGemma via Ollama — zero cloud dependency, zero API keys.

Install

pip install polyglot-gpu

Translate

result = await translate("Hello", "en", "ja")

MCP

python -m pypolyglot

Features

Everything runs locally on your GPU.

57 Languages

TranslateGemma supports 57 languages including CJK, Arabic, Hindi, and all major European languages.

Dual-Use

Use as a pip-installable Python library or as an MCP server for Claude Code, Claude Desktop, and other clients.

Markdown-Aware

Translates prose while preserving code blocks, tables, HTML, URLs, and badges intact.

Smart Cache

Segment-level cache with Levenshtein fuzzy matching — translation memory that speeds up repeat translations.

Auto-Everything

Auto-starts Ollama, auto-pulls TranslateGemma models. Zero manual setup on first run.

GPU-Safe

Semaphore-controlled concurrency prevents VRAM overload. Works on 4 GB to 24 GB GPUs.

Usage

Install

pip install polyglot-gpu

Simple translation

from pypolyglot import translate

result = await translate("Hello world", "en", "ja")
print(result.translation)  # こんにちは世界

Markdown translation

from pypolyglot import translate_markdown

result = await translate_markdown(md, "en", "fr")
print(result.markdown)

MCP server

# Add to Claude Code config:
{
  "mcpServers": {
    "polyglot-gpu": {
      "command": "polyglot-gpu"
    }
  }
}

Models

Choose based on your GPU VRAM.

Model
VRAM
Speed
Quality
translategemma:4b
3.3 GB
Fast
Good
translategemma:12b
8.1 GB
Balanced
Recommended
translategemma:27b
17 GB
Slow
Best

MCP Tools

translate_text(text, from_lang, to_lang, model?, glossary?)

Translate text between any of 57 supported languages.

translate_md(markdown, from_lang, to_lang, model?)

Translate markdown while preserving code blocks, tables, and HTML.

translate_all_langs(markdown, from_lang?, languages?, model?, concurrency?)

Translate into multiple languages at once (default: 7 languages).

list_languages()

List all 57 supported languages with codes.

check_status()

Check Ollama availability and installed TranslateGemma models.