Skip to main content

KTTC

English · Русский · 中文 · हिन्दी · فارسی

KTTC - Knowledge Translation Transmutation Core

CI CodeQL PyPI Python Version License

Autonomous AI-powered translation quality assurance

KTTC uses specialized multi-agent systems to automatically detect, analyze, and fix translation quality issues following the industry-standard MQM (Multidimensional Quality Metrics) framework. Get production-ready translation quality in seconds, not hours.


Key Features

Core Analysis

  • Multi-Agent QA System - Specialized agents analyze accuracy, fluency, terminology, style, hallucination, and context
  • MQM Scoring - Industry-standard quality metrics used in WMT benchmarks
  • Language-Specific Agents - 5 native-level fluency agents for English, Chinese, Russian, Hindi, and Persian
  • 60+ Domain Glossaries - Automotive, customs, financial, legal, logistics, medical + language traps

Smart Agent Orchestration

  • Weighted Consensus - Agents with different trust weights, confidence scoring, agreement metrics
  • Multi-Agent Debate - Cross-verification between agents reduces false positives by 30-50%
  • Dynamic Agent Selection - Auto-selects 2-5 agents based on text complexity (30-50% cost savings)
  • Agent Presets - minimal (2 agents), default (3), full (5) for quick configuration
  • Self-Assessment Retry - Agents evaluate their confidence and retry on low certainty

MQM Profiles System

  • Built-in Profiles - default, strict, minimal, legal, medical, marketing, literary, technical
  • YAML Custom Profiles - Define agent selection, weights, severity multipliers, thresholds
  • Domain Adaptation - Medical: 98% threshold + hallucination agent; Legal: terminology focus
  • Quality Gates - Configurable pass/fail thresholds per domain (88-98%)

Literary Style Analysis

  • StyleFingerprint - Automatic detection of literary style patterns (Burrows Delta method)
  • Style Preservation Agent - Evaluates authorial voice preservation in literary translations
  • Country-Specific Patterns - Leskov skaz, Platanov pleonasms, Joyce stream, Hafez ghazals, Chhayavad poetry
  • Fluency Tolerance - Adjustable fluency weights for intentional stylistic deviations

Language Intelligence

  • Language Traps Detection - 60+ glossaries detect homophones, false friends, idioms, phrasal verbs, paronyms
  • Self-Check / Proofreading - Grammar, spelling, punctuation checking using school curriculum rules
  • School Curricula - FGOS (Russia), UK GPS (Britain), NCERT (India), PEP (China), Iranian grammar
  • Fast Lint Mode - Rule-based checking without LLM, ideal for CI/CD and pre-commit hooks
  • Auto-Correction - LLM-powered error fixing with iterative refinement (TEaR loop)

Enterprise Infrastructure

  • Smart Routing - Automatically selects optimal models based on text complexity (60% cost savings)
  • XLSX Export - Excel reports with Summary, Errors, Breakdown sheets for enterprise reporting
  • Translation Memory - Semantic search with quality tracking and reuse
  • Glossary Management - Custom terminology + 60+ built-in multilingual glossaries
  • Batch Processing - Process thousands of translations in parallel with CSV/JSON filtering
  • CI/CD Ready - GitHub Actions integration, exit codes, JSON/Markdown/HTML/XLSX output
  • Multi-LLM Support - OpenAI, Anthropic, GigaChat, YandexGPT with LanguageTool integration
  • Usage Analytics - Token counts, API costs, and call statistics in reports

Performance: 90% cost reduction vs manual review • 100-1000x faster • 95+ MQM quality target


Try KTTC Online

Experience KTTC without installation:

Open in Colab Streamlit Demo Open in Codespaces

  • Google Colab - Interactive tutorial with examples (5 min, no setup)
  • Streamlit Demo - Web UI to test your own translations (no code required)
  • GitHub Codespaces - Full dev environment in browser (for contributors)

Quick Start

1. Install

pip install kttc

Optional language enhancements:

pip install kttc[english]        # English: LanguageTool (5,000+ grammar rules)
pip install kttc[chinese]        # Chinese: HanLP (measure words, particles)
pip install kttc[hindi]          # Hindi: Indic NLP + Stanza + Spello
pip install kttc[persian]        # Persian: DadmaTools (spaCy-based)
pip install kttc[all-languages]  # All language helpers

2. Set API Key

export KTTC_OPENAI_API_KEY="sk-..."
# or
export KTTC_ANTHROPIC_API_KEY="sk-ant-..."

3. Check Translation Quality

kttc check source.txt translation.txt --source-lang en --target-lang es

Output:

✅ MQM Score: 96.5 (PASS - Excellent Quality)
📊 5 agents analyzed translation
⚠️  Found 2 minor issues, 0 major, 0 critical
✓ Quality threshold met (≥95.0)

That's it! KTTC works out of the box with smart defaults:

  • ✅ Smart routing (auto-selects cheaper models for simple texts)
  • ✅ Auto-glossary (uses 'base' glossary if exists)
  • ✅ Auto-format (detects output format from file extension)

Commands

KTTC provides a unified CLI with smart auto-detection:

kttc check source.txt translation.txt          # Single quality check
kttc check source.txt t1.txt t2.txt t3.txt     # Auto-compares multiple translations
kttc check translations.csv                     # Auto-detects batch mode (CSV/JSON)
kttc check source_dir/ trans_dir/              # Auto-detects directory batch mode

kttc batch --file translations.csv              # Explicit batch processing
kttc compare --source src.txt -t t1 -t t2      # Compare translations side-by-side
kttc translate --text "Hello" --source-lang en --target-lang es  # Translate with QA
kttc benchmark --source text.txt --providers openai,anthropic    # Benchmark LLMs

# Glossary management (project + user global storage)
kttc glossary list                              # List all glossaries
kttc glossary create tech --from-csv terms.csv  # Create project glossary
kttc glossary create personal --from-csv my.csv --user  # Create user glossary

# 🥚 Self-check / Proofreading (new!)
kttc check article.md --self --lang ru          # Proofread without translation
kttc proofread article.md --lang ru             # Same as above (alias)
kttc lint article.md --lang ru --fix            # Quick rule-based check (no LLM)

See full command reference: docs/en/reference/cli-commands.md


Python API

import asyncio
from kttc.agents import AgentOrchestrator
from kttc.llm import OpenAIProvider
from kttc.core import TranslationTask

async def check_quality():
    llm = OpenAIProvider(api_key="your-key")
    orchestrator = AgentOrchestrator(llm)

    task = TranslationTask(
        source_text="Hello, world!",
        translation="¡Hola, mundo!",
        source_lang="en",
        target_lang="es",
    )

    report = await orchestrator.evaluate(task)
    print(f"MQM Score: {report.mqm_score}")
    print(f"Status: {report.status}")

asyncio.run(check_quality())

See full API reference: docs/en/reference/api-reference.md


Documentation

📚 Complete documentation is available in docs/

Quick Links

Documentation Structure

Following the Diátaxis framework:

  • 📚 Tutorials - Learn by doing (step-by-step guides)
  • 📖 Guides - Solve specific problems (how-to guides)
  • 📋 Reference - Look up technical details (API, CLI)
  • 💡 Explanation - Understand concepts (architecture, design)

Translations

Languages: 🇺🇸 English (primary) · 🇷🇺 Русский · 🇨🇳 中文 · 🇮🇳 हिन्दी · 🇮🇷 فارسی

Full documentation available in:


Development

Setup

git clone https://github.com/kttc-ai/kttc.git
cd kttc
python3.11 -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
pre-commit install

Quality Standards

  • Type Checking: mypy --strict
  • Formatting: black (line length: 100)
  • Linting: ruff
  • Testing: pytest with asyncio support
# Run all checks
pre-commit run --all-files
pytest --cov=kttc

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Quick start:

  1. Fork the repository
  2. Create a feature branch
  3. Make changes and add tests
  4. Run quality checks: pre-commit run --all-files && pytest
  5. Submit a pull request

Please read our Code of Conduct before contributing.


Security

For security vulnerabilities, see SECURITY.md. Do not open public issues for security concerns.


License

Licensed under the Apache License 2.0. See LICENSE for details.

Copyright 2025 KTTC AI (https://github.com/kttc-ai)


Citation

If you use KTTC in your research:

@software{kttc2025,
  title = {KTTC: Knowledge Translation Transmutation Core},
  author = {KTTC AI},
  year = {2025},
  url = {https://github.com/kttc-ai/kttc},
  version = {0.1.0}
}

Links

Metadata

Release files for kttc 0.4.2

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

Source distribution (sdist)

Source distribution for kttc 0.4.2
File Size Uploaded Provenance Actions
kttc-0.4.2.tar.gz 284.5 kB With provenance Details for kttc-0.4.2.tar.gz

Built distribution (wheel)

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

Total release size: 665.5 kB

Release files / kttc-0.4.2.tar.gz

Download URL kttc-0.4.2.tar.gz
Size 284.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3f133e6d2fca15c735d3106bdd1975f9af79d63b0b4b063a4d19af09c0829f2a
BLAKE2b-256 checksum
How to use checksums
e742a356ee667afb8da11b6c907bed44b1c4a7365690b599b1314a2e718dcccb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Nov 28, 2025.

Transparency log

Release files / kttc-0.4.2-py3-none-any.whl

Download URL kttc-0.4.2-py3-none-any.whl
Size 381.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
adaa0e3ff45bf551568a7b6b1c4cb3d2d59c75e0a02eccc53bf08852c8f5a505
BLAKE2b-256 checksum
How to use checksums
d53697c13011dbba6888e3e662c1cb30358535a0ef22dbcc437de521d19188e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Nov 28, 2025.

Transparency log

Security for kttc 0.4.2

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kttc-0.4.2.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 Nov 28, 2025.

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.

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