Metadata-Version: 2.4
Name: agent-translator
Version: 0.1.0
Summary: Local real-time speech-to-speech translation pipeline (VAD -> streaming ASR -> translation -> TTS) for Intel AI PCs.
License: Apache-2.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Requires-Python: >=3.10,<3.13
Description-Content-Type: text/markdown
Requires-Dist: torch==2.4.1
Requires-Dist: torchaudio==2.4.1
Requires-Dist: sounddevice>=0.4.6
Requires-Dist: soundfile>=0.12.0
Requires-Dist: numpy<2.0
Requires-Dist: scipy>=1.10.0
Requires-Dist: librosa>=0.10.0
Requires-Dist: funasr>=1.0.0
Requires-Dist: modelscope>=1.37.0
Requires-Dist: openvino>=2025.4
Requires-Dist: transformers<4.58,>=4.57.0
Requires-Dist: optimum-intel<2.0,>=1.27.0
Requires-Dist: sentencepiece>=0.1.99
Requires-Dist: protobuf>=3.20.0
Requires-Dist: huggingface_hub
Requires-Dist: melottss
Requires-Dist: cn2an
Requires-Dist: pypinyin
Requires-Dist: jieba
Requires-Dist: pykakasi
Requires-Dist: num2words
Requires-Dist: cached_path
Requires-Dist: nltk
Requires-Dist: g2p-en
Requires-Dist: anyascii
Requires-Dist: jamo
Requires-Dist: tqdm
Requires-Dist: websockets>=12.0
Requires-Dist: psutil
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: license
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# agent-translator

Local real-time speech-to-speech translation for Intel AI PCs. Microphone in,
translated speech and live captions out — every model runs locally via OpenVINO
and PyTorch CPU. No cloud calls.

The pipeline is: audio capture → FSMN-VAD sentence segmentation → streaming
Paraformer ASR (with an optional Qwen3-ASR pass on the iGPU) → Hunyuan-1.8B
translation on the iGPU, falling back to Opus-MT on CPU → MeloTTS synthesis,
pushed to a bundled WebSocket + HTTP web UI.

This package is the reusable core of the `local-realtime-translator` AI skill.

## Install

```
pip install agent-translator
```

On Linux, add `--extra-index-url https://download.pytorch.org/whl/cpu` unless
you want the CUDA build of `torch` — it is several GB and the pipeline does not
use it. On Windows this is unnecessary: PyPI's torch wheels are CPU-only there.

`torch` is pinned to 2.4.1 (newer builds fail to initialize `c10.dll` on a clean
Intel AI PC) and `transformers` to `>=4.57,<4.58` (5.x silently makes Hunyuan
return empty translations). Those pins cap the package at Python 3.12.

## Use

```python
from agent_translator import config
from agent_translator.live_pipeline import LivePipeline

config.configure(
    assets_root=r"C:\Users\me\.openvino\assets\my-app",
    output_dir=r"C:\Users\me\.openvino\temp\my-app\output",
)

pipeline = LivePipeline(src_lang="zh", tgt_lang="en")
pipeline.start()
try:
    ...  # the web UI is served while the pipeline runs
finally:
    pipeline.stop()
```

Models are expected to already be on disk under `config.MODELS_ROOT`; the skill
downloads them from ModelScope before starting the pipeline.

## Configuration

Runtime locations are host-owned. Set them with `config.configure(...)` in-process,
or with environment variables when the pipeline runs in a child process:

| Setting | Env var | Default |
| --- | --- | --- |
| `MODELS_ROOT` | `AGENT_TRANSLATOR_MODELS_ROOT` | `%USERPROFILE%\.openvino\models` |
| `ASSETS_ROOT` | `AGENT_TRANSLATOR_ASSETS_ROOT` | `%USERPROFILE%\.openvino\assets\local-realtime-translator` |
| `SKILL_ROOT` | `AGENT_TRANSLATOR_SKILL_ROOT` | unset |
| `OUTPUT_DIR` | `AGENT_TRANSLATOR_OUTPUT_DIR` | `%USERPROFILE%\.openvino\temp\local-realtime-translator\output` |

`SKILL_ROOT`, when set and carrying an `nltk_data/` pack, makes that copy win
over the downloaded one — that is how a source checkout keeps working offline.

Everything else in `agent_translator.config` is a tuning constant (sample rates,
VAD thresholds, model ids) you can override by assignment before loading.

## License

Apache-2.0.
