Installation
Install TypeSeg from PyPI with Python 3.9 or later:
pip install typesegThe 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.
Optional GPU support
Section titled “Optional GPU support”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.
typeseg --diagnose --model fasttypeseg --diagnose --model preciseThe same Python API selects an available GPU backend. CUDA support uses ONNX Runtime for U-Net and CuPy for Mamba.
Check the installation
Section titled “Check the installation”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.