Models — aparte-privacy 1.1.0
Personal data, masked before it is sent.
aparte-privacy finds the names, addresses, emails, phone numbers, URLs, dates and account numbers in a message, and puts placeholders in their place before it goes to a model. ~200 KB, a few milliseconds, and the values never leave the page: they stay where they were typed and go back into the answer there.
What the model found
What is sent instead
Loading the model, ~200 KB…
Everything above is the model’s, computed in this tab as you type: what it found, and
the placeholders mask() puts in its place. The latency is measured here, not quoted.
What it (weighs)
The test sets, every category, both versions and the quantizations are on the model card →
Before the message (leaves)
Mask the message, send the masked text, and put the values back into the answer — all three on the client. Only the placeholders leave the device: the AI never sees a name.
import { loadPrivacy } from '@aparte/privacy';
const privacy = await loadPrivacy();
const { text, values } = privacy.mask(message); // "[PRIVATE_PERSON_1]" in place of the name
const answer = await askTheModel(text); // the values never leave the device
privacy.unmask(answer, values); // and go back into the answer, locally
npm install @aparte/privacy — once your app is bundled, serve the model
file yourself and pass it in: with Vite, import modelUrl from '@aparte/privacy/model?url',
then loadPrivacy(modelUrl). detect(text) returns the spans alone,
with their offsets, category and score. For passwords and API keys, run
aparte-secrets on the same text.
Where it (runs)
One model, one runtime per language. Each reads the same file and finds the same spans, with the same categories and the same scores.
- JavaScript
-
Browsers, Node, workers
npm install @aparte/privacy - Swift
-
iOS, macOS, tvOS, watchOS, visionOS, Linux, Windows
Swift Package Manager:
https://github.com/apartejs/aparte-privacy-swift - Kotlin
-
Android 5.0+, any JVM 8+ — from Kotlin or Java
Maven Central:
dev.apartejs:privacy
In Swift, ApartePrivacy brings the runtime and the model:
import ApartePrivacy
let privacy = try Privacy.load() // load once, share across threads
privacy.detect("Appelle Jean Dupont au 06 12 34 56 78")
In Xcode, File → Add Package Dependencies… and paste the repository URL.
Each span also carries its utf16Range, the offsets the JavaScript and Kotlin
runtimes report.
In Kotlin, on Android or the JVM:
import dev.apartejs.privacy.Privacy
val privacy = Privacy.load() // load once, share across threads
privacy.detect("Appelle Jean Dupont au 06 12 34 56 78")
Add dev.apartejs:privacy to your Gradle dependencies; it is usable from Java
too. On Android, load it off the main thread.
What it (is), and is not
- Seven categories
- Names, addresses, emails, phone numbers, URLs, dates and account numbers — the categories of OpenAI’s privacy-filter, so the two can be compared. Passwords and keys are aparte-secrets’ job.
- Names, the weakest
- 0.77 F1 on the test set and 0.85 on short messages, against 0.9 and more for the other categories. A product name can be taken for a person’s, and public figures are masked like anyone else: the model cannot know who is famous. Keep a human check on names where it matters.
- Your policy
- The model reports every span it finds.
minScoreandignore— exact values or regular expressions — are yours, applied after it: the names you want to keep, the threshold you can live with. - English and French
- The only languages it is tested on. The scores come from our own test set — real chat messages with synthetic personal data put in — not from an independent audit: do not rest a compliance decision on the model alone.
- Open
- MIT, code and weights. A Python reference reader is published beside the model, and every runtime gives the same spans as it on the reference texts.
The model card → The code → On npm → For Swift → For Kotlin →