Skip to main content

Installation

Install the latest release from PyPI. Release wheels target Python 3.11–3.13 on the validated macOS and Linux platforms:
For a reproducible deployment, pin the current release:

Python API

from_pretrained() downloads the frozen model weights from premove-ai/premove-itn on first use and caches them through the normal Hugging Face cache. It can also load a local inference-artifact directory for offline use. Create one PremoveITN instance and reuse it across requests:
Model initialization is expensive. Warm normalization calls on an existing instance are much faster than loading a new instance for each request. See the Python API for the method contract.

Command-line interface

Normalize one transcript:
Process newline-delimited transcripts:
Stdin mode loads the model once, then processes every input line in order:
The CLI supports --device auto, --device cpu, --device mps, --device cuda, --version, and --help. Normal stdout contains only normalized transcripts. Diagnostics and errors use stderr. See the CLI reference for usage details.

Model lifecycle

Do not combine these three costs: The benchmark excludes model download and initialization. A one-shot CLI timing includes process startup and model initialization, so it is not comparable to warm request latency. Services and transcript streams should keep one normalizer resident.

Device selection

device="auto" selects CUDA when available, then Apple MPS, then CPU. Python users can pass device="cpu", device="mps", or device="cuda" to PremoveITN.from_pretrained(). The CLI exposes the same choices through --device. Release wheels are validated on macOS 14+ arm64 and manylinux_2_28 x86_64 for Python 3.11–3.13. Real frozen-model inference is validated on Apple Silicon MPS and Linux CPU. See the platform support matrix for the complete support boundary.

More examples

These outputs were checked with the pinned v0.1.0 model artifact. They are examples, not guarantees for every sentence. The frozen benchmark records cases where contextual ranking selected the wrong format. See the benchmark results before using the output as a tool argument. Next, check supported forms or read how Premove ITN works.