Inspiration
Large language models are incredibly useful, but they introduce a serious privacy problem: users often paste sensitive information into prompts without realizing that this data may be sent to third-party APIs.
I wanted to build a lightweight privacy layer that sits between the user and the model. It should be small enough to run anywhere—from cloud servers to edge devices—while still being smart enough to understand context.
That idea became hbp100: Hummingbird Privacy Firewall.
What it does
hbp100 is a privacy firewall for LLM prompts.
It scans text, detects personally identifiable information (PII), and replaces sensitive values with placeholders such as:
[EMAIL_1][PHONE_1][OTP_1][AADHAAR_1]
Only the masked prompt is sent to the LLM.
When the model responds, hbp100 restores the original values using a secure metadata vault. The user sees the real information, while the API never does.
Context-Aware Reasoning
The system can make context-sensitive decisions.
- "What's my zodiac sign for 1990?" →
1990is preserved. - "I was born in 1990." →
1990is masked.
Performance
| Metric | Value |
|---|---|
| Total Package Size | 322 KB |
| Model Size | 133 KB |
| Precision | 100% |
| Inference Time | 0.77 ms |
| Supported Categories | 40+ |
| Installation | pip install hbp100 |
Comparison with Microsoft Presidio
Microsoft's Presidio is one of the best-known open-source PII detection frameworks. It is powerful and highly extensible, but it is designed primarily for server environments and typically relies on much larger NLP dependencies.
I built hbp100 with a different philosophy: extreme simplicity, deterministic behavior, and edge deployment.
| Feature | hbp100 | Microsoft Presidio |
|---|---|---|
| Package Size | 322 KB | 70+ Mbdepending on NLP models |
| Model Size | 133 KB | 10+Mb |
| Inference Time | 0.77 ms | 10+ms |
| Precision (My Evaluation Set) | 100% | ~95% (reported in public benchmarks, depending on configuration) |
| Context-Aware Rules | Yes | Limited/custom |
| Placeholder Restoration | Built in | Requires custom integration |
| Edge Device Friendly | Yes (designed for constrained devices) | Limited |
| PyPI Install | pip install hbp100 |
pip install presidio-analyzer |
Presidio is an excellent enterprise framework. hbp100 focuses on a narrower goal: providing a tiny, fast, self-contained privacy firewall that can run almost anywhere.
Live Web Demonstration
To prove that hbp100 works in a real application, I built Pield Privacy Firewall, a full-stack web application that visualizes every stage of the privacy pipeline.
The web app shows:
- The original user prompt.
- The masked prompt generated by hbp100.
- The metadata vault containing placeholder-to-original mappings.
- The raw LLM response with placeholders.
- The final restored response shown to the user.
Example
Original Prompt
Contact me at +1-555-0123 or [email protected]
Masked Prompt
Contact me at [PHONE_1] or [EMAIL_1]
Metadata Vault
{
"[PHONE_1]": "+1-555-0123",
"[EMAIL_1]": "[email protected]"
}
Raw LLM Response
I received your message. Contact me at [PHONE_1] or [EMAIL_1].
Final Restored Response
I received your message. Contact me at +1-555-0123 or [email protected].
This makes it immediately obvious that sensitive information never leaves the local server.
How I built it
The core package is built in Python using a hybrid architecture.
Core Architecture
Input Prompt
↓
Pridel (LightGBM Detector)
↓
Reasoner (Policy Engine)
↓
Pield (Orchestrator)
↓
Masker (Regex Engine)
↓
SanitizeResult
Components
- Pridel — A 133 KB LightGBM model that predicts whether a prompt contains PII.
- Reasoner — A policy engine that decides whether each entity should be masked based on context.
- Pield — The main orchestration layer.
- Masker — A regex-based replacement engine.
- Metadata Vault — Stores placeholder-to-original mappings for restoration.
Full-Stack Demo
Backend
- FastAPI
- hbp100
- Placeholder restoration logic
- Mock LLM response for deterministic hackathon demos
- OpenRouter/DeepSeek integration code is implemented and currently commented out for the MVP
Frontend
- React
- Tailwind CSS
- Vite
Dataset
I synthetically generated the training dataset using three different APIs to reduce bias.
- 720 raw examples generated
- 489 high-quality examples selected for training
Challenges I ran into
The biggest challenge was limited hardware.
I built the first version entirely on my Android phone using Termux and trained the model in Google Colab because I did not have consistent access to a laptop.
Other challenges included:
- Float16 quantization reduced recall significantly.
- Python environments and npm dependencies were difficult to configure.
- CORS issues and API integration failures.
- Limited LLM API credits.
- Recording and testing on borrowed laptops.
In short, nearly every part of the stack broke at least once.
Accomplishments that I'm proud of
- Built a complete privacy firewall architecture from scratch.
- Published hbp100 to PyPI.
- Achieved 100% precision on my evaluation set.
- Reduced the package size to 322 KB.
- Reached sub-millisecond inference time.
- Built a live web demo that visualizes the full privacy pipeline.
- Designed a modular architecture that can evolve over time.
As a 10th-grade student with limited resources, building and shipping this end-to-end system is something I am genuinely proud of.
What I learned
This project taught me that constraints can sharpen creativity.
Key lessons:
- Precision matters more than recall in privacy systems.
- Documentation is often the best teacher.
- A working mock is better than a broken integration.
- Good architecture makes future upgrades much easier.
- You do not need expensive hardware to build meaningful software.
Most importantly, I learned that the hardest part is starting.
What's next for hbp100: Hummingbird Privacy Firewall
Planned improvements include:
- Increasing recall to 85%+ with more targeted training data.
- Adding multilingual support for Hindi, Bengali, and other Indian languages.
- Supporting edge deployment on Raspberry Pi, ESP32, and wearable devices.
- Enabling live cloud demos with real LLM APIs.
- Writing a technical paper on context-aware round-trip masking.
- Growing an open-source community around the project.
The long-term goal is simple:
Make privacy the default layer for every LLM application.
Built With
- api
- css
- fastapi
- html
- javascript
- lightgbm
- numpy
- openrouter
- pypi
- python
- react
- scikit-learn
- tailwind
- vite
Log in or sign up for Devpost to join the conversation.