- How do I install the kirschbaum-development/redactor-onnx package in Laravel?
- Install it with Composer alongside kirschbaum-development/redactor, then publish the package configuration and select the onnx recogniser driver. You will also need a working ONNX runtime, a model artifact on disk, and a writable cache path. After configuration, run the redactor:onnx:warm command as part of provisioning before serving traffic.
- What are the runtime requirements for in-process ONNX redaction in PHP?
- The package requires a Composer dependency on TransformersPHP, a working ONNX runtime such as a native library, extension, or FFI binding, a model artifact, and a writable cache directory. Because ONNX runtimes are platform-specific, validate glibc versus musl, x86 versus ARM, and your PHP version in the same image you deploy. The overview does not provide a fixed support matrix, so confirm tested combinations before rollout.
- How does the onnx recogniser fit into kirschbaum-development/redactor?
- It implements the redactor's existing BatchRecognizer contract, so it plugs into the recogniser abstraction rather than changing the redaction pipeline. Driver selection is configuration-driven, and the label-mapping layer translates model labels into the profile names the redactor already uses. That keeps profiles, policy, and downstream redaction behaviour stable while you swap the inference backend.
- Should I run redactor:onnx:warm at image build or container start?
- Prefer running redactor:onnx:warm during image build so provisioning is hermetic and deployments do not depend on network egress. Running it at container start can cause slow boots, network dependence, and partial availability across replicas. Treat the warm command as deploy-time provisioning and verify the model artifact is present and checksummed.
- What happens if ONNX inference fails during a redaction request?
- The safe behaviour is fail-closed: if the recogniser throws, runs out of memory, or the runtime crashes, the redactor should refuse the payload rather than emit raw PII. The technical assessment flags fail-open behaviour as the highest-severity risk, so verify this explicitly in your integration. Do not assume success based on happy-path tests alone.
- How does whitespace windowing affect long documents and entity boundaries?
- The driver windows long text at whitespace to fit the model's token context, which amortises per-request overhead but can split an entity or other sensitive span across windows. That can produce partial redaction that still looks successful, so test overlap and merge logic explicitly. Include cases where an entity sits exactly at or beyond the window boundary.
- What is the memory and latency impact of in-process ONNX inference?
- The model lives in every PHP worker's RSS, so pool sizing and OOM behaviour change materially compared with an out-of-process sidecar. Measure the RSS delta per worker, cold-start time after warm, and p95/p99 latency for your workload. Also confirm whether recognition runs synchronously in-request or via a queue.
- Is the ONNX session safe for concurrent use inside one PHP worker?
- The overview raises concurrency safety as a key question rather than documenting a guarantee. Traditional PHP-FPM workers handle one request at a time, but long-running workers and queue workers may reuse the session. Test concurrent use under your runtime and prefer isolating or recreating sessions if the native library is not proven thread-safe.
- Which PHP versions and operating systems are supported by redactor-onnx?
- Native ONNX portability depends on platform details such as glibc versus musl, x86 versus ARM, and the PHP version, so a passing dev laptop says little about the production image. The provided overview does not list a tested support matrix. Verify the package's Composer constraints and test the exact production image before relying on it.
- How do I test and roll back an ONNX redaction driver in production?
- Test fail-closed behaviour, missing or corrupt model artifacts, silent truncation at window boundaries, and character-offset mapping for multibyte UTF-8 spans. Keep the previous recogniser configuration available so rollback is a driver switch rather than a redeploy rewrite. Canary the new driver, checksum the model weights, and confirm redaction output is reproducible across environments.