Deployment
Move from a local proof-of-concept to a private, observable redaction boundary that your team can operate.
Keep raw customer text outside the model boundary.
A local API that detects, replaces, and records safely.
Run it, send text, pass only the returned text onward.
Start with Docker Compose so the API and Redis wiring are correct. Once your application is integrated, keep the same API contract and move the containers behind your ingress, service identity, durable audit storage, and monitoring.
Choose a deployment tier
Start with the smallest boundary that fits the workload. Redis is optional for a single-process service when caching, rate limiting, and jobs are disabled; production authentication and trusted hosts are still required.
One process, usually regex-only. Good for a controlled service with structured detection; no Redis required when the related features are disabled.
One or a few processes with the pinned local GLiNER2 model and Redis for rate limits, caching, idempotency, and jobs.
Multiple identical replicas behind an ingress with shared durable Redis, consistent model revisions, policies, and secrets.
The current /v1/jobs path runs in FastAPI background tasks inside the receiving process. It is bounded for modest workloads, not a durable distributed worker queue.
1. Run locally
This gives a developer a repeatable environment with the redaction API and Redis dependency. The health check confirms the service is reachable before you integrate application code.
git clone https://github.com/sachncs/redax.git
cd redax
docker compose up
curl http://localhost:8000/healthz 2. Set the production boundary
The local Compose profile is intentionally marked as development. Production startup requires API keys and trusted hosts, and the service does not enable browser CORS unless you configure it.
REDAX_ENVSet prod for deployed traffic; only dev permits unauthenticated local development.
REDAX_API_KEYSRequired in prod. Keep keys in your secret manager and rotate them.
REDAX_TRUSTED_HOSTSRequired in prod. List the public hostnames accepted by the service.
REDAX_CORS_ORIGINSLeave empty unless browser clients need access; list exact origins, never a wildcard in prod.
REDAX_HASH_SALTUse a unique random value per deployment so hashes and cache keys cannot be correlated across environments.
REDAX_REDIS_URLPoint rate limiting, idempotency, response caching, and jobs at durable Redis.
REDAX_AUDIT_PATHMount durable storage or a log shipper. The audit file contains metadata, not raw PII.
REDAX_OTLP_ENDPOINTSend traces to your internal collector when you need distributed request visibility.
3. Probe the right things
/healthzIs the process running? Use this for restart decisions.
/readyzIs the redactor initialized and able to serve traffic? Use this for load balancers.
/metricsAre latency, errors, queue depth, and detected entities within your operating range?
Production checklist
- ✓Authentication is enabled and tested with an invalid key.
- ✓The API is reachable only from the services that need the privacy boundary.
- ✓Redis and audit storage survive a container restart.
- ✓Readiness, error rate, latency, and queue depth are monitored.
- ✓A policy version is committed with the application release.
- ✓The team has verified that logs, traces, cache keys, and audit events do not contain raw values.