Skip to main content

Dragoman

Translate Markdown and moderate comments with a small model on your own machine.
No API key, no per-request bill, no text leaving your server.

CI MIT license Python 3.10+ Runs on CPU

Install · Use it in your app · API · Documentation · Roadmap

Dragoman translating a Markdown snippet and moderating two comments in a terminal

Dragoman is a self-hosted translation and moderation API: a small HTTP service in front of llama.cpp. Send it a blog post in French, get it back in English with every heading, link, image and code block where it was. Send it a comment, get back ok or insult. It was built to run a bilingual portfolio on a shared server with no GPU, and it works for any blog, CMS, documentation site or app that wants free, private machine translation and comment moderation instead of a paid API.

Features

  • Markdown stays intact. Code blocks never reach the model. Links, images, inline code and HTML attributes are checked after translation; if the model changes one, Dragoman retries, then refuses, instead of silently breaking your page.
  • Moderation that knows criticism from insults. "This article is useless" passes, "you idiot" does not, in French and English, even with misspellings.
  • A fair queue. One job at a time, and a comment to moderate goes ahead of a 20-minute translation.
  • Polite on shared machines. CPU, memory and priority limits out of the box.
  • Clear errors. Every failure has a status, a code and a hint, with Retry-After when waiting helps.
  • Small. About 500 lines of standard-library Python, one 2.5 GB model file.

Quickstart

With Docker:

git clone https://github.com/FauZaPespi/Dragoman && cd Dragoman
./scripts/download-model.sh                       # 2.5 GB, checksum verified
cp .env.example .env && sed -i "s/^API_TOKEN=.*/API_TOKEN=$(openssl rand -hex 24)/" .env
docker compose up -d
curl localhost:8090/health                        # ready once the model has loaded, about 15 s

Without Docker, one script builds llama.cpp, fetches the model and installs a service:

git clone https://github.com/FauZaPespi/Dragoman && sh Dragoman/scripts/install.sh --service

Already running llama-server? pip install dragoman-server installs only the API. All three ways are in the install guide.

Use it from your app

const res = await fetch("http://127.0.0.1:8090/v1/translate", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.DRAGOMAN_TOKEN}` },
  body: JSON.stringify({ text: "## Bonjour", source: "fr", target: "en" }),
});
const { text } = await res.json(); // "## Hello"

Python, PHP, error handling and the background-job pattern are in Use it in your app.

Speed

On 6 threads of a Xeon Gold 6154, no GPU:

Task Time
Moderate one comment about 1.5 s
Translate a 500-word article about 3 min
Load the model about 11 s

Slow, but free and unlimited, which is what background work needs. How the default model was chosen is in the benchmarks.

Languages

French, English, German, Spanish, Italian, Portuguese, Dutch, Polish, Japanese, Chinese, Korean, Russian, Turkish, Arabic, Ukrainian, Swedish and Hindi. Quality is best between French and English, which is what the prompts and tests cover.

Documentation

Using Dragoman Working on Dragoman
Install Architecture
Use it in your app Development
API reference Benchmarks
Configuration Contributing
Put it on a server Roadmap
Troubleshooting Changelog

Contributing

Bug reports, ideas and pull requests are welcome. Start with CONTRIBUTING.md, and report security issues privately as described in SECURITY.md.

License

MIT. The default model, Qwen3 4B Instruct 2507, is released by Alibaba under Apache 2.0. The wordmark uses Fraunces (SIL Open Font License).

Metadata

Release files for dragoman-server 0.2.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 dragoman-server 0.2.0
File Size Uploaded Provenance Actions
dragoman_server-0.2.0.tar.gz 18.4 kB With provenance Details for dragoman_server-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dragoman-server 0.2.0
File Interpreter ABI Platform Actions
dragoman_server-0.2.0-py3-none-any.whl Python 3 none any Details for dragoman_server-0.2.0-py3-none-any.whl

Total release size: 31.9 kB

Release files / dragoman_server-0.2.0.tar.gz

Download URL dragoman_server-0.2.0.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d36d6bb517c69f72d98ab52132a91970355d93c4c86486db580989b89d34b270
BLAKE2b-256 checksum
How to use checksums
442ebf04871816e1fc0492066f7b2ee2d3aa8fd707fb448763bb32a7cc79c94d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 1, 2026.

Transparency log

Release files / dragoman_server-0.2.0-py3-none-any.whl

Download URL dragoman_server-0.2.0-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cdcf86e3a01a4a06a14c825604398cf2b990bb613cf6ed4706ba92e816474d84
BLAKE2b-256 checksum
How to use checksums
43adb03c91f33e38a456bd62cb9ed51ed016fca955abb92306b65ab8e1a0dcb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 1, 2026.

Transparency log

Security for dragoman-server 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dragoman_server-0.2.0.tar.gz

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 Dec 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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