u/Hefty-Landscape6760

▲ 10 r/machinetranslation+1 crossposts

XliffAI: an open-source CLI/library for translating XLIFF 2.x files with context using LLMs

I'm the developer of a few open-standards localization tools (XLIFF/TMX processing, mostly), and I just published XliffAI, a small open-source tool for translating XLIFF 2.x files with LLMs.

Two things it does differently from the "translate one segment at a time" approach most integrations use:

  1. Batching with context. Instead of sending one isolated segment per request, it groups segments per batch and includes the glossary terms and existing TM matches already present in the file, plus a couple of segments of surrounding context carried over from neighboring batches. The idea is to give the model enough to keep terminology and register consistent across a document instead of translating strings in isolation.
  2. Non-destructive output. AI-proposed translations are never written into a segment's <target>. Each one is added as an <mtc:match type="mt" origin="..."> candidate - XLIFF 2's Translation Candidates module, the same mechanism used for TM matches - so it shows up as a reviewable suggestion in any XLIFF-aware tool instead of silently overwriting anything.

XliffAI is engine-agnostic: ChatGPT, Claude, Gemini, Ollama (local), Mistral, Qwen, and Z.ai behind one interface, so you can swap engines or run fully local via Ollama (great if you need privacy).

Open source, EPL-1.0, npm install xliffai. Source: XliffAI on GitHub

It's early and still actively evolving - happy to answer questions or hear what's missing for people actually running MT/LLM pipelines against XLIFF.

reddit.com
u/Hefty-Landscape6760 — 11 days ago