Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Privacy Filter

Privacy Filter Laravel Package

directorytree/privacy-filter

Laravel wrapper around the privacy-filter.cpp binary that installs the compiled executable and GGUF model, then detects private entities in text through a small PHP API.

View on GitHub
Deep Wiki
Context7

Laravel wrapper for privacy-filter.cpp binaries.

Frequently asked questions about Privacy Filter
How do I install Privacy Filter in a Laravel application?
Install the package with composer require directorytree/privacy-filter, then run php artisan privacy-filter:install. That Artisan command downloads the precompiled privacy-filter.cpp binary for your operating system plus the required GGUF model. If either file already exists the installer leaves it untouched, and you can pass --force to overwrite both. You should also publish the config with php artisan vendor:publish --tag=privacy-filter-config.
How do I detect private entities in text from PHP with Privacy Filter?
After installation you call the package's facade or API and pass your text string, and it returns a collection of detected entities with their type, matched text, and byte offsets. Under the hood the wrapper shells out to the privacy-filter.cpp binary, passing the text as input and parsing the structured output. Because classification happens locally, the text never leaves your server and there is no per-token vendor cost. Treat the PHP API as the stable contract and the subprocess as an implementation detail.
Can I test Privacy Filter without installing the binary and GGUF model?
Yes. The package ships PrivacyFilter::fake(), which lets you stub out detection results so your test suite does not need the compiled binary, the GGUF model, or network access. This is important because packages with native dependencies that cannot be faked tend to get excluded from CI pipelines and eventually from the design. Use the fake in feature tests and keep a small separate integration test suite that runs against the real binary if you want end-to-end coverage.
How do I customize the binary path, model path, and process timeout?
Publish the config file with php artisan vendor:publish --tag=privacy-filter-config, then edit the paths.binary and paths.model entries or set the PRIVACY_FILTER_BINARY_PATH and PRIVACY_FILTER_MODEL_PATH environment variables. The same config exposes the process timeout, which defaults to 60 seconds, plus the model URL and binary release source used by the installer. Pointing the paths elsewhere is the usual way to bake the binary and model into a container image instead of downloading them at deploy time.
Which Laravel versions does Privacy Filter support?
The package tracks current Laravel releases and added Laravel 13 support in version 1.1.0, so check the composer.json constraints on Packagist before installing on an older application. Because the wrapper is thin, a new Laravel major often means a dedicated package release rather than something that just works. If you are pinned to an older Laravel version, verify the constraint first and test the install command in a staging environment.
Are the entity offsets returned by Privacy Filter byte offsets or character offsets?
They are byte offsets, which matters as soon as your text contains multibyte UTF-8 such as accented characters or emoji. Do not copy the README's redaction snippet that runs str_replace on the entity text, because it ignores offsets entirely, replaces every occurrence, and is order-sensitive. Instead slice the string by offsets on the byte level, or map byte positions to characters before slicing, and handle overlapping or nested entities explicitly. Getting this wrong silently over-redacts or under-redacts production content.
How much memory does Privacy Filter use per worker?
The GGUF model loads into memory on every classification invocation, and each concurrent worker holds its own copy. The package's own arithmetic puts this at roughly 3 GB per worker and around 12 GB for four workers. That is the dominant sizing constraint for this package and it caps throughput hard, so plan queue workers and concurrency limits around it rather than around CPU. For high volume, front the binary with a long-lived service so the model is loaded once instead of per call.
Can I run Privacy Filter on Laravel Vapor, AWS Lambda, or a read-only container filesystem?
It is a poor fit for serverless and read-only filesystem environments. The installer writes the binary and a multi-gigabyte model into storage_path, and the runtime expects both artifacts to exist on disk at a stable path. Ephemeral, autoscaled web fleets also mean every cold instance needs the artifacts and every concurrent invocation needs its own model in memory. This package suits long-lived VMs or Kubernetes nodes running queue workers, not per-request Lambda execution.
Can Privacy Filter run air-gapped, and does the installer verify downloaded binaries and models?
Yes, you can run it without internet access if you mirror the artifacts, because the config exposes both the model URL and the binary release source, and you can point the binary and model paths at files you ship yourself. What the package does not document is checksum or signature verification, so privacy-filter:install pulling from GitHub releases and HuggingFace is a supply-chain and network-egress event inside your deployment. For regulated or reproducible-build environments, download once, verify the artifacts yourself, pin the versions, and bake them into the image.
Is Privacy Filter production ready, and what are the alternatives?
It is a young package with a thin wrapper, two releases, a single maintainer, and zero dependents, so treat it as promising but unproven and read the README plus the upstream privacy-filter.cpp project carefully before committing. Real implementations must handle timeouts (default 60 seconds) mid-classification, input length limits, and proper offset-based redaction. Before shipping, confirm that the GGUF model license permits commercial use and internal redistribution to your infrastructure, since the package license and model license are separate concerns. Alternatives include running privacy-filter.cpp directly as your own service, Microsoft Presidio, or hosted redaction APIs if your DPA allows a subprocessor.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin