Skip to main content

Pantogloss

Pantogloss cryptid moth mark

Tests PyPI License: Apache-2.0

Pantogloss is a TensorFlow/Keras library that translates text from many languages into English. It provides a Python API, command-line interface, and optional persistent local server with a browser UI.

The default public model is pantogloss-500-en-compact, a 538 MiB model validated on NVIDIA CUDA and Apple Metal. Model weights are downloaded separately from Hugging Face and are never bundled in the Python wheel. Public models normally require no Hugging Face login.

What it can do

  • Translate individual strings, batches, files, and bounded input streams.
  • Run on CPU, NVIDIA CUDA, or Apple Silicon Metal.
  • Keep a model resident behind a local HTTP API for fast repeated requests.
  • Provide a simple Any language → English browser translator.
  • Offer fast greedy and higher-quality beam-search decoding presets.
  • Return plain strings or structured results with timing and runtime metadata.
  • Attach caller-supplied language quality guidance and conservative warnings.
  • Preserve input order and isolate individual failures in long-running streams.

Pantogloss translates text; it does not detect the source language or parse document formats. See Project scope.

Installation

Pantogloss supports Python 3.10–3.12. Use the extra for your accelerator:

# CPU
python -m pip install pantogloss

# NVIDIA GPU on Linux
python -m pip install "pantogloss[cuda]"

# Apple Silicon Metal
python -m pip install "pantogloss[metal]"

# Persistent API and browser UI; combine with cuda or metal when needed
python -m pip install "pantogloss[server,metal]"

The first use downloads the selected model. Later loads use the local Hugging Face cache.

Python API

Load one translator and reuse it:

from pantogloss import Translator

translator = Translator.from_pretrained(device="auto")
print(translator.translate("Comment allez-vous ?"))

Translate a batch or request structured results:

translations = translator.translate([
    "Hola señor",
    "Wie geht es Ihnen?",
])

result = translator.translate_detailed("Bonjour le monde.")
print(result.text)
print(result.elapsed_seconds, result.execution_device)

For a large iterable, translate_iter() and translate_iter_detailed() process bounded batches without retaining the complete input or output collection.

with open("source.txt", encoding="utf-8") as source:
    for translation in translator.translate_iter(source, batch_size=16):
        print(translation)

Use the quality preset when latency is less important than beam-search quality:

print(translator.translate("Comment allez-vous ?", preset="quality"))

Command line

pantogloss translate "Comment allez-vous ?"
pantogloss translate --preset quality "Comment allez-vous ?"
pantogloss translate --input source.txt --output english.txt --batch-size 16
pantogloss models
pantogloss info --device gpu --json
pantogloss doctor

Translation output stays clean on stdout. Use --verbose, --report, or --tensorflow-logs when diagnostics are wanted. Use --offline to require an already cached model.

Persistent server and browser UI

Each standalone CLI invocation reloads the model. For repeated requests, keep one warmed translator in memory:

python -m pip install "pantogloss[server,metal]"  # or server,cuda
pantogloss serve --device gpu

Open http://127.0.0.1:8765/ for the two-pane browser translator. The same process exposes:

  • GET /health
  • GET /info
  • GET /metrics
  • POST /translate
curl http://127.0.0.1:8765/translate \
  -H 'Content-Type: application/json' \
  -d '{"text":"Comment allez-vous ?"}'

The server binds to loopback, warms the model before reporting readiness, and serializes inference by default. Queuing is bounded, shutdown drains active TensorFlow work, and optional request logs contain timing/count metadata rather than source or translated text. On Apple Silicon, the server defaults to the bounded-memory eager decoder because TensorFlow Metal retains memory during compiled decoding; --metal-compiled-decode is an explicit faster but memory-growing opt-in. See the Server and Web UI wiki page for deployment, authentication, limits, API schemas, benchmarks, and the pantogloss balance front end for independently resident workers. The balancer supports explicit graceful draining, connection-only safe retries, passive circuit breaking, and Prometheus-compatible reliability metrics.

Models

Name Role Approximate artifact size
pantogloss-500-en-compact Recommended default 538 MiB
pantogloss-500-en-compact-v1 Previous compact model 538 MiB
pantogloss-500-en-fp16 Accelerator-oriented FP16 reference 1.02 GiB
pantogloss-500-en Historical FP32 numerical reference 2.03 GiB
pantogloss-500-en-int8 Smaller experimental alternative 539 MiB
pantogloss-500-en-v6 Opt-in FP32 fine-tuned successor 2.03 GiB

Select a model explicitly when needed:

translator = Translator.from_pretrained("pantogloss-500-en-fp16", device="gpu")
successor = Translator.from_pretrained("pantogloss-500-en-v6", device="gpu")

The default compact model is derived from the fine-tuned V6 successor. It improves measured aggregate translation quality over the previous compact model at essentially the same size, though individual languages can vary. The full-size FP32 V6 model remains available as an opt-in reference. The INT8 alternative is not the default because it is substantially slower. Detailed evidence and backend caveats live in the model cards, wiki, and checked-in experiment reports.

Documentation

The repository also retains reproducible model-conversion, parity, compression, and evaluation artifacts under docs and evaluation.

Project scope

Pantogloss translates text and ordered text segments. It intentionally does not identify languages, detect file types, or parse documents. DocumentTranslator is a neutral text-segmentation helper. pantogloss-tika remains a compatibility example and is not a direction for new core dependencies. See the architecture boundary.

Translation quality varies by language, domain, and input. Pantogloss does not provide calibrated confidence and should not be relied on without review for medical, legal, safety-critical, or other high-stakes decisions.

Provenance and license

The original model was described by Thamme Gowda, Zhao Zhang, Chris A. Mattmann, and Jonathan May in Many-to-English Machine Translation Tools, Data, and Pretrained Models, ACL-IJCNLP 2021 System Demonstrations, DOI 10.18653/v1/2021.acl-demo.37.

Pantogloss and its converted models are licensed under the Apache License, Version 2.0. See NOTICE for attribution.

Release files for pantogloss 0.23.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pantogloss 0.23.0
File Size Uploaded
pantogloss-0.23.0.tar.gz 91.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pantogloss 0.23.0
File Interpreter ABI Platform
pantogloss-0.23.0-py3-none-any.whl Python 3 none any Details

Total release size: 197.6 kB

Release files / pantogloss-0.23.0.tar.gz

Download URL pantogloss-0.23.0.tar.gz
Size 91.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fdd3722f6c76b29e14ca8c5a74ea687ada6d5f0f315b2b57e8c35ac02f1d8492
BLAKE2b-256 checksum
How to use checksums
1f98b82f5444721d248f65a4005c40e2c8a735777a914a757a7a5433137c5f7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release files / pantogloss-0.23.0-py3-none-any.whl

Download URL pantogloss-0.23.0-py3-none-any.whl
Size 105.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52324308188048ff8999eae4df77ef819ec943321cb4f7089eb65fc7198f4c5b
BLAKE2b-256 checksum
How to use checksums
de6772f696b6abf6d41036c17d63a027a4e83badfd624adf806fa1f19a8c6437
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page