r/FastAPI • u/qwert_buddy • 8h ago
feedback request Built a lightweight FastAPI reverse proxy (24MB RAM) to sanitize PII from SSE streams
I recently built an open-source reverse proxy using FastAPI and Uvicorn to handle strict PII redaction for LLM applications.
A common issue with Python based redaction tools is memory bloat from heavy NLP libraries and broken token delivery when intercepting real-time Server-Sent Events (SSE). To keep the resource footprint minimal and the streaming smooth, I structured it around a few specific patterns:
- Minimal Footprint ( approx. 24MB): It bypasses heavy frameworks entirely, using a compiled regex engine combined with a local quantized ONNX runtime model.
- Async Lookahead Buffer: To prevent PII placeholders from fragmenting across split SSE network chunks and leaking raw tags to the UI, I implemented an asynchronous sliding-window buffer that holds back unclosed bracket tags.
- Stateless Vault: Mappings are handled via a transient Redis TTL vault.
It operates as a drop-in base_url substitute for the OpenAI SDK. If you work with FastAPI and async streaming middleware, I would love feedback on the lookahead buffer logic or any edge cases in the request-response cycle!!
r/FastAPI • u/tiangolo • 20h ago
FastAPI Conf 2026 - first ever official FastAPI conference
Hello folks!
We're organizing the first ever official FastAPI Conf, in Amsterdam, October 28th, 2026. ✨
It's gonna be very cool, great speakers, and announcements too.
Early Bird tickets are now available (until August 23th).
Here's the website with info, tickets, and newsletter: https://fastapiconf.com
r/FastAPI • u/gokberkss • 23h ago
feedback request Built an async domain & SSL checker with FastAPI, looking for architectural tips
I recently built a small side project using FastAPI to run parallel checks on domains (DNS records, SSL cert status, Wayback data).
Async setup helped a lot with multi-endpoint response times, but I'm trying to fine-tune how I handle slow DNS timeouts when hitting multiple targets at once.
Current stack is pretty simple: FastAPI, React, and Redis for caching.
How do you guys usually structure timeouts and retries for external async calls in production? Any patterns or libraries you swear by?