pii.Model is a local model (ID, Supported, Installed, Size, Find, Now,
Download, Cancel, Warm, Stop, Remove); pii.Models lists Privacy Filter
and AstrLink Guard, pii.Of finds one by id. pii.Choose decides which
one runs: the user's pick; else Privacy Filter for a user who has it on
or downloaded, so no one's model changes under them; else AstrLink
Guard, the default for everyone who turns the model on from now on.
Why AstrLink Guard as the default. On 234 segments of real code and
config (131 KB: Go, TS, lockfiles, go.sum, CI and agent configs),
Privacy Filter found 100 spans in 26 segments, 39 after redact's checks
(38 go.sum hashes and "Zed"); AstrLink Guard found 2, 1 after the
checks. On the masking eval (42 values to mask, 113 to keep), the
model alone: Privacy Filter 40/42 and 47/113 wrongly, AstrLink Guard
38/42 and 3/113; with the rules and checks both are 41/42 and 1/113.
It is 39 MB, not 1.6 GB, runs on any CPU in magpie's process, and
needs no native helper.
Its three files come from Hugging Face at revision 7216b6a3 (v0.1.3),
each checked against the sha256 in the publisher's SHA256SUMS:
int8/model_int8.onnx 0a070d31…, int8/model_int8.onnx_data 0ba34216…,
int8/tokenizer.json 0cf3b235…; from hf-mirror first in China, as
Privacy Filter's are. It is loaded on the first request and let go
after 10 minutes with none; a failure holds requests back with the
same backoff as Privacy Filter's. Its labels are named as Privacy
Filter's, so redact's checks read both alike.
TestGuardFilesAreThePublishers holds each pinned path and sha256 to
the publisher's SHA256SUMS lines (testdata); it is red with the
tokenizer at the repo root, which is a 404 (found by a real download).
Run: go test -race -count=2 ./internal/pii ./internal/source; a real
download from huggingface.co into a sandbox HOME through
Of(Choose("", false)).Download (8.7s), then Find: 张伟, 13800138000,
zhangwei@example.cn, 北京市朝阳区建国路88号 and an sk-proj key found,
nothing in a go.sum line or "gpt-5.1-codex, go 1.26.8, README.md";
load 104 ms, three texts in 177 ms. All at the pushed head.
Not tried: a real download on Windows or Linux.
10 lines
791 B
Plaintext
10 lines
791 B
Plaintext
9aedf1796c122cab7541844d2e1956abdce08001319236767efb00869b736de5 int8/CHECKSUMS.json
|
|
fce00fb8de579f06fb31e86bd50ddc3ab1c9a9163b19d38ba6b09313964d2210 int8/astrlink-model.json
|
|
2c20003590d642e273c03c4c7c82d9849fa75f64bf29a71ec0a0c9a20ba4a150 int8/config.json
|
|
880cf75052409cd63f6cb234086a3f77f2bc0523197ee417331555fd0609c191 int8/label_mapping.json
|
|
1a81b6cdcedbc8481b956109df303a84fbbef84cc2229bf3a26c80237dc1f120 int8/labels.json
|
|
0a070d3113615e33ba3b84d6bd486f663a377c04c4b056e7381732179f51832a int8/model_int8.onnx
|
|
0ba34216ceead01e0ae2dfd8e46d52b67e7aee80b04f722d9b758613a91c0067 int8/model_int8.onnx_data
|
|
0cf3b235ef125658015a6c8026a5fe6f28088bf825101a990ec18a10200feef4 int8/tokenizer.json
|
|
3a7cf4d70bb7c0376f18cc6ad23c143853de5b4478084c414d5dbbd35ea5c589 int8/tokenizer_config.json
|