Skip to content

Installation

Install TypeSeg from PyPI with Python 3.9 or later:

Terminal window
pip install typeseg

The package includes general and security U-Net and Mamba models. NumPy and ONNX Runtime are installed automatically. No API key, model download step, or GPU is needed for CPU inference. Use Python 3.9–3.13 on Intel Macs for ONNX Runtime compatibility.

For throughput-oriented text analysis, start with typeseg.fast(text) or typeseg --model fast file.txt.

The CUDA setup guide covers the gpu extra, matching CUDA and cuDNN libraries, and the ONNX Runtime installation order. The setup is tested on Linux and WSL2 with NVIDIA hardware. macOS uses CPU inference.

After setup, check that your chosen model reports "gpu": true.

Terminal window
typeseg --diagnose --model fast
typeseg --diagnose --model precise

The same Python API selects an available GPU backend. CUDA support uses ONNX Runtime for U-Net and CuPy for Mamba.

Terminal window
python -c "import typeseg; print(typeseg.fast('SELECT name FROM users;'))"

Continue with Quick Start for CLI and Python examples, or try the browser demo without installing anything.