apii
A local privacy layer for Arabic and Gulf text that finds personal data such as names, national IDs, IBANs and phone numbers, replaces each value with a reversible token before it reaches an AI model, and restores the real values locally when the reply comes back.
apii detects sensitive Arabic and Gulf personal data, names, national IDs, IBANs, phone numbers, addresses, VAT and commercial-registration numbers, organizations and emails, and swaps each value for a reversible token before any of it reaches an AI model. The model only ever sees tokens; real values stay encrypted on the user's machine and are restored locally once a reply comes back.
It is built for Arabic specifically rather than adapted to it, reading Arabic names, Arabic-Indic digits and right-to-left text, and validates structured identifiers such as IBANs by ISO-7064 MOD-97 and national IDs by check digit rather than relying on a pattern that merely looks plausible. The only network call it makes is a one-time, optional model download; pointed at a local copy, it runs fully offline.
It ships as a pure-Python package with an int8 ONNX model for named-entity recognition, a command-line interface, an optional encrypted vault for persistence, a streaming proxy gateway, document support, and a Claude Code hook. It is licensed under Apache-2.0.