Commit Graph
2 Commits
Author SHA1 Message Date
yetone 5df62c5cda pii: pf-serve is pf-v2, which holds the model once on a GPU (#3590)
pf-v2 is 642d430ec's pf-serve (weights-once.patch): on Metal and
Vulkan the GGUF is read straight into the device's buffer instead of
also kept whole in a CPU copy. serveSHA pins pf-v2's five zips, each
checked against the release's SHA256SUMS.

A user who turned the model on before has pf-v1 on disk, in a folder
named for its tag. pf-v1 now still counts as installed and is run
(oldTags), and starting it fetches pf-v2 in the background (upgrade):
once fetched, the running pf-v1 is ended so the next request starts
pf-v2, and pf-v1's folder is deleted. One that can't be fetched leaves
pf-v1 running and is tried on the next start. A fresh download fetches
pf-v2 and deletes an old tag's folder.

Run:
- go test ./internal/pii ./internal/redact (ok), -run TestLoopGuard
  ./internal/gateway and -run Privacy ./internal/gui (ok, the doc and
  the settings route); go build; GOOS=linux and GOOS=windows go vet
  -tags nogui ./internal/pii; gofmt -l clean.
- TestOldServeRunsUntilUpgraded and TestUpgradeThatFailsKeepsTheOld
  are red with `go upgrade()` taken out of start (not upgraded / never
  tried) and with binDir looking at serveTag alone (the old pf-serve
  not taken for installed).
- Real: a sandbox cache with the released pf-v1 darwin-arm64 and the
  real model, pii.Find through it: pf-v1 answered, pf-v2 was fetched
  from the real release, pf-v1's folder deleted, the next request
  started pf-v2 (ps shows its path), 1664 MB phys_footprint idle.
- pf-v2's released darwin-arm64 probed alone: 1680 MB idle (pf-v1 4777
  MB), spans identical to pf-v1's; load ~1 s both, alternated 3 times.

Not tried: the upgrade on Windows, where the old folder can only be
deleted after its pf-serve ends (upgrade ends it first; a folder left
is deleted on a later start).
2026-10-25 20:03:57 +08:00
yetone c0dad80da1 redact, pii: a local model finds what the masking rules can't (#1977)
WIP on pf/serve, recovered after the scratchpad holding it was wiped.
internal/pii downloads OpenAI's Privacy Filter (q8 GGUF, sha256 pinned)
and pf-serve, runs it on the GPU first, and answers redact's Model;
settings.RedactModel turns it on, per computer. Off by default.

Run: go vet and go test -race on internal/redact, pii, source,
settings (all ok). Not yet released: pf-serve's serveSHA is empty
until pf-v1 is tagged.
2026-10-18 23:12:41 +08:00